/*!
 * html2canvas 1.0.0-rc.7 <https://html2canvas.hertzen.com>
 * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */
!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A=A||self).html2canvas=e()}(this,(function(){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])},A(e,t)};function e(e,t){function r(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n]);return A},t.apply(this,arguments)};function r(A,e,t,r){return new(t||(t=Promise))((function(n,B){function s(A){try{i(r.next(A))}catch(A){B(A)}}function o(A){try{i(r.throw(A))}catch(A){B(A)}}function i(A){A.done?n(A.value):new t((function(e){e(A.value)})).then(s,o)}i((r=r.apply(A,e||[])).next())}))}function n(A,e){var t,r,n,B,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return B={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(B[Symbol.iterator]=function(){return this}),B;function o(B){return function(o){return function(B){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(n=2&B[0]?r.return:B[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,B[1])).done)return n;switch(r=0,n&&(B=[2&B[0],n.value]),B[0]){case 0:case 1:n=B;break;case 4:return s.label++,{value:B[1],done:!1};case 5:s.label++,r=B[1],B=[0];continue;case 7:B=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==B[0]&&2!==B[0])){s=0;continue}if(3===B[0]&&(!n||B[1]>n[0]&&B[1]<n[3])){s.label=B[1];break}if(6===B[0]&&s.label<n[1]){s.label=n[1],n=B;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(B);break}n[2]&&s.ops.pop(),s.trys.pop();continue}B=e.call(A,s)}catch(A){B=[6,A],r=0}finally{t=n=0}if(5&B[0])throw B[1];return{value:B[0]?B[1]:void 0,done:!0}}([B,o])}}}for(var B=function(){function A(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}return A.prototype.add=function(e,t,r,n){return new A(this.left+e,this.top+t,this.width+r,this.height+n)},A.fromClientRect=function(e){return new A(e.left,e.top,e.width,e.height)},A}(),s=function(A){return B.fromClientRect(A.getBoundingClientRect())},o=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var B=A.charCodeAt(t++);56320==(64512&B)?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--)}else e.push(n)}return e},i=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,B="";++n<t;){var s=A[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===t||r.length>16384)&&(B+=String.fromCharCode.apply(String,r),r.length=0)}return B},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Q=0;Q<64;Q++)c[a.charCodeAt(Q)]=Q;var u,w=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},U=function(){function A(A,e,t,r,n,B){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=B}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),l=10,C=13,g=15,E=17,F=18,h=19,H=20,d=21,f=22,p=24,N=25,K=26,I=27,T=28,m=30,R=32,L=33,O=34,v=35,D=37,b=38,S=39,M=40,y=42,_="×",P="÷",x=function(A){var e,t,r,n=function(A){var e,t,r,n,B,s=.75*A.length,o=A.length,i=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),Q=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e<o;e+=4)t=c[A.charCodeAt(e)],r=c[A.charCodeAt(e+1)],n=c[A.charCodeAt(e+2)],B=c[A.charCodeAt(e+3)],Q[i++]=t<<2|r>>4,Q[i++]=(15&r)<<4|n>>2,Q[i++]=(3&n)<<6|63&B;return a}(A),B=Array.isArray(n)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(n):new Uint32Array(n),s=Array.isArray(n)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(n):new Uint16Array(n),o=w(s,12,B[4]/2),i=2===B[5]?w(s,(24+B[4])/2):(e=B,t=Math.ceil((24+B[4])/4),e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r)));return new U(B[0],B[1],B[2],B[3],o,i)}("[encoded data, 50624 characters]"),V=[m,36],z=[1,2,3,5],X=[l,8],J=[I,K],G=z.concat(X),k=[b,S,M,O,v],W=[g,C],Y=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){if((i=r[++B])===e)return!0;if(i!==l)break}if(n===l)for(B=t;B>0;){var s=r[--B];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o=t;o<=r.length;){var i;if((i=r[++o])===e)return!0;if(i!==l)break}if(s!==l)break}return!1},q=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==l)return r;t--}return 0},Z=function(A,e,t,r,n){if(0===t[r])return _;var B=r-1;if(Array.isArray(n)&&!0===n[B])return _;var s=B-1,o=B+1,i=e[B],a=s>=0?e[s]:0,c=e[o];if(2===i&&3===c)return _;if(-1!==z.indexOf(i))return"!";if(-1!==z.indexOf(c))return _;if(-1!==X.indexOf(c))return _;if(8===q(B,e))return P;if(11===x.get(A[B])&&(c===D||c===R||c===L))return _;if(7===i||7===c)return _;if(9===i)return _;if(-1===[l,C,g].indexOf(i)&&9===c)return _;if(-1!==[E,F,h,p,T].indexOf(c))return _;if(q(B,e)===f)return _;if(Y(23,f,B,e))return _;if(Y([E,F],d,B,e))return _;if(Y(12,12,B,e))return _;if(i===l)return P;if(23===i||23===c)return _;if(16===c||16===i)return P;if(-1!==[C,g,d].indexOf(c)||14===i)return _;if(36===a&&-1!==W.indexOf(i))return _;if(i===T&&36===c)return _;if(c===H&&-1!==V.concat(H,h,N,D,R,L).indexOf(i))return _;if(-1!==V.indexOf(c)&&i===N||-1!==V.indexOf(i)&&c===N)return _;if(i===I&&-1!==[D,R,L].indexOf(c)||-1!==[D,R,L].indexOf(i)&&c===K)return _;if(-1!==V.indexOf(i)&&-1!==J.indexOf(c)||-1!==J.indexOf(i)&&-1!==V.indexOf(c))return _;if(-1!==[I,K].indexOf(i)&&(c===N||-1!==[f,g].indexOf(c)&&e[o+1]===N)||-1!==[f,g].indexOf(i)&&c===N||i===N&&-1!==[N,T,p].indexOf(c))return _;if(-1!==[N,T,p,E,F].indexOf(c))for(var Q=B;Q>=0;){if((u=e[Q])===N)return _;if(-1===[T,p].indexOf(u))break;Q--}if(-1!==[I,K].indexOf(c))for(Q=-1!==[E,F].indexOf(i)?s:B;Q>=0;){var u;if((u=e[Q])===N)return _;if(-1===[T,p].indexOf(u))break;Q--}if(b===i&&-1!==[b,S,O,v].indexOf(c)||-1!==[S,O].indexOf(i)&&-1!==[S,M].indexOf(c)||-1!==[M,v].indexOf(i)&&c===M)return _;if(-1!==k.indexOf(i)&&-1!==[H,K].indexOf(c)||-1!==k.indexOf(c)&&i===I)return _;if(-1!==V.indexOf(i)&&-1!==V.indexOf(c))return _;if(i===p&&-1!==V.indexOf(c))return _;if(-1!==V.concat(N).indexOf(i)&&c===f||-1!==V.concat(N).indexOf(c)&&i===F)return _;if(41===i&&41===c){for(var w=t[B],U=1;w>0&&41===e[--w];)U++;if(U%2!=0)return _}return i===R&&c===L?_:P},j=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],r=[],n=[];return A.forEach((function(A,B){var s=x.get(A);if(s>50?(n.push(!0),s-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(B),t.push(16);if(4===s||11===s){if(0===B)return r.push(B),t.push(m);var o=t[B-1];return-1===G.indexOf(o)?(r.push(r[B-1]),t.push(o)):(r.push(B),t.push(m))}return r.push(B),31===s?t.push("strict"===e?d:D):s===y||29===s?t.push(m):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(D):t.push(m):void t.push(s)})),[r,t,n]}(A,e.lineBreak),r=t[0],n=t[1],B=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(n=n.map((function(A){return-1!==[N,m,y].indexOf(A)?D:A})));var s="keep-all"===e.wordBreak?B.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0;return[r,n,s]},$=function(){function A(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}return A.prototype.slice=function(){return i.apply(void 0,this.codePoints.slice(this.start,this.end))},A}();!function(A){A[A.STRING_TOKEN=0]="STRING_TOKEN",A[A.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",A[A.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",A[A.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",A[A.COMMA_TOKEN=4]="COMMA_TOKEN",A[A.HASH_TOKEN=5]="HASH_TOKEN",A[A.DELIM_TOKEN=6]="DELIM_TOKEN",A[A.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",A[A.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",A[A.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",A[A.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",A[A.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",A[A.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",A[A.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",A[A.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",A[A.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",A[A.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",A[A.NUMBER_TOKEN=17]="NUMBER_TOKEN",A[A.FUNCTION=18]="FUNCTION",A[A.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",A[A.IDENT_TOKEN=20]="IDENT_TOKEN",A[A.COLUMN_TOKEN=21]="COLUMN_TOKEN",A[A.URL_TOKEN=22]="URL_TOKEN",A[A.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",A[A.CDC_TOKEN=24]="CDC_TOKEN",A[A.CDO_TOKEN=25]="CDO_TOKEN",A[A.COLON_TOKEN=26]="COLON_TOKEN",A[A.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",A[A.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",A[A.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",A[A.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",A[A.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",A[A.EOF_TOKEN=32]="EOF_TOKEN"}(u||(u={}));var AA=45,eA=43,tA=-1,rA=function(A){return A>=48&&A<=57},nA=function(A){return rA(A)||A>=65&&A<=70||A>=97&&A<=102},BA=function(A){return 10===A||9===A||32===A},sA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},oA=function(A){return sA(A)||rA(A)||A===AA},iA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},aA=function(A,e){return 92===A&&10!==e},cA=function(A,e,t){return A===AA?sA(e)||aA(e,t):!!sA(A)||!(92!==A||!aA(A,e))},QA=function(A,e,t){return A===eA||A===AA?!!rA(e)||46===e&&rA(t):rA(46===A?e:A)},uA=function(A){var e=0,t=1;A[e]!==eA&&A[e]!==AA||(A[e]===AA&&(t=-1),e++);for(var r=[];rA(A[e]);)r.push(A[e++]);var n=r.length?parseInt(i.apply(void 0,r),10):0;46===A[e]&&e++;for(var B=[];rA(A[e]);)B.push(A[e++]);var s=B.length,o=s?parseInt(i.apply(void 0,B),10):0;69!==A[e]&&101!==A[e]||e++;var a=1;A[e]!==eA&&A[e]!==AA||(A[e]===AA&&(a=-1),e++);for(var c=[];rA(A[e]);)c.push(A[e++]);var Q=c.length?parseInt(i.apply(void 0,c),10):0;return t*(n+o*Math.pow(10,-s))*Math.pow(10,a*Q)},wA={type:u.LEFT_PARENTHESIS_TOKEN},UA={type:u.RIGHT_PARENTHESIS_TOKEN},lA={type:u.COMMA_TOKEN},CA={type:u.SUFFIX_MATCH_TOKEN},gA={type:u.PREFIX_MATCH_TOKEN},EA={type:u.COLUMN_TOKEN},FA={type:u.DASH_MATCH_TOKEN},hA={type:u.INCLUDE_MATCH_TOKEN},HA={type:u.LEFT_CURLY_BRACKET_TOKEN},dA={type:u.RIGHT_CURLY_BRACKET_TOKEN},fA={type:u.SUBSTRING_MATCH_TOKEN},pA={type:u.BAD_URL_TOKEN},NA={type:u.BAD_STRING_TOKEN},KA={type:u.CDO_TOKEN},IA={type:u.CDC_TOKEN},TA={type:u.COLON_TOKEN},mA={type:u.SEMICOLON_TOKEN},RA={type:u.LEFT_SQUARE_BRACKET_TOKEN},LA={type:u.RIGHT_SQUARE_BRACKET_TOKEN},OA={type:u.WHITESPACE_TOKEN},vA={type:u.EOF_TOKEN},DA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(o(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==vA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(oA(e)||aA(t,r)){var n=cA(e,t,r)?2:1,B=this.consumeName();return{type:u.HASH_TOKEN,value:B,flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),CA;break;case 39:return this.consumeStringToken(39);case 40:return wA;case 41:return UA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fA;break;case eA:if(QA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return lA;case AA:var s=A,o=this.peekCodePoint(0),a=this.peekCodePoint(1);if(QA(s,o,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(cA(s,o,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(o===AA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),IA;break;case 46:if(QA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(42===c&&47===(c=this.consumeCodePoint()))return this.consumeToken();if(c===tA)return this.consumeToken()}break;case 58:return TA;case 59:return mA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===AA&&this.peekCodePoint(2)===AA)return this.consumeCodePoint(),this.consumeCodePoint(),KA;break;case 64:var Q=this.peekCodePoint(0),w=this.peekCodePoint(1),U=this.peekCodePoint(2);if(cA(Q,w,U)){B=this.consumeName();return{type:u.AT_KEYWORD_TOKEN,value:B}}break;case 91:return RA;case 92:if(aA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return LA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),gA;break;case 123:return HA;case 125:return dA;case 117:case 85:var l=this.peekCodePoint(0),C=this.peekCodePoint(1);return l!==eA||!nA(C)&&63!==C||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),FA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),hA;break;case tA:return vA}return BA(A)?(this.consumeWhiteSpace(),OA):rA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):sA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:u.DELIM_TOKEN,value:i(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();nA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(i.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),n=parseInt(i.apply(void 0,A.map((function(A){return 63===A?70:A}))),16);return{type:u.UNICODE_RANGE_TOKEN,start:r,end:n}}var B=parseInt(i.apply(void 0,A),16);if(this.peekCodePoint(0)===AA&&nA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var s=[];nA(e)&&s.length<6;)s.push(e),e=this.consumeCodePoint();n=parseInt(i.apply(void 0,s),16);return{type:u.UNICODE_RANGE_TOKEN,start:B,end:n}}return{type:u.UNICODE_RANGE_TOKEN,start:B,end:B}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:u.FUNCTION_TOKEN,value:A}):{type:u.IDENT_TOKEN,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===tA)return{type:u.URL_TOKEN,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return t.type===u.STRING_TOKEN&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===tA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:u.URL_TOKEN,value:t.value}):(this.consumeBadUrlRemnants(),pA)}for(;;){var r=this.consumeCodePoint();if(r===tA||41===r)return{type:u.URL_TOKEN,value:i.apply(void 0,A)};if(BA(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===tA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:u.URL_TOKEN,value:i.apply(void 0,A)}):(this.consumeBadUrlRemnants(),pA);if(34===r||39===r||40===r||iA(r))return this.consumeBadUrlRemnants(),pA;if(92===r){if(!aA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),pA;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},A.prototype.consumeWhiteSpace=function(){for(;BA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===tA)return;aA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(6e4,A);e+=i.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(r===tA||void 0===r||r===A)return e+=this.consumeStringSlice(t),{type:u.STRING_TOKEN,value:e};if(10===r)return this._value.splice(0,t),NA;if(92===r){var n=this._value[t+1];n!==tA&&void 0!==n&&(10===n?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):aA(r,n)&&(e+=this.consumeStringSlice(t),e+=i(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==eA&&t!==AA||A.push(this.consumeCodePoint());rA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&rA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;rA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((r===eA||r===AA)&&rA(n)||rA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;rA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[uA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),B=this.peekCodePoint(2);if(cA(r,n,B)){var s=this.consumeName();return{type:u.DIMENSION_TOKEN,number:e,flags:t,unit:s}}return 37===r?(this.consumeCodePoint(),{type:u.PERCENTAGE_TOKEN,number:e,flags:t}):{type:u.NUMBER_TOKEN,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(nA(A)){for(var e=i(A);nA(this.peekCodePoint(0))&&e.length<6;)e+=i(this.consumeCodePoint());BA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===tA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(oA(e))A+=i(e);else{if(!aA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=i(this.consumeEscapedCodePoint())}}},A}(),bA=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new DA;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===u.WHITESPACE_TOKEN;)A=this.consumeToken();if(A.type===u.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(A.type===u.WHITESPACE_TOKEN);if(A.type===u.EOF_TOKEN)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(e.type===u.EOF_TOKEN)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case u.LEFT_CURLY_BRACKET_TOKEN:case u.LEFT_SQUARE_BRACKET_TOKEN:case u.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(A.type);case u.FUNCTION_TOKEN:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(t.type===u.EOF_TOKEN||XA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:u.FUNCTION};;){var t=this.consumeToken();if(t.type===u.EOF_TOKEN||t.type===u.RIGHT_PARENTHESIS_TOKEN)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?vA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),SA=function(A){return A.type===u.DIMENSION_TOKEN},MA=function(A){return A.type===u.NUMBER_TOKEN},yA=function(A){return A.type===u.IDENT_TOKEN},_A=function(A){return A.type===u.STRING_TOKEN},PA=function(A,e){return yA(A)&&A.value===e},xA=function(A){return A.type!==u.WHITESPACE_TOKEN},VA=function(A){return A.type!==u.WHITESPACE_TOKEN&&A.type!==u.COMMA_TOKEN},zA=function(A){var e=[],t=[];return A.forEach((function(A){if(A.type===u.COMMA_TOKEN){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}A.type!==u.WHITESPACE_TOKEN&&t.push(A)})),t.length&&e.push(t),e},XA=function(A,e){return e===u.LEFT_CURLY_BRACKET_TOKEN&&A.type===u.RIGHT_CURLY_BRACKET_TOKEN||(e===u.LEFT_SQUARE_BRACKET_TOKEN&&A.type===u.RIGHT_SQUARE_BRACKET_TOKEN||e===u.LEFT_PARENTHESIS_TOKEN&&A.type===u.RIGHT_PARENTHESIS_TOKEN)},JA=function(A){return A.type===u.NUMBER_TOKEN||A.type===u.DIMENSION_TOKEN},GA=function(A){return A.type===u.PERCENTAGE_TOKEN||JA(A)},kA=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},WA={type:u.NUMBER_TOKEN,number:0,flags:4},YA={type:u.PERCENTAGE_TOKEN,number:50,flags:4},qA={type:u.PERCENTAGE_TOKEN,number:100,flags:4},ZA=function(A,e,t){var r=A[0],n=A[1];return[jA(r,e),jA(void 0!==n?n:r,t)]},jA=function(A,e){if(A.type===u.PERCENTAGE_TOKEN)return A.number/100*e;if(SA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},$A="grad",Ae="turn",ee=function(A){if(A.type===u.DIMENSION_TOKEN)switch(A.unit){case"deg":return Math.PI*A.number/180;case $A:return Math.PI/200*A.number;case"rad":return A.number;case Ae:return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},te=function(A){return A.type===u.DIMENSION_TOKEN&&("deg"===A.unit||A.unit===$A||"rad"===A.unit||A.unit===Ae)},re=function(A){switch(A.filter(yA).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[WA,WA];case"to top":case"bottom":return ne(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[WA,qA];case"to right":case"left":return ne(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[qA,qA];case"to bottom":case"top":return ne(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[qA,WA];case"to left":case"right":return ne(270)}return 0},ne=function(A){return Math.PI*A/180},Be=function(A){if(A.type===u.FUNCTION){var e=le[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(A.values)}if(A.type===u.HASH_TOKEN){if(3===A.value.length){var t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);return ie(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===A.value.length){t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);var B=A.value.substring(3,4);return ie(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(B+B,16)/255)}if(6===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6);return ie(parseInt(t,16),parseInt(r,16),parseInt(n,16),1)}if(8===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6),B=A.value.substring(6,8);return ie(parseInt(t,16),parseInt(r,16),parseInt(n,16),parseInt(B,16)/255)}}if(A.type===u.IDENT_TOKEN){var s=Ce[A.value.toUpperCase()];if(void 0!==s)return s}return Ce.TRANSPARENT},se=function(A){return!(255&A)},oe=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"},ie=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r))>>>0},ae=function(A,e){if(A.type===u.NUMBER_TOKEN)return A.number;if(A.type===u.PERCENTAGE_TOKEN){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},ce=function(A){var e=A.filter(VA);if(3===e.length){var t=e.map(ae),r=t[0],n=t[1],B=t[2];return ie(r,n,B,1)}if(4===e.length){var s=e.map(ae),o=(r=s[0],n=s[1],B=s[2],s[3]);return ie(r,n,B,o)}return 0};function Qe(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var ue,we,Ue=function(A){var e=A.filter(VA),t=e[0],r=e[1],n=e[2],B=e[3],s=(t.type===u.NUMBER_TOKEN?ne(t.number):ee(t))/(2*Math.PI),o=GA(r)?r.number/100:0,i=GA(n)?n.number/100:0,a=void 0!==B&&GA(B)?jA(B,1):1;if(0===o)return ie(255*i,255*i,255*i,1);var c=i<=.5?i*(o+1):i+o-i*o,Q=2*i-c,w=Qe(Q,c,s+1/3),U=Qe(Q,c,s),l=Qe(Q,c,s-1/3);return ie(255*w,255*U,255*l,a)},le={hsl:Ue,hsla:Ue,rgb:ce,rgba:ce},Ce={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};!function(A){A[A.VALUE=0]="VALUE",A[A.LIST=1]="LIST",A[A.IDENT_VALUE=2]="IDENT_VALUE",A[A.TYPE_VALUE=3]="TYPE_VALUE",A[A.TOKEN_VALUE=4]="TOKEN_VALUE"}(ue||(ue={})),function(A){A[A.BORDER_BOX=0]="BORDER_BOX",A[A.PADDING_BOX=1]="PADDING_BOX",A[A.CONTENT_BOX=2]="CONTENT_BOX"}(we||(we={}));var ge,Ee={name:"background-clip",initialValue:"border-box",prefix:!1,type:ue.LIST,parse:function(A){return A.map((function(A){if(yA(A))switch(A.value){case"padding-box":return we.PADDING_BOX;case"content-box":return we.CONTENT_BOX}return we.BORDER_BOX}))}},Fe={name:"background-color",initialValue:"transparent",prefix:!1,type:ue.TYPE_VALUE,format:"color"},he=function(A){var e=Be(A[0]),t=A[1];return t&&GA(t)?{color:e,stop:t}:{color:e,stop:null}},He=function(A,e){var t=A[0],r=A[A.length-1];null===t.stop&&(t.stop=WA),null===r.stop&&(r.stop=qA);for(var n=[],B=0,s=0;s<A.length;s++){var o=A[s].stop;if(null!==o){var i=jA(o,e);i>B?n.push(i):n.push(B),B=i}else n.push(null)}var a=null;for(s=0;s<n.length;s++){var c=n[s];if(null===c)null===a&&(a=s);else if(null!==a){for(var Q=s-a,u=(c-n[a-1])/(Q+1),w=1;w<=Q;w++)n[a+w-1]=u*w;a=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,n[t]/e),0)}}))},de=function(A,e,t){var r="number"==typeof A?A:function(A,e,t){var r=e/2,n=t/2,B=jA(A[0],e)-r,s=n-jA(A[1],t);return(Math.atan2(s,B)+2*Math.PI)%(2*Math.PI)}(A,e,t),n=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),B=e/2,s=t/2,o=n/2,i=Math.sin(r-Math.PI/2)*o,a=Math.cos(r-Math.PI/2)*o;return[n,B-a,B+a,s-i,s+i]},fe=function(A,e){return Math.sqrt(A*A+e*e)},pe=function(A,e,t,r,n){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var B=e[0],s=e[1],o=fe(t-B,r-s);return(n?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},Ne=function(A){var e=ne(180),t=[];return zA(A).forEach((function(A,r){if(0===r){var n=A[0];if(n.type===u.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(n.value))return void(e=re(A));if(te(n))return void(e=(ee(n)+ne(270))%ne(360))}var B=he(A);t.push(B)})),{angle:e,stops:t,type:ge.LINEAR_GRADIENT}},Ke=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},Ie=function(A,e,t,r,n){var B="http://www.w3.org/2000/svg",s=document.createElementNS(B,"svg"),o=document.createElementNS(B,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},Te=function(A){return new Promise((function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},me={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(me,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(me,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var n=new Image,B=e.toDataURL();n.src=B;var s=Ie(t,t,0,0,n);return r.fillStyle="red",r.fillRect(0,0,t,t),Te(s).then((function(e){r.drawImage(e,0,0);var n=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var s=A.createElement("div");return s.style.backgroundImage="url("+B+")",s.style.height=t+"px",Ke(n)?Te(Ie(t,t,0,0,s)):Promise.reject(!1)})).then((function(A){return r.drawImage(A,0,0),Ke(r.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(me,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(me,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(me,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(me,"SUPPORT_CORS_XHR",{value:A}),A}},Re=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.create=function(e){A.instances[e.id]=new A(e)},A.destroy=function(e){delete A.instances[e]},A.getInstance=function(e){var t=A.instances[e];if(void 0===t)throw new Error("No logger instance found with id "+e);return t},A.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,[this.id,this.getTime()+"ms"].concat(A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},A.instances={},A}(),Le=function(){function A(){}return A.create=function(e,t){return A._caches[e]=new Oe(e,t)},A.destroy=function(e){delete A._caches[e]},A.open=function(e){var t=A._caches[e];if(void 0!==t)return t;throw new Error('Cache with key "'+e+'" not found')},A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A.getInstance=function(){var e=A._current;if(null===e)throw new Error("No cache instance attached");return e},A.attachInstance=function(e){A._current=e},A.detachInstance=function(){A._current=null},A._caches={},A._origin="about:blank",A._current=null,A}(),Oe=function(){function A(A,e){this.id=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:_e(A)||Se(A)?(this._cache[A]=this.loadImage(A),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return r(this,void 0,void 0,(function(){var e,t,r,B,s=this;return n(this,(function(n){switch(n.label){case 0:return e=Le.isSameOrigin(A),t=!Me(A)&&!0===this._options.useCORS&&me.SUPPORT_CORS_IMAGES&&!e,r=!Me(A)&&!e&&"string"==typeof this._options.proxy&&me.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Me(A)||r||t?(B=A,r?[4,this.proxy(B)]:[3,2]):[2];case 1:B=n.sent(),n.label=2;case 2:return Re.getInstance(this.id).debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var r=new Image;r.onload=function(){return A(r)},r.onerror=e,(ye(B)||t)&&(r.crossOrigin="anonymous"),r.src=B,!0===r.complete&&setTimeout((function(){return A(r)}),500),s._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+s._options.imageTimeout+"ms) loading image")}),s._options.imageTimeout)}))];case 3:return[2,n.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise((function(n,B){var s=me.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;if(o.onload=function(){if(200===o.status)if("text"===s)n(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return n(A.result)}),!1),A.addEventListener("error",(function(A){return B(A)}),!1),A.readAsDataURL(o.response)}else B("Failed to proxy resource "+r+" with status code "+o.status)},o.onerror=B,o.open("GET",t+"?url="+encodeURIComponent(A)+"&responseType="+s),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var i=e._options.imageTimeout;o.timeout=i,o.ontimeout=function(){return B("Timed out ("+i+"ms) proxying "+r)}}o.send()}))},A}(),ve=/^data:image\/svg\+xml/i,De=/^data:image\/.*;base64,/i,be=/^data:image\/.*/i,Se=function(A){return me.SUPPORT_SVG_DRAWING||!Pe(A)},Me=function(A){return be.test(A)},ye=function(A){return De.test(A)},_e=function(A){return"blob"===A.substr(0,4)},Pe=function(A){return"svg"===A.substr(-3).toLowerCase()||ve.test(A)},xe="closest-side",Ve="farthest-side",ze="closest-corner",Xe="farthest-corner",Je="circle",Ge="ellipse",ke="cover",We="contain",Ye=function(A){var e=qe.CIRCLE,t=Ze.FARTHEST_CORNER,r=[],n=[];return zA(A).forEach((function(A,B){var s=!0;if(0===B?s=A.reduce((function(A,e){if(yA(e))switch(e.value){case"center":return n.push(YA),!1;case"top":case"left":return n.push(WA),!1;case"right":case"bottom":return n.push(qA),!1}else if(GA(e)||JA(e))return n.push(e),!1;return A}),s):1===B&&(s=A.reduce((function(A,r){if(yA(r))switch(r.value){case Je:return e=qe.CIRCLE,!1;case Ge:return e=qe.ELLIPSE,!1;case We:case xe:return t=Ze.CLOSEST_SIDE,!1;case Ve:return t=Ze.FARTHEST_SIDE,!1;case ze:return t=Ze.CLOSEST_CORNER,!1;case ke:case Xe:return t=Ze.FARTHEST_CORNER,!1}else if(JA(r)||GA(r))return Array.isArray(t)||(t=[]),t.push(r),!1;return A}),s)),s){var o=he(A);r.push(o)}})),{size:t,shape:e,stops:r,position:n,type:ge.RADIAL_GRADIENT}};!function(A){A[A.URL=0]="URL",A[A.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",A[A.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"}(ge||(ge={}));var qe,Ze;!function(A){A[A.CIRCLE=0]="CIRCLE",A[A.ELLIPSE=1]="ELLIPSE"}(qe||(qe={})),function(A){A[A.CLOSEST_SIDE=0]="CLOSEST_SIDE",A[A.FARTHEST_SIDE=1]="FARTHEST_SIDE",A[A.CLOSEST_CORNER=2]="CLOSEST_CORNER",A[A.FARTHEST_CORNER=3]="FARTHEST_CORNER"}(Ze||(Ze={}));var je=function(A){if(A.type===u.URL_TOKEN){var e={url:A.value,type:ge.URL};return Le.getInstance().addImage(A.value),e}if(A.type===u.FUNCTION){var t=At[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return t(A.values)}throw new Error("Unsupported image type")};var $e,At={"linear-gradient":function(A){var e=ne(180),t=[];return zA(A).forEach((function(A,r){if(0===r){var n=A[0];if(n.type===u.IDENT_TOKEN&&"to"===n.value)return void(e=re(A));if(te(n))return void(e=ee(n))}var B=he(A);t.push(B)})),{angle:e,stops:t,type:ge.LINEAR_GRADIENT}},"-moz-linear-gradient":Ne,"-ms-linear-gradient":Ne,"-o-linear-gradient":Ne,"-webkit-linear-gradient":Ne,"radial-gradient":function(A){var e=qe.CIRCLE,t=Ze.FARTHEST_CORNER,r=[],n=[];return zA(A).forEach((function(A,B){var s=!0;if(0===B){var o=!1;s=A.reduce((function(A,r){if(o)if(yA(r))switch(r.value){case"center":return n.push(YA),A;case"top":case"left":return n.push(WA),A;case"right":case"bottom":return n.push(qA),A}else(GA(r)||JA(r))&&n.push(r);else if(yA(r))switch(r.value){case Je:return e=qe.CIRCLE,!1;case Ge:return e=qe.ELLIPSE,!1;case"at":return o=!0,!1;case xe:return t=Ze.CLOSEST_SIDE,!1;case ke:case Ve:return t=Ze.FARTHEST_SIDE,!1;case We:case ze:return t=Ze.CLOSEST_CORNER,!1;case Xe:return t=Ze.FARTHEST_CORNER,!1}else if(JA(r)||GA(r))return Array.isArray(t)||(t=[]),t.push(r),!1;return A}),s)}if(s){var i=he(A);r.push(i)}})),{size:t,shape:e,stops:r,position:n,type:ge.RADIAL_GRADIENT}},"-moz-radial-gradient":Ye,"-ms-radial-gradient":Ye,"-o-radial-gradient":Ye,"-webkit-radial-gradient":Ye,"-webkit-gradient":function(A){var e=ne(180),t=[],r=ge.LINEAR_GRADIENT,n=qe.CIRCLE,B=Ze.FARTHEST_CORNER;return zA(A).forEach((function(A,e){var n=A[0];if(0===e){if(yA(n)&&"linear"===n.value)return void(r=ge.LINEAR_GRADIENT);if(yA(n)&&"radial"===n.value)return void(r=ge.RADIAL_GRADIENT)}if(n.type===u.FUNCTION)if("from"===n.name){var B=Be(n.values[0]);t.push({stop:WA,color:B})}else if("to"===n.name){B=Be(n.values[0]);t.push({stop:qA,color:B})}else if("color-stop"===n.name){var s=n.values.filter(VA);if(2===s.length){B=Be(s[1]);var o=s[0];MA(o)&&t.push({stop:{type:u.PERCENTAGE_TOKEN,number:100*o.number,flags:o.flags},color:B})}}})),r===ge.LINEAR_GRADIENT?{angle:(e+ne(180))%ne(360),stops:t,type:r}:{size:B,shape:n,stops:t,position:[],type:r}}},et={name:"background-image",initialValue:"none",type:ue.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===u.IDENT_TOKEN&&"none"===e.value?[]:A.filter((function(A){return VA(A)&&function(A){return A.type!==u.FUNCTION||At[A.name]}(A)})).map(je)}},tt={name:"background-origin",initialValue:"border-box",prefix:!1,type:ue.LIST,parse:function(A){return A.map((function(A){if(yA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},rt={name:"background-position",initialValue:"0% 0%",type:ue.LIST,prefix:!1,parse:function(A){return zA(A).map((function(A){return A.filter(GA)})).map(kA)}};!function(A){A[A.REPEAT=0]="REPEAT",A[A.NO_REPEAT=1]="NO_REPEAT",A[A.REPEAT_X=2]="REPEAT_X",A[A.REPEAT_Y=3]="REPEAT_Y"}($e||($e={}));var nt,Bt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:ue.LIST,parse:function(A){return zA(A).map((function(A){return A.filter(yA).map((function(A){return A.value})).join(" ")})).map(st)}},st=function(A){switch(A){case"no-repeat":return $e.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return $e.REPEAT_X;case"repeat-y":case"no-repeat repeat":return $e.REPEAT_Y;default:return $e.REPEAT}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(nt||(nt={}));var ot,it={name:"background-size",initialValue:"0",prefix:!1,type:ue.LIST,parse:function(A){return zA(A).map((function(A){return A.filter(at)}))}},at=function(A){return yA(A)||GA(A)},ct=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:ue.TYPE_VALUE,format:"color"}},Qt=ct("top"),ut=ct("right"),wt=ct("bottom"),Ut=ct("left"),lt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:ue.LIST,parse:function(A){return kA(A.filter(GA))}}},Ct=lt("top-left"),gt=lt("top-right"),Et=lt("bottom-right"),Ft=lt("bottom-left");!function(A){A[A.NONE=0]="NONE",A[A.SOLID=1]="SOLID"}(ot||(ot={}));var ht,Ht=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){return"none"===A?ot.NONE:ot.SOLID}}},dt=Ht("top"),ft=Ht("right"),pt=Ht("bottom"),Nt=Ht("left"),Kt=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:ue.VALUE,prefix:!1,parse:function(A){return SA(A)?A.number:0}}},It=Kt("top"),Tt=Kt("right"),mt=Kt("bottom"),Rt=Kt("left"),Lt={name:"color",initialValue:"transparent",prefix:!1,type:ue.TYPE_VALUE,format:"color"},Ot={name:"display",initialValue:"inline-block",prefix:!1,type:ue.LIST,parse:function(A){return A.filter(yA).reduce((function(A,e){return A|vt(e.value)}),0)}},vt=function(A){switch(A){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};!function(A){A[A.NONE=0]="NONE",A[A.LEFT=1]="LEFT",A[A.RIGHT=2]="RIGHT",A[A.INLINE_START=3]="INLINE_START",A[A.INLINE_END=4]="INLINE_END"}(ht||(ht={}));var Dt,bt={name:"float",initialValue:"none",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"left":return ht.LEFT;case"right":return ht.RIGHT;case"inline-start":return ht.INLINE_START;case"inline-end":return ht.INLINE_END}return ht.NONE}},St={name:"letter-spacing",initialValue:"0",prefix:!1,type:ue.VALUE,parse:function(A){return A.type===u.IDENT_TOKEN&&"normal"===A.value?0:A.type===u.NUMBER_TOKEN||A.type===u.DIMENSION_TOKEN?A.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Dt||(Dt={}));var Mt,yt={name:"line-break",initialValue:"normal",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){return"strict"===A?Dt.STRICT:Dt.NORMAL}},_t={name:"line-height",initialValue:"normal",prefix:!1,type:ue.TOKEN_VALUE},Pt={name:"list-style-image",initialValue:"none",type:ue.VALUE,prefix:!1,parse:function(A){return A.type===u.IDENT_TOKEN&&"none"===A.value?null:je(A)}};!function(A){A[A.INSIDE=0]="INSIDE",A[A.OUTSIDE=1]="OUTSIDE"}(Mt||(Mt={}));var xt,Vt={name:"list-style-position",initialValue:"outside",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){return"inside"===A?Mt.INSIDE:Mt.OUTSIDE}};!function(A){A[A.NONE=-1]="NONE",A[A.DISC=0]="DISC",A[A.CIRCLE=1]="CIRCLE",A[A.SQUARE=2]="SQUARE",A[A.DECIMAL=3]="DECIMAL",A[A.CJK_DECIMAL=4]="CJK_DECIMAL",A[A.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",A[A.LOWER_ROMAN=6]="LOWER_ROMAN",A[A.UPPER_ROMAN=7]="UPPER_ROMAN",A[A.LOWER_GREEK=8]="LOWER_GREEK",A[A.LOWER_ALPHA=9]="LOWER_ALPHA",A[A.UPPER_ALPHA=10]="UPPER_ALPHA",A[A.ARABIC_INDIC=11]="ARABIC_INDIC",A[A.ARMENIAN=12]="ARMENIAN",A[A.BENGALI=13]="BENGALI",A[A.CAMBODIAN=14]="CAMBODIAN",A[A.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",A[A.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",A[A.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",A[A.DEVANAGARI=18]="DEVANAGARI",A[A.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",A[A.GEORGIAN=20]="GEORGIAN",A[A.GUJARATI=21]="GUJARATI",A[A.GURMUKHI=22]="GURMUKHI",A[A.HEBREW=22]="HEBREW",A[A.HIRAGANA=23]="HIRAGANA",A[A.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",A[A.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",A[A.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",A[A.KANNADA=27]="KANNADA",A[A.KATAKANA=28]="KATAKANA",A[A.KATAKANA_IROHA=29]="KATAKANA_IROHA",A[A.KHMER=30]="KHMER",A[A.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",A[A.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",A[A.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",A[A.LAO=34]="LAO",A[A.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",A[A.MALAYALAM=36]="MALAYALAM",A[A.MONGOLIAN=37]="MONGOLIAN",A[A.MYANMAR=38]="MYANMAR",A[A.ORIYA=39]="ORIYA",A[A.PERSIAN=40]="PERSIAN",A[A.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",A[A.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",A[A.TAMIL=43]="TAMIL",A[A.TELUGU=44]="TELUGU",A[A.THAI=45]="THAI",A[A.TIBETAN=46]="TIBETAN",A[A.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",A[A.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",A[A.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",A[A.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",A[A.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"}(xt||(xt={}));var zt,Xt={name:"list-style-type",initialValue:"none",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"disc":return xt.DISC;case"circle":return xt.CIRCLE;case"square":return xt.SQUARE;case"decimal":return xt.DECIMAL;case"cjk-decimal":return xt.CJK_DECIMAL;case"decimal-leading-zero":return xt.DECIMAL_LEADING_ZERO;case"lower-roman":return xt.LOWER_ROMAN;case"upper-roman":return xt.UPPER_ROMAN;case"lower-greek":return xt.LOWER_GREEK;case"lower-alpha":return xt.LOWER_ALPHA;case"upper-alpha":return xt.UPPER_ALPHA;case"arabic-indic":return xt.ARABIC_INDIC;case"armenian":return xt.ARMENIAN;case"bengali":return xt.BENGALI;case"cambodian":return xt.CAMBODIAN;case"cjk-earthly-branch":return xt.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return xt.CJK_HEAVENLY_STEM;case"cjk-ideographic":return xt.CJK_IDEOGRAPHIC;case"devanagari":return xt.DEVANAGARI;case"ethiopic-numeric":return xt.ETHIOPIC_NUMERIC;case"georgian":return xt.GEORGIAN;case"gujarati":return xt.GUJARATI;case"gurmukhi":return xt.GURMUKHI;case"hebrew":return xt.HEBREW;case"hiragana":return xt.HIRAGANA;case"hiragana-iroha":return xt.HIRAGANA_IROHA;case"japanese-formal":return xt.JAPANESE_FORMAL;case"japanese-informal":return xt.JAPANESE_INFORMAL;case"kannada":return xt.KANNADA;case"katakana":return xt.KATAKANA;case"katakana-iroha":return xt.KATAKANA_IROHA;case"khmer":return xt.KHMER;case"korean-hangul-formal":return xt.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return xt.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return xt.KOREAN_HANJA_INFORMAL;case"lao":return xt.LAO;case"lower-armenian":return xt.LOWER_ARMENIAN;case"malayalam":return xt.MALAYALAM;case"mongolian":return xt.MONGOLIAN;case"myanmar":return xt.MYANMAR;case"oriya":return xt.ORIYA;case"persian":return xt.PERSIAN;case"simp-chinese-formal":return xt.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return xt.SIMP_CHINESE_INFORMAL;case"tamil":return xt.TAMIL;case"telugu":return xt.TELUGU;case"thai":return xt.THAI;case"tibetan":return xt.TIBETAN;case"trad-chinese-formal":return xt.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return xt.TRAD_CHINESE_INFORMAL;case"upper-armenian":return xt.UPPER_ARMENIAN;case"disclosure-open":return xt.DISCLOSURE_OPEN;case"disclosure-closed":return xt.DISCLOSURE_CLOSED;default:return xt.NONE}}},Jt=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:ue.TOKEN_VALUE}},Gt=Jt("top"),kt=Jt("right"),Wt=Jt("bottom"),Yt=Jt("left");!function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.SCROLL=2]="SCROLL",A[A.AUTO=3]="AUTO"}(zt||(zt={}));var qt,Zt={name:"overflow",initialValue:"visible",prefix:!1,type:ue.LIST,parse:function(A){return A.filter(yA).map((function(A){switch(A.value){case"hidden":return zt.HIDDEN;case"scroll":return zt.SCROLL;case"auto":return zt.AUTO;default:return zt.VISIBLE}}))}};!function(A){A.NORMAL="normal",A.BREAK_WORD="break-word"}(qt||(qt={}));var jt,$t={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){return"break-word"===A?qt.BREAK_WORD:qt.NORMAL}},Ar=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:ue.TYPE_VALUE,format:"length-percentage"}},er=Ar("top"),tr=Ar("right"),rr=Ar("bottom"),nr=Ar("left");!function(A){A[A.LEFT=0]="LEFT",A[A.CENTER=1]="CENTER",A[A.RIGHT=2]="RIGHT"}(jt||(jt={}));var Br,sr={name:"text-align",initialValue:"left",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"right":return jt.RIGHT;case"center":case"justify":return jt.CENTER;default:return jt.LEFT}}};!function(A){A[A.STATIC=0]="STATIC",A[A.RELATIVE=1]="RELATIVE",A[A.ABSOLUTE=2]="ABSOLUTE",A[A.FIXED=3]="FIXED",A[A.STICKY=4]="STICKY"}(Br||(Br={}));var or,ir={name:"position",initialValue:"static",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"relative":return Br.RELATIVE;case"absolute":return Br.ABSOLUTE;case"fixed":return Br.FIXED;case"sticky":return Br.STICKY}return Br.STATIC}},ar={name:"text-shadow",initialValue:"none",type:ue.LIST,prefix:!1,parse:function(A){return 1===A.length&&PA(A[0],"none")?[]:zA(A).map((function(A){for(var e={color:Ce.TRANSPARENT,offsetX:WA,offsetY:WA,blur:WA},t=0,r=0;r<A.length;r++){var n=A[r];JA(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:e.blur=n,t++):e.color=Be(n)}return e}))}};!function(A){A[A.NONE=0]="NONE",A[A.LOWERCASE=1]="LOWERCASE",A[A.UPPERCASE=2]="UPPERCASE",A[A.CAPITALIZE=3]="CAPITALIZE"}(or||(or={}));var cr,Qr={name:"text-transform",initialValue:"none",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"uppercase":return or.UPPERCASE;case"lowercase":return or.LOWERCASE;case"capitalize":return or.CAPITALIZE}return or.NONE}},ur={name:"transform",initialValue:"none",prefix:!0,type:ue.VALUE,parse:function(A){if(A.type===u.IDENT_TOKEN&&"none"===A.value)return null;if(A.type===u.FUNCTION){var e=wr[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return e(A.values)}return null}},wr={matrix:function(A){var e=A.filter((function(A){return A.type===u.NUMBER_TOKEN})).map((function(A){return A.number}));return 6===e.length?e:null},matrix3d:function(A){var e=A.filter((function(A){return A.type===u.NUMBER_TOKEN})).map((function(A){return A.number})),t=e[0],r=e[1],n=(e[2],e[3],e[4]),B=e[5],s=(e[6],e[7],e[8],e[9],e[10],e[11],e[12]),o=e[13];e[14],e[15];return 16===e.length?[t,r,n,B,s,o]:null}},Ur={type:u.PERCENTAGE_TOKEN,number:50,flags:4},lr=[Ur,Ur],Cr={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:ue.LIST,parse:function(A){var e=A.filter(GA);return 2!==e.length?lr:[e[0],e[1]]}};!function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.COLLAPSE=2]="COLLAPSE"}(cr||(cr={}));var gr,Er={name:"visible",initialValue:"none",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"hidden":return cr.HIDDEN;case"collapse":return cr.COLLAPSE;default:return cr.VISIBLE}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(gr||(gr={}));var Fr,hr={name:"word-break",initialValue:"normal",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"break-all":return gr.BREAK_ALL;case"keep-all":return gr.KEEP_ALL;default:return gr.NORMAL}}},Hr={name:"z-index",initialValue:"auto",prefix:!1,type:ue.VALUE,parse:function(A){if(A.type===u.IDENT_TOKEN)return{auto:!0,order:0};if(MA(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},dr={name:"opacity",initialValue:"1",type:ue.VALUE,prefix:!1,parse:function(A){return MA(A)?A.number:1}},fr={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:ue.TYPE_VALUE,format:"color"},pr={name:"text-decoration-line",initialValue:"none",prefix:!1,type:ue.LIST,parse:function(A){return A.filter(yA).map((function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(A){return 0!==A}))}},Nr={name:"font-family",initialValue:"",prefix:!1,type:ue.LIST,parse:function(A){var e=[],t=[];return A.forEach((function(A){switch(A.type){case u.IDENT_TOKEN:case u.STRING_TOKEN:e.push(A.value);break;case u.NUMBER_TOKEN:e.push(A.number.toString());break;case u.COMMA_TOKEN:t.push(e.join(" ")),e.length=0}})),e.length&&t.push(e.join(" ")),t.map((function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"}))}},Kr={name:"font-size",initialValue:"0",prefix:!1,type:ue.TYPE_VALUE,format:"length"},Ir={name:"font-weight",initialValue:"normal",type:ue.VALUE,prefix:!1,parse:function(A){return MA(A)?A.number:yA(A)&&"bold"===A.value?700:400}},Tr={name:"font-variant",initialValue:"none",type:ue.LIST,prefix:!1,parse:function(A){return A.filter(yA).map((function(A){return A.value}))}};!function(A){A.NORMAL="normal",A.ITALIC="italic",A.OBLIQUE="oblique"}(Fr||(Fr={}));var mr,Rr={name:"font-style",initialValue:"normal",prefix:!1,type:ue.IDENT_VALUE,parse:function(A){switch(A){case"oblique":return Fr.OBLIQUE;case"italic":return Fr.ITALIC;default:return Fr.NORMAL}}},Lr=function(A,e){return!!(A&e)},Or={name:"content",initialValue:"none",type:ue.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===u.IDENT_TOKEN&&"none"===e.value?[]:A}},vr={name:"counter-increment",initialValue:"none",prefix:!0,type:ue.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===u.IDENT_TOKEN&&"none"===e.value)return null;for(var t=[],r=A.filter(xA),n=0;n<r.length;n++){var B=r[n],s=r[n+1];if(B.type===u.IDENT_TOKEN){var o=s&&MA(s)?s.number:1;t.push({counter:B.value,increment:o})}}return t}},Dr={name:"counter-reset",initialValue:"none",prefix:!0,type:ue.LIST,parse:function(A){if(0===A.length)return[];for(var e=[],t=A.filter(xA),r=0;r<t.length;r++){var n=t[r],B=t[r+1];if(yA(n)&&"none"!==n.value){var s=B&&MA(B)?B.number:0;e.push({counter:n.value,reset:s})}}return e}},br={name:"quotes",initialValue:"none",prefix:!0,type:ue.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===u.IDENT_TOKEN&&"none"===e.value)return null;var t=[],r=A.filter(_A);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var B=r[n].value,s=r[n+1].value;t.push({open:B,close:s})}return t}},Sr=function(A,e,t){if(!A)return"";var r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""},Mr={name:"box-shadow",initialValue:"none",type:ue.LIST,prefix:!1,parse:function(A){return 1===A.length&&PA(A[0],"none")?[]:zA(A).map((function(A){for(var e={color:255,offsetX:WA,offsetY:WA,blur:WA,spread:WA,inset:!1},t=0,r=0;r<A.length;r++){var n=A[r];PA(n,"inset")?e.inset=!0:JA(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:2===t?e.blur=n:e.spread=n,t++):e.color=Be(n)}return e}))}},yr=function(){function A(A){this.backgroundClip=xr(Ee,A.backgroundClip),this.backgroundColor=xr(Fe,A.backgroundColor),this.backgroundImage=xr(et,A.backgroundImage),this.backgroundOrigin=xr(tt,A.backgroundOrigin),this.backgroundPosition=xr(rt,A.backgroundPosition),this.backgroundRepeat=xr(Bt,A.backgroundRepeat),this.backgroundSize=xr(it,A.backgroundSize),this.borderTopColor=xr(Qt,A.borderTopColor),this.borderRightColor=xr(ut,A.borderRightColor),this.borderBottomColor=xr(wt,A.borderBottomColor),this.borderLeftColor=xr(Ut,A.borderLeftColor),this.borderTopLeftRadius=xr(Ct,A.borderTopLeftRadius),this.borderTopRightRadius=xr(gt,A.borderTopRightRadius),this.borderBottomRightRadius=xr(Et,A.borderBottomRightRadius),this.borderBottomLeftRadius=xr(Ft,A.borderBottomLeftRadius),this.borderTopStyle=xr(dt,A.borderTopStyle),this.borderRightStyle=xr(ft,A.borderRightStyle),this.borderBottomStyle=xr(pt,A.borderBottomStyle),this.borderLeftStyle=xr(Nt,A.borderLeftStyle),this.borderTopWidth=xr(It,A.borderTopWidth),this.borderRightWidth=xr(Tt,A.borderRightWidth),this.borderBottomWidth=xr(mt,A.borderBottomWidth),this.borderLeftWidth=xr(Rt,A.borderLeftWidth),this.boxShadow=xr(Mr,A.boxShadow),this.color=xr(Lt,A.color),this.display=xr(Ot,A.display),this.float=xr(bt,A.cssFloat),this.fontFamily=xr(Nr,A.fontFamily),this.fontSize=xr(Kr,A.fontSize),this.fontStyle=xr(Rr,A.fontStyle),this.fontVariant=xr(Tr,A.fontVariant),this.fontWeight=xr(Ir,A.fontWeight),this.letterSpacing=xr(St,A.letterSpacing),this.lineBreak=xr(yt,A.lineBreak),this.lineHeight=xr(_t,A.lineHeight),this.listStyleImage=xr(Pt,A.listStyleImage),this.listStylePosition=xr(Vt,A.listStylePosition),this.listStyleType=xr(Xt,A.listStyleType),this.marginTop=xr(Gt,A.marginTop),this.marginRight=xr(kt,A.marginRight),this.marginBottom=xr(Wt,A.marginBottom),this.marginLeft=xr(Yt,A.marginLeft),this.opacity=xr(dr,A.opacity);var e=xr(Zt,A.overflow);this.overflowX=e[0],this.overflowY=e[e.length>1?1:0],this.overflowWrap=xr($t,A.overflowWrap),this.paddingTop=xr(er,A.paddingTop),this.paddingRight=xr(tr,A.paddingRight),this.paddingBottom=xr(rr,A.paddingBottom),this.paddingLeft=xr(nr,A.paddingLeft),this.position=xr(ir,A.position),this.textAlign=xr(sr,A.textAlign),this.textDecorationColor=xr(fr,A.textDecorationColor||A.color),this.textDecorationLine=xr(pr,A.textDecorationLine),this.textShadow=xr(ar,A.textShadow),this.textTransform=xr(Qr,A.textTransform),this.transform=xr(ur,A.transform),this.transformOrigin=xr(Cr,A.transformOrigin),this.visibility=xr(Er,A.visibility),this.wordBreak=xr(hr,A.wordBreak),this.zIndex=xr(Hr,A.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===cr.VISIBLE},A.prototype.isTransparent=function(){return se(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return this.position!==Br.STATIC},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return this.float!==ht.NONE},A.prototype.isInlineLevel=function(){return Lr(this.display,4)||Lr(this.display,33554432)||Lr(this.display,268435456)||Lr(this.display,536870912)||Lr(this.display,67108864)||Lr(this.display,134217728)},A}(),_r=function(A){this.content=xr(Or,A.content),this.quotes=xr(br,A.quotes)},Pr=function(A){this.counterIncrement=xr(vr,A.counterIncrement),this.counterReset=xr(Dr,A.counterReset)},xr=function(A,e){var t=new DA,r=null!=e?e.toString():A.initialValue;t.write(r);var n=new bA(t.read());switch(A.type){case ue.IDENT_VALUE:var B=n.parseComponentValue();return A.parse(yA(B)?B.value:A.initialValue);case ue.VALUE:return A.parse(n.parseComponentValue());case ue.LIST:return A.parse(n.parseComponentValues());case ue.TOKEN_VALUE:return n.parseComponentValue();case ue.TYPE_VALUE:switch(A.format){case"angle":return ee(n.parseComponentValue());case"color":return Be(n.parseComponentValue());case"image":return je(n.parseComponentValue());case"length":var s=n.parseComponentValue();return JA(s)?s:WA;case"length-percentage":var o=n.parseComponentValue();return GA(o)?o:WA}}throw new Error("Attempting to parse unsupported css format type "+A.format)},Vr=function(A){this.styles=new yr(window.getComputedStyle(A,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&fn(A)&&(A.style.transform="none"),this.bounds=s(A),this.flags=0},zr=function(A,e){this.text=A,this.bounds=e},Xr=function(A){var e=A.ownerDocument;if(e){var t=e.createElement("html2canvaswrapper");t.appendChild(A.cloneNode(!0));var r=A.parentNode;if(r){r.replaceChild(t,A);var n=s(t);return t.firstChild&&r.replaceChild(t.firstChild,t),n}}return new B(0,0,0,0)},Jr=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),B.fromClientRect(n.getBoundingClientRect())},Gr=function(A,e){return 0!==e.letterSpacing?o(A).map((function(A){return i(A)})):kr(A,e)},kr=function(A,e){for(var t,r=function(A,e){var t=o(A),r=j(t,e),n=r[0],B=r[1],s=r[2],i=t.length,a=0,c=0;return{next:function(){if(c>=i)return{done:!0,value:null};for(var A=_;c<i&&(A=Z(t,B,n,++c,s))===_;);if(A!==_||c===i){var e=new $(t,A,a,c);return a=c,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap===qt.BREAK_WORD?"break-word":e.wordBreak}),n=[];!(t=r.next()).done;)t.value&&n.push(t.value.slice());return n},Wr=function(A,e){this.text=Yr(A.data,e.textTransform),this.textBounds=function(A,e,t){var r=Gr(A,e),n=[],B=0;return r.forEach((function(A){if(e.textDecorationLine.length||A.trim().length>0)if(me.SUPPORT_RANGE_BOUNDS)n.push(new zr(A,Jr(t,B,A.length)));else{var r=t.splitText(A.length);n.push(new zr(A,Xr(t))),t=r}else me.SUPPORT_RANGE_BOUNDS||(t=t.splitText(A.length));B+=A.length})),n}(this.text,e,A)},Yr=function(A,e){switch(e){case or.LOWERCASE:return A.toLowerCase();case or.CAPITALIZE:return A.replace(qr,Zr);case or.UPPERCASE:return A.toUpperCase();default:return A}},qr=/(^|\s|:|-|\(|\))([a-z])/g,Zr=function(A,e,t){return A.length>0?e+t.toUpperCase():A},jr=function(A){function t(e){var t=A.call(this,e)||this;return t.src=e.currentSrc||e.src,t.intrinsicWidth=e.naturalWidth,t.intrinsicHeight=e.naturalHeight,Le.getInstance().addImage(t.src),t}return e(t,A),t}(Vr),$r=function(A){function t(e){var t=A.call(this,e)||this;return t.canvas=e,t.intrinsicWidth=e.width,t.intrinsicHeight=e.height,t}return e(t,A),t}(Vr),An=function(A){function t(e){var t=A.call(this,e)||this,r=new XMLSerializer;return t.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,Le.getInstance().addImage(t.svg),t}return e(t,A),t}(Vr),en=function(A){function t(e){var t=A.call(this,e)||this;return t.value=e.value,t}return e(t,A),t}(Vr),tn=function(A){function t(e){var t=A.call(this,e)||this;return t.start=e.start,t.reversed="boolean"==typeof e.reversed&&!0===e.reversed,t}return e(t,A),t}(Vr),rn=[{type:u.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],nn=[{type:u.PERCENTAGE_TOKEN,flags:0,number:50}],Bn="checkbox",sn="radio",on="password",an=707406591,cn=function(A){function t(e){var t,r,n,s=A.call(this,e)||this;switch(s.type=e.type.toLowerCase(),s.checked=e.checked,s.value=0===(r=(t=e).type===on?new Array(t.value.length+1).join("•"):t.value).length?t.placeholder||"":r,s.type!==Bn&&s.type!==sn||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=ot.SOLID,s.styles.backgroundClip=[we.BORDER_BOX],s.styles.backgroundOrigin=[0],s.bounds=(n=s.bounds).width>n.height?new B(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new B(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),s.type){case Bn:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=rn;break;case sn:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=nn}return s}return e(t,A),t}(Vr),Qn=function(A){function t(e){var t=A.call(this,e)||this,r=e.options[e.selectedIndex||0];return t.value=r&&r.text||"",t}return e(t,A),t}(Vr),un=function(A){function t(e){var t=A.call(this,e)||this;return t.value=e.value,t}return e(t,A),t}(Vr),wn=function(A){return Be(bA.create(A).parseComponentValue())},Un=function(A){function t(e){var t=A.call(this,e)||this;t.src=e.src,t.width=parseInt(e.width,10)||0,t.height=parseInt(e.height,10)||0,t.backgroundColor=t.styles.backgroundColor;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement){t.tree=En(e.contentWindow.document.documentElement);var r=e.contentWindow.document.documentElement?wn(getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Ce.TRANSPARENT,n=e.contentWindow.document.body?wn(getComputedStyle(e.contentWindow.document.body).backgroundColor):Ce.TRANSPARENT;t.backgroundColor=se(r)?se(n)?t.styles.backgroundColor:n:r}}catch(A){}return t}return e(t,A),t}(Vr),ln=["OL","UL","MENU"],Cn=function(A,e,t){for(var r=A.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,Hn(r)&&r.data.trim().length>0)e.textNodes.push(new Wr(r,e.styles));else if(dn(r)){var B=gn(r);B.styles.isVisible()&&(Fn(r,B,t)?B.flags|=4:hn(B.styles)&&(B.flags|=2),-1!==ln.indexOf(r.tagName)&&(B.flags|=8),e.elements.push(B),bn(r)||Tn(r)||Sn(r)||Cn(r,B,t))}},gn=function(A){return Ln(A)?new jr(A):Rn(A)?new $r(A):Tn(A)?new An(A):Nn(A)?new en(A):Kn(A)?new tn(A):In(A)?new cn(A):Sn(A)?new Qn(A):bn(A)?new un(A):On(A)?new Un(A):new Vr(A)},En=function(A){var e=gn(A);return e.flags|=4,Cn(A,e,e),e},Fn=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||mn(A)&&t.styles.isTransparent()},hn=function(A){return A.isPositioned()||A.isFloating()},Hn=function(A){return A.nodeType===Node.TEXT_NODE},dn=function(A){return A.nodeType===Node.ELEMENT_NODE},fn=function(A){return dn(A)&&void 0!==A.style&&!pn(A)},pn=function(A){return"object"==typeof A.className},Nn=function(A){return"LI"===A.tagName},Kn=function(A){return"OL"===A.tagName},In=function(A){return"INPUT"===A.tagName},Tn=function(A){return"svg"===A.tagName},mn=function(A){return"BODY"===A.tagName},Rn=function(A){return"CANVAS"===A.tagName},Ln=function(A){return"IMG"===A.tagName},On=function(A){return"IFRAME"===A.tagName},vn=function(A){return"STYLE"===A.tagName},Dn=function(A){return"SCRIPT"===A.tagName},bn=function(A){return"TEXTAREA"===A.tagName},Sn=function(A){return"SELECT"===A.tagName},Mn=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,n=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(n=!1,t[Math.max(0,t.length-1)]+=A.increment)}));var B=[];return n&&r.forEach((function(A){var t=e.counters[A.counter];B.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),B},A}(),yn={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},_n={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Pn={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},xn={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Vn=function(A,e,t,r,n,B){return A<e||A>t?Zn(A,n,B.length>0):r.integers.reduce((function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e}),"")+B},zn=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},Xn=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(zn(Math.abs(A),B,r,(function(A){return i(Math.floor(A%B)+e)}))+n)},Jn=function(A,e,t){void 0===t&&(t=". ");var r=e.length;return zn(Math.abs(A),r,!1,(function(A){return e[Math.floor(A%r)]}))+t},Gn=function(A,e,t,r,n,B){if(A<-9999||A>9999)return Zn(A,xt.CJK_DECIMAL,n.length>0);var s=Math.abs(A),o=n;if(0===s)return e[0]+o;for(var i=0;s>0&&i<=4;i++){var a=s%10;0===a&&Lr(B,1)&&""!==o?o=e[a]+o:a>1||1===a&&0===i||1===a&&1===i&&Lr(B,2)||1===a&&1===i&&Lr(B,4)&&A>100||1===a&&i>1&&Lr(B,8)?o=e[a]+(i>0?t[i-1]:"")+o:1===a&&i>0&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o},kn="十百千萬",Wn="拾佰仟萬",Yn="マイナス",qn="마이너스",Zn=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"",s=t?" ":"";switch(e){case xt.DISC:return"•"+s;case xt.CIRCLE:return"◦"+s;case xt.SQUARE:return"◾"+s;case xt.DECIMAL_LEADING_ZERO:var o=Xn(A,48,57,!0,r);return o.length<4?"0"+o:o;case xt.CJK_DECIMAL:return Jn(A,"〇一二三四五六七八九",n);case xt.LOWER_ROMAN:return Vn(A,1,3999,yn,xt.DECIMAL,r).toLowerCase();case xt.UPPER_ROMAN:return Vn(A,1,3999,yn,xt.DECIMAL,r);case xt.LOWER_GREEK:return Xn(A,945,969,!1,r);case xt.LOWER_ALPHA:return Xn(A,97,122,!1,r);case xt.UPPER_ALPHA:return Xn(A,65,90,!1,r);case xt.ARABIC_INDIC:return Xn(A,1632,1641,!0,r);case xt.ARMENIAN:case xt.UPPER_ARMENIAN:return Vn(A,1,9999,_n,xt.DECIMAL,r);case xt.LOWER_ARMENIAN:return Vn(A,1,9999,_n,xt.DECIMAL,r).toLowerCase();case xt.BENGALI:return Xn(A,2534,2543,!0,r);case xt.CAMBODIAN:case xt.KHMER:return Xn(A,6112,6121,!0,r);case xt.CJK_EARTHLY_BRANCH:return Jn(A,"子丑寅卯辰巳午未申酉戌亥",n);case xt.CJK_HEAVENLY_STEM:return Jn(A,"甲乙丙丁戊己庚辛壬癸",n);case xt.CJK_IDEOGRAPHIC:case xt.TRAD_CHINESE_INFORMAL:return Gn(A,"零一二三四五六七八九",kn,"負",n,14);case xt.TRAD_CHINESE_FORMAL:return Gn(A,"零壹貳參肆伍陸柒捌玖",Wn,"負",n,15);case xt.SIMP_CHINESE_INFORMAL:return Gn(A,"零一二三四五六七八九",kn,"负",n,14);case xt.SIMP_CHINESE_FORMAL:return Gn(A,"零壹贰叁肆伍陆柒捌玖",Wn,"负",n,15);case xt.JAPANESE_INFORMAL:return Gn(A,"〇一二三四五六七八九","十百千万",Yn,n,0);case xt.JAPANESE_FORMAL:return Gn(A,"零壱弐参四伍六七八九","拾百千万",Yn,n,7);case xt.KOREAN_HANGUL_FORMAL:return Gn(A,"영일이삼사오육칠팔구","십백천만",qn,B,7);case xt.KOREAN_HANJA_INFORMAL:return Gn(A,"零一二三四五六七八九","十百千萬",qn,B,0);case xt.KOREAN_HANJA_FORMAL:return Gn(A,"零壹貳參四五六七八九","拾百千",qn,B,7);case xt.DEVANAGARI:return Xn(A,2406,2415,!0,r);case xt.GEORGIAN:return Vn(A,1,19999,xn,xt.DECIMAL,r);case xt.GUJARATI:return Xn(A,2790,2799,!0,r);case xt.GURMUKHI:return Xn(A,2662,2671,!0,r);case xt.HEBREW:return Vn(A,1,10999,Pn,xt.DECIMAL,r);case xt.HIRAGANA:return Jn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case xt.HIRAGANA_IROHA:return Jn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case xt.KANNADA:return Xn(A,3302,3311,!0,r);case xt.KATAKANA:return Jn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case xt.KATAKANA_IROHA:return Jn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case xt.LAO:return Xn(A,3792,3801,!0,r);case xt.MONGOLIAN:return Xn(A,6160,6169,!0,r);case xt.MYANMAR:return Xn(A,4160,4169,!0,r);case xt.ORIYA:return Xn(A,2918,2927,!0,r);case xt.PERSIAN:return Xn(A,1776,1785,!0,r);case xt.TAMIL:return Xn(A,3046,3055,!0,r);case xt.TELUGU:return Xn(A,3174,3183,!0,r);case xt.THAI:return Xn(A,3664,3673,!0,r);case xt.TIBETAN:return Xn(A,3872,3881,!0,r);case xt.DECIMAL:default:return Xn(A,48,57,!0,r)}},jn="data-html2canvas-ignore",$n=function(){function A(A,e){if(this.options=e,this.scrolledElements=[],this.referenceElement=A,this.counters=new Mn,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement)}return A.prototype.toIFrame=function(A,e){var t=this,B=eB(A,e);if(!B.contentWindow)return Promise.reject("Unable to find iframe window");var s=A.defaultView.pageXOffset,o=A.defaultView.pageYOffset,i=B.contentWindow,a=i.document,c=tB(B).then((function(){return r(t,void 0,void 0,(function(){var A;return n(this,(function(t){switch(t.label){case 0:return this.scrolledElements.forEach(sB),i&&(i.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||i.scrollY===e.top&&i.scrollX===e.left||(a.documentElement.style.top=-e.top+"px",a.documentElement.style.left=-e.left+"px",a.documentElement.style.position="absolute")),A=this.options.onclone,void 0===this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:t.sent(),t.label=2;case 2:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(a)})).then((function(){return B}))]:[2,B]}}))}))}));return a.open(),a.write(nB(document.doctype)+"<html></html>"),BB(this.referenceElement.ownerDocument,s,o),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),c},A.prototype.createElementClone=function(A){if(Rn(A))return this.createCanvasClone(A);if(vn(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Ln(e)&&"lazy"===e.loading&&(e.loading="eager"),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(Re.getInstance(this.options.id).error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){if(this.options.inlineImages&&A.ownerDocument){var e=A.ownerDocument.createElement("img");try{return e.src=A.toDataURL(),e}catch(A){Re.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var t=A.cloneNode(!1);try{t.width=A.width,t.height=A.height;var r=A.getContext("2d"),n=t.getContext("2d");return n&&(r?n.putImageData(r.getImageData(0,0,A.width,A.height),0,0):n.drawImage(A,0,0)),t}catch(A){}return t},A.prototype.cloneNode=function(A){if(Hn(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(e&&dn(A)&&(fn(A)||pn(A))){var t=this.createElementClone(A),r=e.getComputedStyle(A),n=e.getComputedStyle(A,":before"),B=e.getComputedStyle(A,":after");this.referenceElement===A&&fn(t)&&(this.clonedReferenceElement=t),mn(t)&&cB(t);for(var s=this.counters.parse(new Pr(r)),o=this.resolvePseudoContent(A,t,n,mr.BEFORE),i=A.firstChild;i;i=i.nextSibling)dn(i)&&(Dn(i)||i.hasAttribute(jn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(i))||this.options.copyStyles&&dn(i)&&vn(i)||t.appendChild(this.cloneNode(i));o&&t.insertBefore(o,t.firstChild);var a=this.resolvePseudoContent(A,t,B,mr.AFTER);return a&&t.appendChild(a),this.counters.pop(s),r&&(this.options.copyStyles||pn(A))&&!On(A)&&rB(r,t),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([t,A.scrollLeft,A.scrollTop]),(bn(A)||Sn(A))&&(bn(t)||Sn(t))&&(t.value=A.value),t}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,r){var n=this;if(t){var B=t.content,s=e.ownerDocument;if(s&&B&&"none"!==B&&"-moz-alt-content"!==B&&"none"!==t.display){this.counters.parse(new Pr(t));var o=new _r(t),i=s.createElement("html2canvaspseudoelement");rB(t,i),o.content.forEach((function(e){if(e.type===u.STRING_TOKEN)i.appendChild(s.createTextNode(e.value));else if(e.type===u.URL_TOKEN){var t=s.createElement("img");t.src=e.value,t.style.opacity="1",i.appendChild(t)}else if(e.type===u.FUNCTION){if("attr"===e.name){var r=e.values.filter(yA);r.length&&i.appendChild(s.createTextNode(A.getAttribute(r[0].value)||""))}else if("counter"===e.name){var B=e.values.filter(VA),a=B[0],c=B[1];if(a&&yA(a)){var Q=n.counters.getCounterValue(a.value),w=c&&yA(c)?Xt.parse(c.value):xt.DECIMAL;i.appendChild(s.createTextNode(Zn(Q,w,!1)))}}else if("counters"===e.name){var U=e.values.filter(VA),l=(a=U[0],U[1]);c=U[2];if(a&&yA(a)){var C=n.counters.getCounterValues(a.value),g=c&&yA(c)?Xt.parse(c.value):xt.DECIMAL,E=l&&l.type===u.STRING_TOKEN?l.value:"",F=C.map((function(A){return Zn(A,g,!1)})).join(E);i.appendChild(s.createTextNode(F))}}}else if(e.type===u.IDENT_TOKEN)switch(e.value){case"open-quote":i.appendChild(s.createTextNode(Sr(o.quotes,n.quoteDepth++,!0)));break;case"close-quote":i.appendChild(s.createTextNode(Sr(o.quotes,--n.quoteDepth,!1)));break;default:i.appendChild(s.createTextNode(e.value))}})),i.className=oB+" "+iB;var a=r===mr.BEFORE?" "+oB:" "+iB;return pn(e)?e.className.baseValue+=a:e.className+=a,i}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(mr||(mr={}));var AB,eB=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(jn,"true"),A.body.appendChild(t),t},tB=function(A){return new Promise((function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=A.onload=n.onreadystatechange=function(){r.onload=A.onload=n.onreadystatechange=null;var t=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),e(A))}),50)}}))},rB=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e},nB=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},BB=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},sB=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},oB="___html2canvas___pseudoelement_before",iB="___html2canvas___pseudoelement_after",aB='{\n    content: "" !important;\n    display: none !important;\n}',cB=function(A){QB(A,"."+oB+":before"+aB+"\n         ."+iB+":after"+aB)},QB=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}};!function(A){A[A.VECTOR=0]="VECTOR",A[A.BEZIER_CURVE=1]="BEZIER_CURVE"}(AB||(AB={}));var uB,wB=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},UB=function(){function A(A,e){this.type=AB.VECTOR,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),lB=function(A,e,t){return new UB(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},CB=function(){function A(A,e,t,r){this.type=AB.BEZIER_CURVE,this.start=A,this.startControl=e,this.endControl=t,this.end=r}return A.prototype.subdivide=function(e,t){var r=lB(this.start,this.startControl,e),n=lB(this.startControl,this.endControl,e),B=lB(this.endControl,this.end,e),s=lB(r,n,e),o=lB(n,B,e),i=lB(s,o,e);return t?new A(this.start,r,s,i):new A(i,o,B,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),gB=function(A){return A.type===AB.BEZIER_CURVE},EB=function(A){var e=A.styles,t=A.bounds,r=ZA(e.borderTopLeftRadius,t.width,t.height),n=r[0],B=r[1],s=ZA(e.borderTopRightRadius,t.width,t.height),o=s[0],i=s[1],a=ZA(e.borderBottomRightRadius,t.width,t.height),c=a[0],Q=a[1],u=ZA(e.borderBottomLeftRadius,t.width,t.height),w=u[0],U=u[1],l=[];l.push((n+o)/t.width),l.push((w+c)/t.width),l.push((B+U)/t.height),l.push((i+Q)/t.height);var C=Math.max.apply(Math,l);C>1&&(n/=C,B/=C,o/=C,i/=C,c/=C,Q/=C,w/=C,U/=C);var g=t.width-o,E=t.height-Q,F=t.width-c,h=t.height-U,H=e.borderTopWidth,d=e.borderRightWidth,f=e.borderBottomWidth,p=e.borderLeftWidth,N=jA(e.paddingTop,A.bounds.width),K=jA(e.paddingRight,A.bounds.width),I=jA(e.paddingBottom,A.bounds.width),T=jA(e.paddingLeft,A.bounds.width);this.topLeftBorderBox=n>0||B>0?FB(t.left,t.top,n,B,uB.TOP_LEFT):new UB(t.left,t.top),this.topRightBorderBox=o>0||i>0?FB(t.left+g,t.top,o,i,uB.TOP_RIGHT):new UB(t.left+t.width,t.top),this.bottomRightBorderBox=c>0||Q>0?FB(t.left+F,t.top+E,c,Q,uB.BOTTOM_RIGHT):new UB(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=w>0||U>0?FB(t.left,t.top+h,w,U,uB.BOTTOM_LEFT):new UB(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||B>0?FB(t.left+p,t.top+H,Math.max(0,n-p),Math.max(0,B-H),uB.TOP_LEFT):new UB(t.left+p,t.top+H),this.topRightPaddingBox=o>0||i>0?FB(t.left+Math.min(g,t.width+p),t.top+H,g>t.width+p?0:o-p,i-H,uB.TOP_RIGHT):new UB(t.left+t.width-d,t.top+H),this.bottomRightPaddingBox=c>0||Q>0?FB(t.left+Math.min(F,t.width-p),t.top+Math.min(E,t.height+H),Math.max(0,c-d),Q-f,uB.BOTTOM_RIGHT):new UB(t.left+t.width-d,t.top+t.height-f),this.bottomLeftPaddingBox=w>0||U>0?FB(t.left+p,t.top+h,Math.max(0,w-p),U-f,uB.BOTTOM_LEFT):new UB(t.left+p,t.top+t.height-f),this.topLeftContentBox=n>0||B>0?FB(t.left+p+T,t.top+H+N,Math.max(0,n-(p+T)),Math.max(0,B-(H+N)),uB.TOP_LEFT):new UB(t.left+p+T,t.top+H+N),this.topRightContentBox=o>0||i>0?FB(t.left+Math.min(g,t.width+p+T),t.top+H+N,g>t.width+p+T?0:o-p+T,i-(H+N),uB.TOP_RIGHT):new UB(t.left+t.width-(d+K),t.top+H+N),this.bottomRightContentBox=c>0||Q>0?FB(t.left+Math.min(F,t.width-(p+T)),t.top+Math.min(E,t.height+H+N),Math.max(0,c-(d+K)),Q-(f+I),uB.BOTTOM_RIGHT):new UB(t.left+t.width-(d+K),t.top+t.height-(f+I)),this.bottomLeftContentBox=w>0||U>0?FB(t.left+p+T,t.top+h,Math.max(0,w-(p+T)),U-(f+I),uB.BOTTOM_LEFT):new UB(t.left+p+T,t.top+t.height-(f+I))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(uB||(uB={}));var FB=function(A,e,t,r,n){var B=(Math.sqrt(2)-1)/3*4,s=t*B,o=r*B,i=A+t,a=e+r;switch(n){case uB.TOP_LEFT:return new CB(new UB(A,a),new UB(A,a-o),new UB(i-s,e),new UB(i,e));case uB.TOP_RIGHT:return new CB(new UB(A,e),new UB(A+s,e),new UB(i,a-o),new UB(i,a));case uB.BOTTOM_RIGHT:return new CB(new UB(i,e),new UB(i,e+o),new UB(A+s,a),new UB(A,a));case uB.BOTTOM_LEFT:default:return new CB(new UB(i,a),new UB(i-s,a),new UB(A,e+o),new UB(A,e))}},hB=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},HB=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},dB=function(A,e,t){this.type=0,this.offsetX=A,this.offsetY=e,this.matrix=t,this.target=6},fB=function(A,e){this.type=1,this.target=e,this.path=A},pB=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},NB=function(){function A(A,e){if(this.container=A,this.effects=e.slice(0),this.curves=new EB(A),null!==A.styles.transform){var t=A.bounds.left+A.styles.transformOrigin[0].number,r=A.bounds.top+A.styles.transformOrigin[1].number,n=A.styles.transform;this.effects.push(new dB(t,r,n))}if(A.styles.overflowX!==zt.VISIBLE){var B=hB(this.curves),s=HB(this.curves);wB(B,s)?this.effects.push(new fB(B,6)):(this.effects.push(new fB(B,2)),this.effects.push(new fB(s,4)))}}return A.prototype.getParentEffects=function(){var A=this.effects.slice(0);if(this.container.styles.overflowX!==zt.VISIBLE){var e=hB(this.curves),t=HB(this.curves);wB(e,t)||A.push(new fB(t,6))}return A},A}(),KB=function(A,e,t,r){A.container.elements.forEach((function(n){var B=Lr(n.flags,4),s=Lr(n.flags,2),o=new NB(n,A.getParentEffects());Lr(n.styles.display,2048)&&r.push(o);var i=Lr(n.flags,8)?[]:r;if(B||s){var a=B||n.styles.isPositioned()?t:e,c=new pB(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var Q=n.styles.zIndex.order;if(Q<0){var u=0;a.negativeZIndex.some((function(A,e){return Q>A.element.container.styles.zIndex.order?(u=e,!1):u>0})),a.negativeZIndex.splice(u,0,c)}else if(Q>0){var w=0;a.positiveZIndex.some((function(A,e){return Q>=A.element.container.styles.zIndex.order?(w=e+1,!1):w>0})),a.positiveZIndex.splice(w,0,c)}else a.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?a.nonPositionedFloats.push(c):a.nonPositionedInlineLevel.push(c);KB(o,c,B?c:t,i)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),KB(o,e,t,i);Lr(n.flags,8)&&IB(n,i)}))},IB=function(A,e){for(var t=A instanceof tn?A.start:1,r=A instanceof tn&&A.reversed,n=0;n<e.length;n++){var B=e[n];B.container instanceof en&&"number"==typeof B.container.value&&0!==B.container.value&&(t=B.container.value),B.listValue=Zn(t,B.container.styles.listStyleType,!0),t+=r?-1:1}},TB=function(A,e,t,r){var n=[];return gB(A)?n.push(A.subdivide(.5,!1)):n.push(A),gB(t)?n.push(t.subdivide(.5,!0)):n.push(t),gB(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),gB(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},mB=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},RB=function(A){var e=A.styles,t=A.bounds,r=jA(e.paddingLeft,t.width),n=jA(e.paddingRight,t.width),B=jA(e.paddingTop,t.width),s=jA(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,B+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+B+s))},LB=function(A,e,t){var r=function(A,e){return 0===A?e.bounds:2===A?RB(e):mB(e)}(bB(A.styles.backgroundOrigin,e),A),n=function(A,e){return A===we.BORDER_BOX?e.bounds:A===we.CONTENT_BOX?RB(e):mB(e)}(bB(A.styles.backgroundClip,e),A),B=DB(bB(A.styles.backgroundSize,e),t,r),s=B[0],o=B[1],i=ZA(bB(A.styles.backgroundPosition,e),r.width-s,r.height-o);return[SB(bB(A.styles.backgroundRepeat,e),i,B,r,n),Math.round(r.left+i[0]),Math.round(r.top+i[1]),s,o]},OB=function(A){return yA(A)&&A.value===nt.AUTO},vB=function(A){return"number"==typeof A},DB=function(A,e,t){var r=e[0],n=e[1],B=e[2],s=A[0],o=A[1];if(GA(s)&&o&&GA(o))return[jA(s,t.width),jA(o,t.height)];var i=vB(B);if(yA(s)&&(s.value===nt.CONTAIN||s.value===nt.COVER))return vB(B)?t.width/t.height<B!=(s.value===nt.COVER)?[t.width,t.width/B]:[t.height*B,t.height]:[t.width,t.height];var a=vB(r),c=vB(n),Q=a||c;if(OB(s)&&(!o||OB(o)))return a&&c?[r,n]:i||Q?Q&&i?[a?r:n*B,c?n:r/B]:[a?r:t.width,c?n:t.height]:[t.width,t.height];if(i){var u=0,w=0;return GA(s)?u=jA(s,t.width):GA(o)&&(w=jA(o,t.height)),OB(s)?u=w*B:o&&!OB(o)||(w=u/B),[u,w]}var U=null,l=null;if(GA(s)?U=jA(s,t.width):o&&GA(o)&&(l=jA(o,t.height)),null===U||o&&!OB(o)||(l=a&&c?U/r*n:t.height),null!==l&&OB(s)&&(U=a&&c?l/n*r:t.width),null!==U&&null!==l)return[U,l];throw new Error("Unable to calculate background-size for element")},bB=function(A,e){var t=A[e];return void 0===t?A[0]:t},SB=function(A,e,t,r,n){var B=e[0],s=e[1],o=t[0],i=t[1];switch(A){case $e.REPEAT_X:return[new UB(Math.round(r.left),Math.round(r.top+s)),new UB(Math.round(r.left+r.width),Math.round(r.top+s)),new UB(Math.round(r.left+r.width),Math.round(i+r.top+s)),new UB(Math.round(r.left),Math.round(i+r.top+s))];case $e.REPEAT_Y:return[new UB(Math.round(r.left+B),Math.round(r.top)),new UB(Math.round(r.left+B+o),Math.round(r.top)),new UB(Math.round(r.left+B+o),Math.round(r.height+r.top)),new UB(Math.round(r.left+B),Math.round(r.height+r.top))];case $e.NO_REPEAT:return[new UB(Math.round(r.left+B),Math.round(r.top+s)),new UB(Math.round(r.left+B+o),Math.round(r.top+s)),new UB(Math.round(r.left+B+o),Math.round(r.top+s+i)),new UB(Math.round(r.left+B),Math.round(r.top+s+i))];default:return[new UB(Math.round(n.left),Math.round(n.top)),new UB(Math.round(n.left+n.width),Math.round(n.top)),new UB(Math.round(n.left+n.width),Math.round(n.height+n.top)),new UB(Math.round(n.left),Math.round(n.height+n.top))]}},MB="Hidden Text",yB=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),B=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",B.appendChild(t),r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(MB)),t.appendChild(n),t.appendChild(r);var s=r.offsetTop-n.offsetTop+2;t.removeChild(n),t.appendChild(this._document.createTextNode(MB)),t.style.lineHeight="normal",r.style.verticalAlign="super";var o=r.offsetTop-t.offsetTop+2;return B.removeChild(t),{baseline:s,middle:o}},A.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),_B=function(){function A(A){this._activeEffects=[],this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=A,A.canvas||(this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px"),this.fontMetrics=new yB(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),this.ctx.textBaseline="bottom",this._activeEffects=[],Re.getInstance(A.id).debug("Canvas renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}return A.prototype.applyEffects=function(A,e){for(var t=this;this._activeEffects.length;)this.popEffect();A.filter((function(A){return Lr(A.target,e)})).forEach((function(A){return t.applyEffect(A)}))},A.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),function(A){return 1===A.type}(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(A){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return(e=A.element.container.styles).isVisible()?(this.ctx.globalAlpha=e.opacity,[4,this.renderStackContent(A)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},A.prototype.renderNode=function(A){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},A.prototype.renderTextWithLetterSpacing=function(A,e){var t=this;if(0===e)this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height);else{var r=o(A.text).map((function(A){return i(A)}));r.reduce((function(e,r){return t.ctx.fillText(r,e,A.bounds.top+A.bounds.height),e+t.ctx.measureText(r).width}),A.bounds.left)}},A.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=A.fontFamily.join(", "),r=SA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]},A.prototype.renderTextNode=function(A,e){return r(this,void 0,void 0,(function(){var t,r,B,s,o=this;return n(this,(function(n){return t=this.createFontStyle(e),r=t[0],B=t[1],s=t[2],this.ctx.font=r,A.textBounds.forEach((function(A){o.ctx.fillStyle=oe(e.color),o.renderTextWithLetterSpacing(A,e.letterSpacing);var t=e.textShadow;t.length&&A.text.trim().length&&(t.slice(0).reverse().forEach((function(e){o.ctx.shadowColor=oe(e.color),o.ctx.shadowOffsetX=e.offsetX.number*o.options.scale,o.ctx.shadowOffsetY=e.offsetY.number*o.options.scale,o.ctx.shadowBlur=e.blur.number,o.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)})),o.ctx.shadowColor="",o.ctx.shadowOffsetX=0,o.ctx.shadowOffsetY=0,o.ctx.shadowBlur=0),e.textDecorationLine.length&&(o.ctx.fillStyle=oe(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:var t=o.fontMetrics.getMetrics(B,s).baseline;o.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+t),A.bounds.width,1);break;case 2:o.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:var r=o.fontMetrics.getMetrics(B,s).middle;o.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+r),A.bounds.width,1)}})))})),[2]}))}))},A.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var r=RB(A),n=HB(e);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,i,a,c,Q,w,U,l,C,g,E;return n(this,(function(n){switch(n.label){case 0:this.applyEffects(e.effects,4),t=e.container,r=e.curves,s=t.styles,o=0,i=t.textNodes,n.label=1;case 1:return o<i.length?(a=i[o],[4,this.renderTextNode(a,s)]):[3,4];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:if(!(t instanceof jr))return[3,8];n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.options.cache.match(t.src)];case 6:return C=n.sent(),this.renderReplacedElement(t,r,C),[3,8];case 7:return n.sent(),Re.getInstance(this.options.id).error("Error loading image "+t.src),[3,8];case 8:if(t instanceof $r&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof An))return[3,12];n.label=9;case 9:return n.trys.push([9,11,,12]),[4,this.options.cache.match(t.svg)];case 10:return C=n.sent(),this.renderReplacedElement(t,r,C),[3,12];case 11:return n.sent(),Re.getInstance(this.options.id).error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Un&&t.tree?[4,new A({id:this.options.id,scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,scrollX:0,scrollY:0,width:t.width,height:t.height,cache:this.options.cache,windowWidth:t.width,windowHeight:t.height}).render(t.tree)]:[3,14];case 13:c=n.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),n.label=14;case 14:if(t instanceof cn&&(Q=Math.min(t.bounds.width,t.bounds.height),t.type===Bn?t.checked&&(this.ctx.save(),this.path([new UB(t.bounds.left+.39363*Q,t.bounds.top+.79*Q),new UB(t.bounds.left+.16*Q,t.bounds.top+.5549*Q),new UB(t.bounds.left+.27347*Q,t.bounds.top+.44071*Q),new UB(t.bounds.left+.39694*Q,t.bounds.top+.5649*Q),new UB(t.bounds.left+.72983*Q,t.bounds.top+.23*Q),new UB(t.bounds.left+.84*Q,t.bounds.top+.34085*Q),new UB(t.bounds.left+.39363*Q,t.bounds.top+.79*Q)]),this.ctx.fillStyle=oe(an),this.ctx.fill(),this.ctx.restore()):t.type===sn&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+Q/2,t.bounds.top+Q/2,Q/4,0,2*Math.PI,!0),this.ctx.fillStyle=oe(an),this.ctx.fill(),this.ctx.restore())),PB(t)&&t.value.length){switch(this.ctx.font=this.createFontStyle(s)[0],this.ctx.fillStyle=oe(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign=VB(t.styles.textAlign),E=RB(t),w=0,t.styles.textAlign){case jt.CENTER:w+=E.width/2;break;case jt.RIGHT:w+=E.width}U=E.add(w,0,0,-E.height/2+1),this.ctx.save(),this.path([new UB(E.left,E.top),new UB(E.left+E.width,E.top),new UB(E.left+E.width,E.top+E.height),new UB(E.left,E.top+E.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new zr(t.value,U),s.letterSpacing),this.ctx.restore(),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"}if(!Lr(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if((l=t.styles.listStyleImage).type!==ge.URL)return[3,18];C=void 0,g=l.url,n.label=15;case 15:return n.trys.push([15,17,,18]),[4,this.options.cache.match(g)];case 16:return C=n.sent(),this.ctx.drawImage(C,t.bounds.left-(C.width+10),t.bounds.top),[3,18];case 17:return n.sent(),Re.getInstance(this.options.id).error("Error loading list-style-image "+g),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==xt.NONE&&(this.ctx.font=this.createFontStyle(s)[0],this.ctx.fillStyle=oe(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",E=new B(t.bounds.left,t.bounds.top+jA(t.styles.paddingTop,t.bounds.width),t.bounds.width,function(A,e){return yA(A)&&"normal"===A.value?1.2*e:A.type===u.NUMBER_TOKEN?e*A.number:GA(A)?jA(A,e):e}(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new zr(e.listValue,E),s.letterSpacing),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),n.label=20;case 20:return[2]}}))}))},A.prototype.renderStackContent=function(A){return r(this,void 0,void 0,(function(){var e,t,r,B,s,o,i,a,c,Q,u,w,U,l,C;return n(this,(function(n){switch(n.label){case 0:return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:n.sent(),e=0,t=A.negativeZIndex,n.label=2;case 2:return e<t.length?(C=t[e],[4,this.renderStack(C)]):[3,5];case 3:n.sent(),n.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:n.sent(),r=0,B=A.nonInlineLevel,n.label=7;case 7:return r<B.length?(C=B[r],[4,this.renderNode(C)]):[3,10];case 8:n.sent(),n.label=9;case 9:return r++,[3,7];case 10:s=0,o=A.nonPositionedFloats,n.label=11;case 11:return s<o.length?(C=o[s],[4,this.renderStack(C)]):[3,14];case 12:n.sent(),n.label=13;case 13:return s++,[3,11];case 14:i=0,a=A.nonPositionedInlineLevel,n.label=15;case 15:return i<a.length?(C=a[i],[4,this.renderStack(C)]):[3,18];case 16:n.sent(),n.label=17;case 17:return i++,[3,15];case 18:c=0,Q=A.inlineLevel,n.label=19;case 19:return c<Q.length?(C=Q[c],[4,this.renderNode(C)]):[3,22];case 20:n.sent(),n.label=21;case 21:return c++,[3,19];case 22:u=0,w=A.zeroOrAutoZIndexOrTransformedOrOpacity,n.label=23;case 23:return u<w.length?(C=w[u],[4,this.renderStack(C)]):[3,26];case 24:n.sent(),n.label=25;case 25:return u++,[3,23];case 26:U=0,l=A.positiveZIndex,n.label=27;case 27:return U<l.length?(C=l[U],[4,this.renderStack(C)]):[3,30];case 28:n.sent(),n.label=29;case 29:return U++,[3,27];case 30:return[2]}}))}))},A.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},A.prototype.formatPath=function(A){var e=this;A.forEach((function(A,t){var r=gB(A)?A.start:A;0===t?e.ctx.moveTo(r.x,r.y):e.ctx.lineTo(r.x,r.y),gB(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},A.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},A.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var r=this.canvas.ownerDocument.createElement("canvas");return r.width=e,r.height=t,r.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),r},A.prototype.renderBackgroundImage=function(A){return r(this,void 0,void 0,(function(){var e,t,r,B,s,o;return n(this,(function(i){switch(i.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var B,s,o,i,a,c,Q,u,w,U,l,C,g,E,F,h,H,d,f,p,N,K,I,T,m,R,L,O,v,D,b;return n(this,(function(n){switch(n.label){case 0:if(t.type!==ge.URL)return[3,5];B=void 0,s=t.url,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,r.options.cache.match(s)];case 2:return B=n.sent(),[3,4];case 3:return n.sent(),Re.getInstance(r.options.id).error("Error loading background-image "+s),[3,4];case 4:return B&&(o=LB(A,e,[B.width,B.height,B.width/B.height]),h=o[0],K=o[1],I=o[2],f=o[3],p=o[4],E=r.ctx.createPattern(r.resizeImage(B,f,p),"repeat"),r.renderRepeat(h,E,K,I)),[3,6];case 5:t.type===ge.LINEAR_GRADIENT?(i=LB(A,e,[null,null,null]),h=i[0],K=i[1],I=i[2],f=i[3],p=i[4],a=de(t.angle,f,p),c=a[0],Q=a[1],u=a[2],w=a[3],U=a[4],(l=document.createElement("canvas")).width=f,l.height=p,C=l.getContext("2d"),g=C.createLinearGradient(Q,w,u,U),He(t.stops,c).forEach((function(A){return g.addColorStop(A.stop,oe(A.color))})),C.fillStyle=g,C.fillRect(0,0,f,p),f>0&&p>0&&(E=r.ctx.createPattern(l,"repeat"),r.renderRepeat(h,E,K,I))):function(A){return A.type===ge.RADIAL_GRADIENT}(t)&&(F=LB(A,e,[null,null,null]),h=F[0],H=F[1],d=F[2],f=F[3],p=F[4],N=0===t.position.length?[YA]:t.position,K=jA(N[0],f),I=jA(N[N.length-1],p),T=function(A,e,t,r,n){var B=0,s=0;switch(A.size){case Ze.CLOSEST_SIDE:A.shape===qe.CIRCLE?B=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===qe.ELLIPSE&&(B=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-n)));break;case Ze.CLOSEST_CORNER:if(A.shape===qe.CIRCLE)B=s=Math.min(fe(e,t),fe(e,t-n),fe(e-r,t),fe(e-r,t-n));else if(A.shape===qe.ELLIPSE){var o=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),i=pe(r,n,e,t,!0),a=i[0],c=i[1];s=o*(B=fe(a-e,(c-t)/o))}break;case Ze.FARTHEST_SIDE:A.shape===qe.CIRCLE?B=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===qe.ELLIPSE&&(B=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-n)));break;case Ze.FARTHEST_CORNER:if(A.shape===qe.CIRCLE)B=s=Math.max(fe(e,t),fe(e,t-n),fe(e-r,t),fe(e-r,t-n));else if(A.shape===qe.ELLIPSE){o=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r));var Q=pe(r,n,e,t,!1);a=Q[0],c=Q[1],s=o*(B=fe(a-e,(c-t)/o))}}return Array.isArray(A.size)&&(B=jA(A.size[0],r),s=2===A.size.length?jA(A.size[1],n):B),[B,s]}(t,K,I,f,p),m=T[0],R=T[1],m>0&&m>0&&(L=r.ctx.createRadialGradient(H+K,d+I,0,H+K,d+I,m),He(t.stops,2*m).forEach((function(A){return L.addColorStop(A.stop,oe(A.color))})),r.path(h),r.ctx.fillStyle=L,m!==R?(O=A.bounds.left+.5*A.bounds.width,v=A.bounds.top+.5*A.bounds.height,b=1/(D=R/m),r.ctx.save(),r.ctx.translate(O,v),r.ctx.transform(1,0,0,D,0,0),r.ctx.translate(-O,-v),r.ctx.fillRect(H,b*(d-v)+v,f,p*b),r.ctx.restore()):r.ctx.fill())),n.label=6;case 6:return e--,[2]}}))},r=this,B=0,s=A.styles.backgroundImage.slice(0).reverse(),i.label=1;case 1:return B<s.length?(o=s[B],[5,t(o)]):[3,4];case 2:i.sent(),i.label=3;case 3:return B++,[3,1];case 4:return[2]}}))}))},A.prototype.renderBorder=function(A,e,t){return r(this,void 0,void 0,(function(){return n(this,(function(r){return this.path(function(A,e){switch(e){case 0:return TB(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return TB(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return TB(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return TB(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}(t,e)),this.ctx.fillStyle=oe(A),this.ctx.fill(),[2]}))}))},A.prototype.renderNodeBackgroundAndBorders=function(A){return r(this,void 0,void 0,(function(){var e,t,r,B,s,o,i,a,c=this;return n(this,(function(n){switch(n.label){case 0:return this.applyEffects(A.effects,2),e=A.container.styles,t=!se(e.backgroundColor)||e.backgroundImage.length,r=[{style:e.borderTopStyle,color:e.borderTopColor},{style:e.borderRightStyle,color:e.borderRightColor},{style:e.borderBottomStyle,color:e.borderBottomColor},{style:e.borderLeftStyle,color:e.borderLeftColor}],B=xB(bB(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(B),this.ctx.clip(),se(e.backgroundColor)||(this.ctx.fillStyle=oe(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:n.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){c.ctx.save();var t,r,n,B,s,o=hB(A.curves),i=e.inset?0:1e4,a=(t=o,r=-i+(e.inset?1:-1)*e.spread.number,n=(e.inset?1:-1)*e.spread.number,B=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),t.map((function(A,e){switch(e){case 0:return A.add(r,n);case 1:return A.add(r+B,n);case 2:return A.add(r+B,n+s);case 3:return A.add(r,n+s)}return A})));e.inset?(c.path(o),c.ctx.clip(),c.mask(a)):(c.mask(o),c.ctx.clip(),c.path(a)),c.ctx.shadowOffsetX=e.offsetX.number+i,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=oe(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?oe(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),n.label=2;case 2:s=0,o=0,i=r,n.label=3;case 3:return o<i.length?(a=i[o]).style===ot.NONE||se(a.color)?[3,5]:[4,this.renderBorder(a.color,s,A.curves)]:[3,7];case 4:n.sent(),n.label=5;case 5:s++,n.label=6;case 6:return o++,[3,3];case 7:return[2]}}))}))},A.prototype.render=function(A){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=oe(this.options.backgroundColor),this.ctx.fillRect(this.options.x-this.options.scrollX,this.options.y-this.options.scrollY,this.options.width,this.options.height)),r=new NB(A,[]),n=new pB(r),KB(r,n,n,B=[]),IB(r.container,B),e=n,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([],2),[2,this.canvas]}var r,n,B}))}))},A}(),PB=function(A){return A instanceof un||(A instanceof Qn||A instanceof cn&&A.type!==sn&&A.type!==Bn)},xB=function(A,e){switch(A){case we.BORDER_BOX:return hB(e);case we.CONTENT_BOX:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);case we.PADDING_BOX:default:return HB(e)}},VB=function(A){switch(A){case jt.CENTER:return"center";case jt.RIGHT:return"right";case jt.LEFT:default:return"left"}},zB=function(){function A(A){this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=A,this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),Re.getInstance(A.id).debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}return A.prototype.render=function(A){return r(this,void 0,void 0,(function(){var e,t;return n(this,(function(r){switch(r.label){case 0:return e=Ie(Math.max(this.options.windowWidth,this.options.width)*this.options.scale,Math.max(this.options.windowHeight,this.options.height)*this.options.scale,this.options.scrollX*this.options.scale,this.options.scrollY*this.options.scale,A),[4,XB(e)];case 1:return t=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=oe(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},A}(),XB=function(A){return new Promise((function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},JB=function(A){return Be(bA.create(A).parseComponentValue())};"undefined"!=typeof window&&Le.setContext(window);var GB=function(A,e){return r(undefined,void 0,void 0,(function(){var r,o,i,a,c,Q,u,w,U,l,C,g,E,F,h,H,d,f,p,N,K,I,T;return n(this,(function(n){switch(n.label){case 0:if(!(r=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(o=r.defaultView))throw new Error("Document is not attached to a Window");return i=(Math.round(1e3*Math.random())+Date.now()).toString(16),a=mn(A)||"HTML"===A.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),n=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new B(0,0,r,n)}(r):s(A),c=a.width,Q=a.height,u=a.left,w=a.top,U=t({},{allowTaint:!1,imageTimeout:15e3,proxy:void 0,useCORS:!1},e),l={backgroundColor:"#ffffff",cache:e.cache?e.cache:Le.create(i,U),logging:!0,removeContainer:!0,foreignObjectRendering:!1,scale:o.devicePixelRatio||1,windowWidth:o.innerWidth,windowHeight:o.innerHeight,scrollX:o.pageXOffset,scrollY:o.pageYOffset,x:u,y:w,width:Math.ceil(c),height:Math.ceil(Q),id:i},C=t({},l,U,e),g=new B(C.scrollX,C.scrollY,C.windowWidth,C.windowHeight),Re.create({id:i,enabled:C.logging}),Re.getInstance(i).debug("Starting document clone"),E=new $n(A,{id:i,onclone:C.onclone,ignoreElements:C.ignoreElements,inlineImages:C.foreignObjectRendering,copyStyles:C.foreignObjectRendering}),(F=E.clonedReferenceElement)?[4,E.toIFrame(r,g)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=n.sent(),H=r.documentElement?JB(getComputedStyle(r.documentElement).backgroundColor):Ce.TRANSPARENT,d=r.body?JB(getComputedStyle(r.body).backgroundColor):Ce.TRANSPARENT,f=e.backgroundColor,p="string"==typeof f?JB(f):null===f?Ce.TRANSPARENT:4294967295,N=A===r.documentElement?se(H)?se(d)?p:d:H:p,K={id:i,cache:C.cache,canvas:C.canvas,backgroundColor:N,scale:C.scale,x:C.x,y:C.y,scrollX:C.scrollX,scrollY:C.scrollY,width:C.width,height:C.height,windowWidth:C.windowWidth,windowHeight:C.windowHeight},C.foreignObjectRendering?(Re.getInstance(i).debug("Document cloned, using foreign object rendering"),[4,new zB(K).render(F)]):[3,3];case 2:return I=n.sent(),[3,5];case 3:return Re.getInstance(i).debug("Document cloned, using computed rendering"),Le.attachInstance(C.cache),Re.getInstance(i).debug("Starting DOM parsing"),T=En(F),Le.detachInstance(),N===T.styles.backgroundColor&&(T.styles.backgroundColor=Ce.TRANSPARENT),Re.getInstance(i).debug("Starting renderer"),[4,new _B(K).render(T)];case 4:I=n.sent(),n.label=5;case 5:return!0===C.removeContainer&&($n.destroy(h)||Re.getInstance(i).error("Cannot detach cloned iframe as it is not in the DOM anymore")),Re.getInstance(i).debug("Finished rendering"),Re.destroy(i),Le.destroy(i),[2,I]}}))}))};return function(A,e){return void 0===e&&(e={}),GB(A,e)}}));