/*!
 * html2canvas 1.3.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2021 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="undefined"!=typeof globalThis?globalThis:A||self).html2canvas=e()}(this,function(){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var B=function(A,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(A,e)};function A(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}B(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var h=function(){return(h=Object.assign||function(A){for(var e,t=1,B=arguments.length;t<B;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(A[r]=e[r]);return A}).apply(this,arguments)};function a(A,s,o,i){return new(o=o||Promise)(function(t,e){function B(A){try{n(i.next(A))}catch(A){e(A)}}function r(A){try{n(i.throw(A))}catch(A){e(A)}}function n(A){var e;A.done?t(A.value):((e=A.value)instanceof o?e:new o(function(A){A(e)})).then(B,r)}n((i=i.apply(A,s||[])).next())})}function H(t,B){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},A={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function e(e){return function(A){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(s=2&e[0]?n.return:e[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,e[1])).done)return s;switch(n=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,n=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){o.label=e[1];break}if(6===e[0]&&o.label<s[1]){o.label=s[1],s=e;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(e);break}s[2]&&o.ops.pop(),o.trys.pop();continue}e=B.call(t,o)}catch(A){e=[6,A],n=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,A])}}}function t(A,e,t){if(t||2===arguments.length)for(var B,r=0,n=e.length;r<n;r++)!B&&r in e||((B=B||Array.prototype.slice.call(e,0,r))[r]=e[r]);return A.concat(B||e)}var d=(r.prototype.add=function(A,e,t,B){return new r(this.left+A,this.top+e,this.width+t,this.height+B)},r.fromClientRect=function(A,e){return new r(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},r.fromDOMRectList=function(A,e){e=e[0];return e?new r(e.x+A.windowBounds.left,e.y+A.windowBounds.top,e.width,e.height):r.EMPTY},r.EMPTY=new r(0,0,0,0),r);function r(A,e,t,B){this.left=A,this.top=e,this.width=t,this.height=B}for(var E=function(A,e){return d.fromClientRect(A,e.getBoundingClientRect())},Q=function(A){for(var e=[],t=0,B=A.length;t<B;){var r,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<B?56320==(64512&(r=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),t--):e.push(n)}return e},w=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 B=[],r=-1,n="";++r<t;){var s=A[r];s<=65535?B.push(s):(s-=65536,B.push(55296+(s>>10),s%1024+56320)),(r+1===t||16384<B.length)&&(n+=String.fromCharCode.apply(String,B),B.length=0)}return n},e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<e.length;n++)c[e.charCodeAt(n)]=n;function s(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var o=(i.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},i);function i(A,e,t,B,r,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=B,this.index=r,this.data=n}function g(A,e,t,B){var r=B[t];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var n=t;n<=B.length;){if((o=B[++n])===e)return 1;if(o!==p)break}if(r===p)for(n=t;0<n;){var s=B[--n];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o,i=t;i<=B.length;){if((o=B[++i])===e)return 1;if(o!==p)break}if(s!==p)break}}function C(A,e){for(var t=A;0<=t;){var B=e[t];if(B!==p)return B;t--}return 0}function U(t,A){var e=(r=function(A,B){void 0===B&&(B="strict");var r=[],n=[],s=[];return A.forEach(function(A,e){var t=j.get(A);if(50<t?(s.push(!0),t-=50):s.push(!1),-1!==["normal","auto","loose"].indexOf(B)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(e),r.push(16);if(4!==t&&11!==t)return n.push(e),31===t?r.push("strict"===B?R:J):t===W||29===t?r.push(G):43===t?131072<=A&&A<=196605||196608<=A&&A<=262141?r.push(J):r.push(G):void r.push(t);if(0===e)return n.push(e),r.push(G);t=r[e-1];return-1===tA.indexOf(t)?(n.push(n[e-1]),r.push(t)):(n.push(e),r.push(G))}),[n,r,s]}(t,(A=A||{lineBreak:"normal",wordBreak:"normal"}).lineBreak))[0],B=r[1],r=r[2];return[e,B="break-all"===A.wordBreak||"break-word"===A.wordBreak?B.map(function(A){return-1!==[T,G,W].indexOf(A)?J:A}):B,"keep-all"===A.wordBreak?r.map(function(A,e){return A&&19968<=t[e]&&t[e]<=40959}):void 0]}var F,l,u,f,I,p=10,y=13,K=15,L=17,m=18,D=19,b=20,R=21,O=22,S=24,T=25,v=26,M=27,N=28,G=30,x=32,V=33,P=34,k=35,J=37,X=38,_=39,Y=40,W=42,Z=[9001,65288],q="×",j=(u=function(A){var e,t,B,r,n=.75*A.length,s=A.length,o=0;"="===A[A.length-1]&&(n--,"="===A[A.length-2]&&n--);for(var n=new("undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n),i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=c[A.charCodeAt(Q)],t=c[A.charCodeAt(Q+1)],B=c[A.charCodeAt(Q+2)],r=c[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|B>>2,i[o++]=(3&B)<<6|63&r;return n}(F=" "),f=Array.isArray(u)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=4)t.push(A[B+3]<<24|A[B+2]<<16|A[B+1]<<8|A[B]);return t}(u):new Uint32Array(u),I=Array.isArray(u)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=2)t.push(A[B+1]<<8|A[B]);return t}(u):new Uint16Array(u),F=s(I,12,f[4]/2),l=2===f[5]?s(I,(24+f[4])/2):(u=f,I=Math.ceil((24+f[4])/4),u.slice?u.slice(I,l):new Uint32Array(Array.prototype.slice.call(u,I,l))),new o(f[0],f[1],f[2],f[3],F,l)),z=[G,36],$=[1,2,3,5],AA=[p,8],eA=[M,v],tA=$.concat(AA),BA=[X,_,Y,P,k],rA=[K,y],nA=(sA.prototype.slice=function(){return w.apply(void 0,this.codePoints.slice(this.start,this.end))},sA);function sA(A,e,t,B){this.codePoints=A,this.required="!"===e,this.start=t,this.end=B}function oA(A,e){var t=Q(A),B=(e=U(t,e))[0],r=e[1],n=e[2],s=t.length,o=0,i=0;return{next:function(){if(s<=i)return{done:!0,value:null};for(var A=q;i<s&&(A=function(A,e,t,B,r){if(0===t[B])return q;var n=B-1;if(Array.isArray(r)&&!0===r[n])return q;var s=n-1,o=1+n,i=e[n],B=0<=s?e[s]:0,r=e[o];if(2===i&&3===r)return q;if(-1!==$.indexOf(i))return"!";if(-1!==$.indexOf(r))return q;if(-1!==AA.indexOf(r))return q;if(8===C(n,e))return"÷";if(11===j.get(A[n]))return q;if((i===x||i===V)&&11===j.get(A[o]))return q;if(7===i||7===r)return q;if(9===i)return q;if(-1===[p,y,K].indexOf(i)&&9===r)return q;if(-1!==[L,m,D,S,N].indexOf(r))return q;if(C(n,e)===O)return q;if(g(23,O,n,e))return q;if(g([L,m],R,n,e))return q;if(g(12,12,n,e))return q;if(i===p)return"÷";if(23===i||23===r)return q;if(16===r||16===i)return"÷";if(-1!==[y,K,R].indexOf(r)||14===i)return q;if(36===B&&-1!==rA.indexOf(i))return q;if(i===N&&36===r)return q;if(r===b)return q;if(-1!==z.indexOf(r)&&i===T||-1!==z.indexOf(i)&&r===T)return q;if(i===M&&-1!==[J,x,V].indexOf(r)||-1!==[J,x,V].indexOf(i)&&r===v)return q;if(-1!==z.indexOf(i)&&-1!==eA.indexOf(r)||-1!==eA.indexOf(i)&&-1!==z.indexOf(r))return q;if(-1!==[M,v].indexOf(i)&&(r===T||-1!==[O,K].indexOf(r)&&e[1+o]===T)||-1!==[O,K].indexOf(i)&&r===T||i===T&&-1!==[T,N,S].indexOf(r))return q;if(-1!==[T,N,S,L,m].indexOf(r))for(var Q=n;0<=Q;){if((c=e[Q])===T)return q;if(-1===[N,S].indexOf(c))break;Q--}if(-1!==[M,v].indexOf(r))for(var c,Q=-1!==[L,m].indexOf(i)?s:n;0<=Q;){if((c=e[Q])===T)return q;if(-1===[N,S].indexOf(c))break;Q--}if(X===i&&-1!==[X,_,P,k].indexOf(r)||-1!==[_,P].indexOf(i)&&-1!==[_,Y].indexOf(r)||-1!==[Y,k].indexOf(i)&&r===Y)return q;if(-1!==BA.indexOf(i)&&-1!==[b,v].indexOf(r)||-1!==BA.indexOf(r)&&i===M)return q;if(-1!==z.indexOf(i)&&-1!==z.indexOf(r))return q;if(i===S&&-1!==z.indexOf(r))return q;if(-1!==z.concat(T).indexOf(i)&&r===O&&-1===Z.indexOf(A[o])||-1!==z.concat(T).indexOf(r)&&i===m)return q;if(41===i&&41===r){for(var a=t[n],w=1;0<a&&41===e[--a];)w++;if(w%2!=0)return q}return i===x&&r===V?q:"÷"}(t,r,B,++i,n))===q;);if(A===q&&i!==s)return{done:!0,value:null};var e=new nA(t,A,o,i);return o=i,{value:e,done:!1}}}}function iA(A){return 48<=A&&A<=57}function QA(A){return iA(A)||65<=A&&A<=70||97<=A&&A<=102}function cA(A){return 10===A||9===A||32===A}function aA(A){return 97<=(t=e=A)&&t<=122||65<=(e=e)&&e<=90||128<=A||95===A;var e,t}function wA(A){return aA(A)||iA(A)||45===A}function gA(A,e){return 92===A&&10!==e}function CA(A,e,t){return 45===A?aA(e)||gA(e,t):!!aA(A)||92===A&&10!==e}function UA(A,e,t){return 43===A||45===A?!!iA(e)||46===e&&iA(t):iA(46===A?e:A)}var FA={type:2},lA={type:3},uA={type:4},hA={type:13},dA={type:8},EA={type:21},HA={type:9},fA={type:10},IA={type:11},pA={type:12},yA={type:14},KA={type:23},LA={type:1},mA={type:25},DA={type:24},bA={type:26},RA={type:27},OA={type:28},SA={type:29},TA={type:31},vA={type:32},MA=(NA.prototype.write=function(A){this._value=this._value.concat(Q(A))},NA.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==vA;)A.push(e),e=this.consumeToken();return A},NA.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),B=this.peekCodePoint(2);if(wA(e)||gA(t,B)){var r=CA(e,t,B)?2:1;return{type:5,value:this.consumeName(),flags:r}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),hA;break;case 39:return this.consumeStringToken(39);case 40:return FA;case 41:return lA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),yA;break;case 43:if(UA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return uA;case 45:var B=A,r=this.peekCodePoint(0),n=this.peekCodePoint(1);if(UA(B,r,n))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(CA(B,r,n))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===r&&62===n)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(UA(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 s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(-1===s)return this.consumeToken()}break;case 58:return bA;case 59:return RA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),mA;break;case 64:var n=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);if(CA(n,o,i))return{type:7,value:this.consumeName()};break;case 91:return OA;case 92:if(gA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return SA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),dA;break;case 123:return IA;case 125:return pA;case 117:case 85:o=this.peekCodePoint(0),i=this.peekCodePoint(1);return 43!==o||!QA(i)&&63!==i||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),HA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fA;break;case-1:return vA}return cA(A)?(this.consumeWhiteSpace(),TA):iA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):aA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:w(A)}},NA.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},NA.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},NA.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},NA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();QA(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)return{type:30,start:parseInt(w.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(w.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var B=parseInt(w.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&QA(this.peekCodePoint(1))){this.consumeCodePoint();for(var e=this.consumeCodePoint(),r=[];QA(e)&&r.length<6;)r.push(e),e=this.consumeCodePoint();return{type:30,start:B,end:parseInt(w.apply(void 0,r),16)}}return{type:30,start:B,end:B}},NA.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:19,value:A}):{type:20,value:A}},NA.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:22,value:""};var e,t=this.peekCodePoint(0);if(39===t||34===t){t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),KA)}for(;;){var B=this.consumeCodePoint();if(-1===B||41===B)return{type:22,value:w.apply(void 0,A)};if(cA(B))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:w.apply(void 0,A)}):(this.consumeBadUrlRemnants(),KA);if(34===B||39===B||40===B||(0<=(e=B)&&e<=8||11===e||14<=e&&e<=31||127===e))return this.consumeBadUrlRemnants(),KA;if(92===B){if(!gA(B,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),KA;A.push(this.consumeEscapedCodePoint())}else A.push(B)}},NA.prototype.consumeWhiteSpace=function(){for(;cA(this.peekCodePoint(0));)this.consumeCodePoint()},NA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;gA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},NA.prototype.consumeStringSlice=function(A){for(var e="";0<A;){var t=Math.min(6e4,A);e+=w.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},NA.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var B,r=this._value[t];if(-1===r||void 0===r||r===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),LA;92!==r||-1!==(B=this._value[t+1])&&void 0!==B&&(10===B?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):gA(r,B)&&(e+=this.consumeStringSlice(t),e+=w(this.consumeEscapedCodePoint()),t=-1)),t++}},NA.prototype.consumeNumber=function(){var A=[],e=4;for(43!==(t=this.peekCodePoint(0))&&45!==t||A.push(this.consumeCodePoint());iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());var t=this.peekCodePoint(0),B=this.peekCodePoint(1);if(46===t&&iA(B))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var B=this.peekCodePoint(1),r=this.peekCodePoint(2);if((69===t||101===t)&&((43===B||45===B)&&iA(r)||iA(B)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[function(A){var e=0,t=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(t=-1),e++);for(var B=[];iA(A[e]);)B.push(A[e++]);var r=B.length?parseInt(w.apply(void 0,B),10):0;46===A[e]&&e++;for(var n=[];iA(A[e]);)n.push(A[e++]);var s=n.length,o=s?parseInt(w.apply(void 0,n),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(i=-1),e++);for(var Q=[];iA(A[e]);)Q.push(A[e++]);var c=Q.length?parseInt(w.apply(void 0,Q),10):0;return t*(r+o*Math.pow(10,-s))*Math.pow(10,i*c)}(A),e]},NA.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],B=this.peekCodePoint(0),r=this.peekCodePoint(1),A=this.peekCodePoint(2);return CA(B,r,A)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===B?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},NA.prototype.consumeEscapedCodePoint=function(){var A,e=this.consumeCodePoint();if(QA(e)){for(var t=w(e);QA(this.peekCodePoint(0))&&t.length<6;)t+=w(this.consumeCodePoint());cA(this.peekCodePoint(0))&&this.consumeCodePoint();var B=parseInt(t,16);return 0===B||55296<=(A=B)&&A<=57343||1114111<B?65533:B}return-1===e?65533:e},NA.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(wA(e))A+=w(e);else{if(!gA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=w(this.consumeEscapedCodePoint())}}},NA);function NA(){this._value=[]}var GA=(xA.create=function(A){var e=new MA;return e.write(A),new xA(e.read())},xA.parseValue=function(A){return xA.create(A).parseComponentValue()},xA.parseValues=function(A){return xA.create(A).parseComponentValues()},xA.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);for(var e=this.consumeComponentValue();31===(A=this.consumeToken()).type;);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},xA.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},xA.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},xA.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||re(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},xA.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},xA.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?vA:A},xA.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},xA);function xA(A){this._tokens=A}function VA(A){return 15===A.type}function PA(A){return 17===A.type}function kA(A){return 20===A.type}function JA(A){return 0===A.type}function XA(A,e){return kA(A)&&A.value===e}function _A(A){return 31!==A.type}function YA(A){return 31!==A.type&&4!==A.type}function WA(A){var e=[],t=[];return A.forEach(function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)}),t.length&&e.push(t),e}function ZA(A){return 17===A.type||15===A.type}function qA(A){return 16===A.type||ZA(A)}function jA(A){return 1<A.length?[A[0],A[1]]:[A[0]]}function zA(A,e,t){var B=A[0],A=A[1];return[ie(B,e),ie(void 0!==A?A:B,t)]}function $A(A){return 15===A.type&&("deg"===A.unit||"grad"===A.unit||"rad"===A.unit||"turn"===A.unit)}function Ae(A){switch(A.filter(kA).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ne,ne];case"to top":case"bottom":return ce(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ne,oe];case"to right":case"left":return ce(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[oe,oe];case"to bottom":case"top":return ce(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[oe,ne];case"to left":case"right":return ce(270)}return 0}function ee(A){return 0==(255&A)}function te(A){var e=255&A,t=255&A>>8,B=255&A>>16,A=255&A>>24;return e<255?"rgba("+A+","+B+","+t+","+e/255+")":"rgb("+A+","+B+","+t+")"}function Be(A,e){if(17===A.type)return A.number;if(16!==A.type)return 0;var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}var re=function(A,e){return 11===e&&12===A.type||(28===e&&29===A.type||2===e&&3===A.type)},ne={type:17,number:0,flags:4},se={type:16,number:50,flags:4},oe={type:16,number:100,flags:4},ie=function(A,e){if(16===A.type)return A.number/100*e;if(VA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Qe=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return Math.PI*A/180},ae=function(A,e){if(18===e.type){var t=ue[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var B=e.value.substring(0,1),r=e.value.substring(1,2),n=e.value.substring(2,3);return we(parseInt(B+B,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===e.value.length){var B=e.value.substring(0,1),r=e.value.substring(1,2),n=e.value.substring(2,3),s=e.value.substring(3,4);return we(parseInt(B+B,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(6===e.value.length){B=e.value.substring(0,2),r=e.value.substring(2,4),n=e.value.substring(4,6);return we(parseInt(B,16),parseInt(r,16),parseInt(n,16),1)}if(8===e.value.length){B=e.value.substring(0,2),r=e.value.substring(2,4),n=e.value.substring(4,6),s=e.value.substring(6,8);return we(parseInt(B,16),parseInt(r,16),parseInt(n,16),parseInt(s,16)/255)}}if(20===e.type){e=he[e.value.toUpperCase()];if(void 0!==e)return e}return he.TRANSPARENT},we=function(A,e,t,B){return(A<<24|e<<16|t<<8|Math.round(255*B)<<0)>>>0},ge=function(A,e){e=e.filter(YA);if(3===e.length){var t=e.map(Be),B=t[0],r=t[1],t=t[2];return we(B,r,t,1)}if(4!==e.length)return 0;e=e.map(Be),B=e[0],r=e[1],t=e[2],e=e[3];return we(B,r,t,e)};function Ce(A,e,t){return t<0&&(t+=1),1<=t&&--t,t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function Ue(A,e){return ae(A,GA.create(e).parseComponentValue())}var Fe,le=function(A,e){var t=e.filter(YA),B=t[0],r=t[1],n=t[2],e=t[3],t=(17===B.type?ce(B.number):Qe(A,B))/(2*Math.PI),A=qA(r)?r.number/100:0,B=qA(n)?n.number/100:0,r=void 0!==e&&qA(e)?ie(e,1):1;if(0==A)return we(255*B,255*B,255*B,1);n=B<=.5?B*(1+A):B+A-B*A,e=2*B-n,A=Ce(e,n,t+1/3),B=Ce(e,n,t),t=Ce(e,n,t-1/3);return we(255*A,255*B,255*t,r)},ue={hsl:le,hsla:le,rgb:ge,rgba:ge},he={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};(ve=Fe=Fe||{})[ve.BORDER_BOX=0]="BORDER_BOX",ve[ve.PADDING_BOX=1]="PADDING_BOX";function de(A,e){return A=ae(A,e[0]),(e=e[1])&&qA(e)?{color:A,stop:e}:{color:A,stop:null}}function Ee(A,t){var e=A[0],B=A[A.length-1];null===e.stop&&(e.stop=ne),null===B.stop&&(B.stop=oe);for(var r=[],n=0,s=0;s<A.length;s++){var o=A[s].stop;null!==o?(n<(o=ie(o,t))?r.push(o):r.push(n),n=o):r.push(null)}for(var i=null,s=0;s<r.length;s++){var Q=r[s];if(null===Q)null===i&&(i=s);else if(null!==i){for(var c=s-i,a=(Q-r[i-1])/(1+c),w=1;w<=c;w++)r[i+w-1]=a*w;i=null}}return A.map(function(A,e){return{color:A.color,stop:Math.max(Math.min(1,r[e]/t),0)}})}function He(A,e,t){var B="number"==typeof A?A:(s=e/2,B=(n=t)/2,s=ie((r=A)[0],e)-s,n=B-ie(r[1],n),(Math.atan2(n,s)+2*Math.PI)%(2*Math.PI)),r=Math.abs(e*Math.sin(B))+Math.abs(t*Math.cos(B)),n=e/2,s=t/2,e=r/2,t=Math.sin(B-Math.PI/2)*e,e=Math.cos(B-Math.PI/2)*e;return[r,n-e,n+e,s-t,s+t]}function fe(A,e){return Math.sqrt(A*A+e*e)}function Ie(A,e,r,n,s){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var t=e[0],B=e[1],B=fe(r-t,n-B);return(s?B<A.optimumDistance:B>A.optimumDistance)?{optimumCorner:e,optimumDistance:B}:A},{optimumDistance:s?1/0:-1/0,optimumCorner:null}).optimumCorner}var pe,ye={name:"background-clip",initialValue:"border-box",prefix:!(ve[ve.CONTENT_BOX=2]="CONTENT_BOX"),type:1,parse:function(A,e){return e.map(function(A){if(kA(A))switch(A.value){case"padding-box":return Fe.PADDING_BOX;case"content-box":return Fe.CONTENT_BOX}return Fe.BORDER_BOX})}},Ke={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},le=function(t,A){var B=ce(180),r=[];return WA(A).forEach(function(A,e){if(0===e){e=A[0];if(20===e.type&&-1!==["top","left","right","bottom"].indexOf(e.value))return void(B=Ae(A));if($A(e))return void(B=(Qe(t,e)+ce(270))%ce(360))}A=de(t,A);r.push(A)}),{angle:B,stops:r,type:pe.LINEAR_GRADIENT}},Le="closest-side",me="farthest-side",De="closest-corner",be="farthest-corner",Re="ellipse",Oe="contain",ge=function(B,A){var r=Se.CIRCLE,n=Te.FARTHEST_CORNER,s=[],o=[];return WA(A).forEach(function(A,e){var t=!0;0===e?t=A.reduce(function(A,e){if(kA(e))switch(e.value){case"center":return o.push(se),!1;case"top":case"left":return o.push(ne),!1;case"right":case"bottom":return o.push(oe),!1}else if(qA(e)||ZA(e))return o.push(e),!1;return A},t):1===e&&(t=A.reduce(function(A,e){if(kA(e))switch(e.value){case"circle":return r=Se.CIRCLE,!1;case Re:return r=Se.ELLIPSE,!1;case Oe:case Le:return n=Te.CLOSEST_SIDE,!1;case me:return n=Te.FARTHEST_SIDE,!1;case De:return n=Te.CLOSEST_CORNER,!1;case"cover":case be:return n=Te.FARTHEST_CORNER,!1}else if(ZA(e)||qA(e))return(n=!Array.isArray(n)?[]:n).push(e),!1;return A},t)),t&&(A=de(B,A),s.push(A))}),{size:n,shape:r,stops:s,position:o,type:pe.RADIAL_GRADIENT}};(ve=pe=pe||{})[ve.URL=0]="URL",ve[ve.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",ve[ve.RADIAL_GRADIENT=2]="RADIAL_GRADIENT";var Se,Te,ve;(ve=Se=Se||{})[ve.CIRCLE=0]="CIRCLE",ve[ve.ELLIPSE=1]="ELLIPSE",(ve=Te=Te||{})[ve.CLOSEST_SIDE=0]="CLOSEST_SIDE",ve[ve.FARTHEST_SIDE=1]="FARTHEST_SIDE",ve[ve.CLOSEST_CORNER=2]="CLOSEST_CORNER",ve[ve.FARTHEST_CORNER=3]="FARTHEST_CORNER";var Me=function(A,e){if(22===e.type){var t={url:e.value,type:pe.URL};return A.cache.addImage(e.value),t}if(18!==e.type)throw new Error("Unsupported image type "+e.type);t=Ge[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return t(A,e.values)};var Ne,Ge={"linear-gradient":function(t,A){var B=ce(180),r=[];return WA(A).forEach(function(A,e){if(0===e){e=A[0];if(20===e.type&&"to"===e.value)return void(B=Ae(A));if($A(e))return void(B=Qe(t,e))}A=de(t,A);r.push(A)}),{angle:B,stops:r,type:pe.LINEAR_GRADIENT}},"-moz-linear-gradient":le,"-ms-linear-gradient":le,"-o-linear-gradient":le,"-webkit-linear-gradient":le,"radial-gradient":function(r,A){var n=Se.CIRCLE,s=Te.FARTHEST_CORNER,o=[],i=[];return WA(A).forEach(function(A,e){var t,B=!0;0===e&&(t=!1,B=A.reduce(function(A,e){if(t)if(kA(e))switch(e.value){case"center":return i.push(se),A;case"top":case"left":return i.push(ne),A;case"right":case"bottom":return i.push(oe),A}else(qA(e)||ZA(e))&&i.push(e);else if(kA(e))switch(e.value){case"circle":return n=Se.CIRCLE,!1;case Re:return n=Se.ELLIPSE,!1;case"at":return!(t=!0);case Le:return s=Te.CLOSEST_SIDE,!1;case"cover":case me:return s=Te.FARTHEST_SIDE,!1;case Oe:case De:return s=Te.CLOSEST_CORNER,!1;case be:return s=Te.FARTHEST_CORNER,!1}else if(ZA(e)||qA(e))return(s=!Array.isArray(s)?[]:s).push(e),!1;return A},B)),B&&(A=de(r,A),o.push(A))}),{size:s,shape:n,stops:o,position:i,type:pe.RADIAL_GRADIENT}},"-moz-radial-gradient":ge,"-ms-radial-gradient":ge,"-o-radial-gradient":ge,"-webkit-radial-gradient":ge,"-webkit-gradient":function(B,A){var e=ce(180),r=[],n=pe.LINEAR_GRADIENT,t=Se.CIRCLE,s=Te.FARTHEST_CORNER;return WA(A).forEach(function(A,e){var t,A=A[0];if(0===e){if(kA(A)&&"linear"===A.value)return void(n=pe.LINEAR_GRADIENT);if(kA(A)&&"radial"===A.value)return void(n=pe.RADIAL_GRADIENT)}18===A.type&&("from"===A.name?(t=ae(B,A.values[0]),r.push({stop:ne,color:t})):"to"===A.name?(t=ae(B,A.values[0]),r.push({stop:oe,color:t})):"color-stop"!==A.name||2===(A=A.values.filter(YA)).length&&(t=ae(B,A[1]),A=A[0],PA(A)&&r.push({stop:{type:16,number:100*A.number,flags:A.flags},color:t})))}),n===pe.LINEAR_GRADIENT?{angle:(e+ce(180))%ce(360),stops:r,type:n}:{size:s,shape:t,stops:r,position:[],type:n}}},xe={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A.filter(function(A){return YA(A)&&!(20===(A=A).type&&"none"===A.value||18===A.type&&!Ge[A.name])}).map(function(A){return Me(e,A)})}},Ve={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(kA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Pe={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return WA(e).map(function(A){return A.filter(qA)}).map(jA)}};(ge=Ne=Ne||{})[ge.REPEAT=0]="REPEAT",ge[ge.NO_REPEAT=1]="NO_REPEAT",ge[ge.REPEAT_X=2]="REPEAT_X";var ke,Je={name:"background-repeat",initialValue:"repeat",prefix:!(ge[ge.REPEAT_Y=3]="REPEAT_Y"),type:1,parse:function(A,e){return WA(e).map(function(A){return A.filter(kA).map(function(A){return A.value}).join(" ")}).map(Xe)}},Xe=function(A){switch(A){case"no-repeat":return Ne.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return Ne.REPEAT_X;case"repeat-y":case"no-repeat repeat":return Ne.REPEAT_Y;default:return Ne.REPEAT}};(ge=ke=ke||{}).AUTO="auto",ge.CONTAIN="contain";var _e,Ye={name:"background-size",initialValue:"0",prefix:!(ge.COVER="cover"),type:1,parse:function(A,e){return WA(e).map(function(A){return A.filter(We)})}},We=function(A){return kA(A)||qA(A)},ge=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Ze=ge("top"),qe=ge("right"),je=ge("bottom"),ze=ge("left"),ge=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return jA(e.filter(qA))}}},$e=ge("top-left"),At=ge("top-right"),et=ge("bottom-right"),tt=ge("bottom-left");(ge=_e=_e||{})[ge.NONE=0]="NONE",ge[ge.SOLID=1]="SOLID",ge[ge.DASHED=2]="DASHED",ge[ge.DOTTED=3]="DOTTED",ge[ge.DOUBLE=4]="DOUBLE";var Bt,ge=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return _e.NONE;case"dashed":return _e.DASHED;case"dotted":return _e.DOTTED;case"double":return _e.DOUBLE}return _e.SOLID}}},rt=ge("top"),nt=ge("right"),st=ge("bottom"),ot=ge("left"),ge=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return VA(e)?e.number:0}}},it=ge("top"),Qt=ge("right"),ct=ge("bottom"),at=ge("left"),wt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},gt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"!==e?0:1}},Ct={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(kA).reduce(function(A,e){return A|Ut(e.value)},0)}},Ut=function(A){switch(A){case"block":case"-webkit-box":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};(ge=Bt=Bt||{})[ge.NONE=0]="NONE",ge[ge.LEFT=1]="LEFT",ge[ge.RIGHT=2]="RIGHT",ge[ge.INLINE_START=3]="INLINE_START";function Ft(A,e){return kA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:qA(A)?ie(A,e):e}var lt,ut,ht={name:"float",initialValue:"none",prefix:!(ge[ge.INLINE_END=4]="INLINE_END"),type:2,parse:function(A,e){switch(e){case"left":return Bt.LEFT;case"right":return Bt.RIGHT;case"inline-start":return Bt.INLINE_START;case"inline-end":return Bt.INLINE_END}return Bt.NONE}},dt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return!(20===e.type&&"normal"===e.value||17!==e.type&&15!==e.type)?e.number:0}},Et={name:"line-break",initialValue:(ge=lt=lt||{}).NORMAL="normal",prefix:!(ge.STRICT="strict"),type:2,parse:function(A,e){return"strict"!==e?lt.NORMAL:lt.STRICT}},Ht={name:"line-height",initialValue:"normal",prefix:!1,type:4},ft={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Me(A,e)}};(ge=ut=ut||{})[ge.INSIDE=0]="INSIDE";var It,pt={name:"list-style-position",initialValue:"outside",prefix:!(ge[ge.OUTSIDE=1]="OUTSIDE"),type:2,parse:function(A,e){return"inside"!==e?ut.OUTSIDE:ut.INSIDE}};(ge=It=It||{})[ge.NONE=-1]="NONE",ge[ge.DISC=0]="DISC",ge[ge.CIRCLE=1]="CIRCLE",ge[ge.SQUARE=2]="SQUARE",ge[ge.DECIMAL=3]="DECIMAL",ge[ge.CJK_DECIMAL=4]="CJK_DECIMAL",ge[ge.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",ge[ge.LOWER_ROMAN=6]="LOWER_ROMAN",ge[ge.UPPER_ROMAN=7]="UPPER_ROMAN",ge[ge.LOWER_GREEK=8]="LOWER_GREEK",ge[ge.LOWER_ALPHA=9]="LOWER_ALPHA",ge[ge.UPPER_ALPHA=10]="UPPER_ALPHA",ge[ge.ARABIC_INDIC=11]="ARABIC_INDIC",ge[ge.ARMENIAN=12]="ARMENIAN",ge[ge.BENGALI=13]="BENGALI",ge[ge.CAMBODIAN=14]="CAMBODIAN",ge[ge.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",ge[ge.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",ge[ge.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",ge[ge.DEVANAGARI=18]="DEVANAGARI",ge[ge.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",ge[ge.GEORGIAN=20]="GEORGIAN",ge[ge.GUJARATI=21]="GUJARATI",ge[ge.GURMUKHI=22]="GURMUKHI",ge[ge.HEBREW=22]="HEBREW",ge[ge.HIRAGANA=23]="HIRAGANA",ge[ge.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",ge[ge.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",ge[ge.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",ge[ge.KANNADA=27]="KANNADA",ge[ge.KATAKANA=28]="KATAKANA",ge[ge.KATAKANA_IROHA=29]="KATAKANA_IROHA",ge[ge.KHMER=30]="KHMER",ge[ge.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",ge[ge.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",ge[ge.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",ge[ge.LAO=34]="LAO",ge[ge.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",ge[ge.MALAYALAM=36]="MALAYALAM",ge[ge.MONGOLIAN=37]="MONGOLIAN",ge[ge.MYANMAR=38]="MYANMAR",ge[ge.ORIYA=39]="ORIYA",ge[ge.PERSIAN=40]="PERSIAN",ge[ge.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",ge[ge.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",ge[ge.TAMIL=43]="TAMIL",ge[ge.TELUGU=44]="TELUGU",ge[ge.THAI=45]="THAI",ge[ge.TIBETAN=46]="TIBETAN",ge[ge.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",ge[ge.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",ge[ge.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",ge[ge.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN";var yt,Kt={name:"list-style-type",initialValue:"none",prefix:!(ge[ge.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"),type:2,parse:function(A,e){switch(e){case"disc":return It.DISC;case"circle":return It.CIRCLE;case"square":return It.SQUARE;case"decimal":return It.DECIMAL;case"cjk-decimal":return It.CJK_DECIMAL;case"decimal-leading-zero":return It.DECIMAL_LEADING_ZERO;case"lower-roman":return It.LOWER_ROMAN;case"upper-roman":return It.UPPER_ROMAN;case"lower-greek":return It.LOWER_GREEK;case"lower-alpha":return It.LOWER_ALPHA;case"upper-alpha":return It.UPPER_ALPHA;case"arabic-indic":return It.ARABIC_INDIC;case"armenian":return It.ARMENIAN;case"bengali":return It.BENGALI;case"cambodian":return It.CAMBODIAN;case"cjk-earthly-branch":return It.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return It.CJK_HEAVENLY_STEM;case"cjk-ideographic":return It.CJK_IDEOGRAPHIC;case"devanagari":return It.DEVANAGARI;case"ethiopic-numeric":return It.ETHIOPIC_NUMERIC;case"georgian":return It.GEORGIAN;case"gujarati":return It.GUJARATI;case"gurmukhi":return It.GURMUKHI;case"hebrew":return It.HEBREW;case"hiragana":return It.HIRAGANA;case"hiragana-iroha":return It.HIRAGANA_IROHA;case"japanese-formal":return It.JAPANESE_FORMAL;case"japanese-informal":return It.JAPANESE_INFORMAL;case"kannada":return It.KANNADA;case"katakana":return It.KATAKANA;case"katakana-iroha":return It.KATAKANA_IROHA;case"khmer":return It.KHMER;case"korean-hangul-formal":return It.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return It.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return It.KOREAN_HANJA_INFORMAL;case"lao":return It.LAO;case"lower-armenian":return It.LOWER_ARMENIAN;case"malayalam":return It.MALAYALAM;case"mongolian":return It.MONGOLIAN;case"myanmar":return It.MYANMAR;case"oriya":return It.ORIYA;case"persian":return It.PERSIAN;case"simp-chinese-formal":return It.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return It.SIMP_CHINESE_INFORMAL;case"tamil":return It.TAMIL;case"telugu":return It.TELUGU;case"thai":return It.THAI;case"tibetan":return It.TIBETAN;case"trad-chinese-formal":return It.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return It.TRAD_CHINESE_INFORMAL;case"upper-armenian":return It.UPPER_ARMENIAN;case"disclosure-open":return It.DISCLOSURE_OPEN;case"disclosure-closed":return It.DISCLOSURE_CLOSED;default:return It.NONE}}},ge=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},Lt=ge("top"),mt=ge("right"),Dt=ge("bottom"),bt=ge("left");(ge=yt=yt||{})[ge.VISIBLE=0]="VISIBLE",ge[ge.HIDDEN=1]="HIDDEN",ge[ge.SCROLL=2]="SCROLL";var Rt,Ot={name:"overflow",initialValue:"visible",prefix:!(ge[ge.AUTO=3]="AUTO"),type:1,parse:function(A,e){return e.filter(kA).map(function(A){switch(A.value){case"hidden":return yt.HIDDEN;case"scroll":return yt.SCROLL;case"auto":return yt.AUTO;default:return yt.VISIBLE}})}},St={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"!==e?"normal":"break-word"}},ge=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Tt=ge("top"),vt=ge("right"),Mt=ge("bottom"),Nt=ge("left");(ge=Rt=Rt||{})[ge.LEFT=0]="LEFT",ge[ge.CENTER=1]="CENTER";var Gt,xt={name:"text-align",initialValue:"left",prefix:!(ge[ge.RIGHT=2]="RIGHT"),type:2,parse:function(A,e){switch(e){case"right":return Rt.RIGHT;case"center":case"justify":return Rt.CENTER;default:return Rt.LEFT}}};(ge=Gt=Gt||{})[ge.STATIC=0]="STATIC",ge[ge.RELATIVE=1]="RELATIVE",ge[ge.ABSOLUTE=2]="ABSOLUTE",ge[ge.FIXED=3]="FIXED";var Vt,Pt={name:"position",initialValue:"static",prefix:!(ge[ge.STICKY=4]="STICKY"),type:2,parse:function(A,e){switch(e){case"relative":return Gt.RELATIVE;case"absolute":return Gt.ABSOLUTE;case"fixed":return Gt.FIXED;case"sticky":return Gt.STICKY}return Gt.STATIC}},kt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&XA(A[0],"none")?[]:WA(A).map(function(A){for(var e={color:he.TRANSPARENT,offsetX:ne,offsetY:ne,blur:ne},t=0,B=0;B<A.length;B++){var r=A[B];ZA(r)?(0===t?e.offsetX=r:1===t?e.offsetY=r:e.blur=r,t++):e.color=ae(n,r)}return e})}};(ge=Vt=Vt||{})[ge.NONE=0]="NONE",ge[ge.LOWERCASE=1]="LOWERCASE",ge[ge.UPPERCASE=2]="UPPERCASE";var Jt,Xt={name:"text-transform",initialValue:"none",prefix:!(ge[ge.CAPITALIZE=3]="CAPITALIZE"),type:2,parse:function(A,e){switch(e){case"uppercase":return Vt.UPPERCASE;case"lowercase":return Vt.LOWERCASE;case"capitalize":return Vt.CAPITALIZE}return Vt.NONE}},_t={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18!==e.type)return null;var t=Yt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}},Yt={matrix:function(A){A=A.filter(function(A){return 17===A.type}).map(function(A){return A.number});return 6===A.length?A:null},matrix3d:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number}),t=e[0],B=e[1];e[2],e[3];var r=e[4],n=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],A=e[13];return e[14],e[15],16===e.length?[t,B,r,n,s,A]:null}},ge={type:16,number:50,flags:4},Wt=[ge,ge],Zt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){e=e.filter(qA);return 2!==e.length?Wt:[e[0],e[1]]}};(ge=Jt=Jt||{})[ge.VISIBLE=0]="VISIBLE",ge[ge.HIDDEN=1]="HIDDEN";var qt,jt={name:"visible",initialValue:"none",prefix:!(ge[ge.COLLAPSE=2]="COLLAPSE"),type:2,parse:function(A,e){switch(e){case"hidden":return Jt.HIDDEN;case"collapse":return Jt.COLLAPSE;default:return Jt.VISIBLE}}};(ge=qt=qt||{}).NORMAL="normal",ge.BREAK_ALL="break-all";var zt,$t={name:"word-break",initialValue:"normal",prefix:!(ge.KEEP_ALL="keep-all"),type:2,parse:function(A,e){switch(e){case"break-all":return qt.BREAK_ALL;case"keep-all":return qt.KEEP_ALL;default:return qt.NORMAL}}},AB={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(PA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},eB=function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")},tB={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return PA(e)?e.number:1}},BB={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},rB={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(kA).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})}},nB={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],B=[];return e.forEach(function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:B.push(t.join(" ")),t.length=0}}),t.length&&B.push(t.join(" ")),B.map(function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"})}},sB={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},oB={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return PA(e)?e.number:!kA(e)||"bold"!==e.value?400:700}},iB={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(kA).map(function(A){return A.value})}};(ge=zt=zt||{}).NORMAL="normal",ge.ITALIC="italic";function QB(A,e){return 0!=(A&e)}function cB(A,e,t){return(A=A&&A[Math.min(e,A.length-1)])?t?A.open:A.close:""}var aB,wB={name:"font-style",initialValue:"normal",prefix:!(ge.OBLIQUE="oblique"),type:2,parse:function(A,e){switch(e){case"oblique":return zt.OBLIQUE;case"italic":return zt.ITALIC;default:return zt.NORMAL}}},gB={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},CB={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var B=[],r=e.filter(_A),n=0;n<r.length;n++){var s=r[n],o=r[n+1];20===s.type&&(o=o&&PA(o)?o.number:1,B.push({counter:s.value,increment:o}))}return B}},UB={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],B=e.filter(_A),r=0;r<B.length;r++){var n=B[r],s=B[r+1];kA(n)&&"none"!==n.value&&(s=s&&PA(s)?s.number:0,t.push({counter:n.value,reset:s}))}return t}},FB={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,A){return A.filter(VA).map(function(A){return eB(e,A)})}},lB={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var B=[],r=e.filter(JA);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var s=r[n].value,o=r[n+1].value;B.push({open:s,close:o})}return B}},uB={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&XA(A[0],"none")?[]:WA(A).map(function(A){for(var e={color:255,offsetX:ne,offsetY:ne,blur:ne,spread:ne,inset:!1},t=0,B=0;B<A.length;B++){var r=A[B];XA(r,"inset")?e.inset=!0:ZA(r)?(0===t?e.offsetX=r:1===t?e.offsetY=r:2===t?e.blur=r:e.spread=r,t++):e.color=ae(n,r)}return e})}};(ge=aB=aB||{})[ge.FILL=0]="FILL",ge[ge.STROKE=1]="STROKE";var hB={name:"paint-order",initialValue:"normal",prefix:!(ge[ge.MARKERS=2]="MARKERS"),type:1,parse:function(A,e){var t=[aB.FILL,aB.STROKE,aB.MARKERS],B=[];return e.filter(kA).forEach(function(A){switch(A.value){case"stroke":B.push(aB.STROKE);break;case"fill":B.push(aB.FILL);break;case"markers":B.push(aB.MARKERS)}}),t.forEach(function(A){-1===B.indexOf(A)&&B.push(A)}),B}},dB={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},EB={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return VA(e)?e.number:0}},HB=(fB.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&this.visibility===Jt.VISIBLE},fB.prototype.isTransparent=function(){return ee(this.backgroundColor)},fB.prototype.isTransformed=function(){return null!==this.transform},fB.prototype.isPositioned=function(){return this.position!==Gt.STATIC},fB.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},fB.prototype.isFloating=function(){return this.float!==Bt.NONE},fB.prototype.isInlineLevel=function(){return QB(this.display,4)||QB(this.display,33554432)||QB(this.display,268435456)||QB(this.display,536870912)||QB(this.display,67108864)||QB(this.display,134217728)},fB);function fB(A,e){this.animationDuration=yB(A,FB,e.animationDuration),this.backgroundClip=yB(A,ye,e.backgroundClip),this.backgroundColor=yB(A,Ke,e.backgroundColor),this.backgroundImage=yB(A,xe,e.backgroundImage),this.backgroundOrigin=yB(A,Ve,e.backgroundOrigin),this.backgroundPosition=yB(A,Pe,e.backgroundPosition),this.backgroundRepeat=yB(A,Je,e.backgroundRepeat),this.backgroundSize=yB(A,Ye,e.backgroundSize),this.borderTopColor=yB(A,Ze,e.borderTopColor),this.borderRightColor=yB(A,qe,e.borderRightColor),this.borderBottomColor=yB(A,je,e.borderBottomColor),this.borderLeftColor=yB(A,ze,e.borderLeftColor),this.borderTopLeftRadius=yB(A,$e,e.borderTopLeftRadius),this.borderTopRightRadius=yB(A,At,e.borderTopRightRadius),this.borderBottomRightRadius=yB(A,et,e.borderBottomRightRadius),this.borderBottomLeftRadius=yB(A,tt,e.borderBottomLeftRadius),this.borderTopStyle=yB(A,rt,e.borderTopStyle),this.borderRightStyle=yB(A,nt,e.borderRightStyle),this.borderBottomStyle=yB(A,st,e.borderBottomStyle),this.borderLeftStyle=yB(A,ot,e.borderLeftStyle),this.borderTopWidth=yB(A,it,e.borderTopWidth),this.borderRightWidth=yB(A,Qt,e.borderRightWidth),this.borderBottomWidth=yB(A,ct,e.borderBottomWidth),this.borderLeftWidth=yB(A,at,e.borderLeftWidth),this.boxShadow=yB(A,uB,e.boxShadow),this.color=yB(A,wt,e.color),this.direction=yB(A,gt,e.direction),this.display=yB(A,Ct,e.display),this.float=yB(A,ht,e.cssFloat),this.fontFamily=yB(A,nB,e.fontFamily),this.fontSize=yB(A,sB,e.fontSize),this.fontStyle=yB(A,wB,e.fontStyle),this.fontVariant=yB(A,iB,e.fontVariant),this.fontWeight=yB(A,oB,e.fontWeight),this.letterSpacing=yB(A,dt,e.letterSpacing),this.lineBreak=yB(A,Et,e.lineBreak),this.lineHeight=yB(A,Ht,e.lineHeight),this.listStyleImage=yB(A,ft,e.listStyleImage),this.listStylePosition=yB(A,pt,e.listStylePosition),this.listStyleType=yB(A,Kt,e.listStyleType),this.marginTop=yB(A,Lt,e.marginTop),this.marginRight=yB(A,mt,e.marginRight),this.marginBottom=yB(A,Dt,e.marginBottom),this.marginLeft=yB(A,bt,e.marginLeft),this.opacity=yB(A,tB,e.opacity);var t=yB(A,Ot,e.overflow);this.overflowX=t[0],this.overflowY=t[1<t.length?1:0],this.overflowWrap=yB(A,St,e.overflowWrap),this.paddingTop=yB(A,Tt,e.paddingTop),this.paddingRight=yB(A,vt,e.paddingRight),this.paddingBottom=yB(A,Mt,e.paddingBottom),this.paddingLeft=yB(A,Nt,e.paddingLeft),this.paintOrder=yB(A,hB,e.paintOrder),this.position=yB(A,Pt,e.position),this.textAlign=yB(A,xt,e.textAlign),this.textDecorationColor=yB(A,BB,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=yB(A,rB,null!==(t=e.textDecorationLine)&&void 0!==t?t:e.textDecoration),this.textShadow=yB(A,kt,e.textShadow),this.textTransform=yB(A,Xt,e.textTransform),this.transform=yB(A,_t,e.transform),this.transformOrigin=yB(A,Zt,e.transformOrigin),this.transitionDuration=yB(A,FB,e.transitionDuration),this.visibility=yB(A,jt,e.visibility),this.webkitTextStrokeColor=yB(A,dB,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=yB(A,EB,e.webkitTextStrokeWidth),this.wordBreak=yB(A,$t,e.wordBreak),this.zIndex=yB(A,AB,e.zIndex)}for(var IB=function(A,e){this.content=yB(A,gB,e.content),this.quotes=yB(A,lB,e.quotes)},pB=function(A,e){this.counterIncrement=yB(A,CB,e.counterIncrement),this.counterReset=yB(A,UB,e.counterReset)},yB=function(A,e,t){var B=new MA,t=null!=t?t.toString():e.initialValue;B.write(t);var r=new GA(B.read());switch(e.type){case 2:var n=r.parseComponentValue();return e.parse(A,kA(n)?n.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return Qe(A,r.parseComponentValue());case"color":return ae(A,r.parseComponentValue());case"image":return Me(A,r.parseComponentValue());case"length":var s=r.parseComponentValue();return ZA(s)?s:ne;case"length-percentage":s=r.parseComponentValue();return qA(s)?s:ne;case"time":return eB(A,r.parseComponentValue())}}},KB=function(A,e){this.context=A,this.styles=new HB(A,window.getComputedStyle(e,null)),this.textNodes=[],this.elements=[],An(e)&&(this.styles.animationDuration.some(function(A){return 0<A})&&(e.style.animationDuration="0s"),this.styles.transitionDuration.some(function(A){return 0<A})&&(e.style.transitionDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=E(this.context,e),this.flags=0},LB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mB="undefined"==typeof Uint8Array?[]:new Uint8Array(256),DB=0;DB<LB.length;DB++)mB[LB.charCodeAt(DB)]=DB;function bB(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var RB=(OB.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},OB);function OB(A,e,t,B,r,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=B,this.index=r,this.data=n}for(var SB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",TB="undefined"==typeof Uint8Array?[]:new Uint8Array(256),vB=0;vB<SB.length;vB++)TB[SB.charCodeAt(vB)]=vB;function MB(A){return jB.get(A)}function NB(A){var t=function(A){for(var e=[],t=0,B=A.length;t<B;){var r,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<B?56320==(64512&(r=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),t--):e.push(n)}return e}(A),B=t.length,r=0,n=0,s=t.map(MB);return{next:function(){if(B<=r)return{done:!0,value:null};for(var A=zB;r<B&&(A=function(A,e){var t=e-2,B=A[t],r=A[e-1],e=A[e];if(2===r&&3===e)return zB;if(2===r||3===r||4===r)return"÷";if(2===e||3===e||4===e)return"÷";if(r===YB&&-1!==[YB,WB,ZB,qB].indexOf(e))return zB;if(!(r!==ZB&&r!==WB||e!==WB&&10!==e))return zB;if((r===qB||10===r)&&10===e)return zB;if(13===e||5===e)return zB;if(7===e)return zB;if(1===r)return zB;if(13===r&&14===e){for(;5===B;)B=A[--t];if(14===B)return zB}if(15===r&&15===e){for(var n=0;15===B;)n++,B=A[--t];if(n%2==0)return zB}return"÷"}(s,++r))===zB;);if(A===zB&&r!==B)return{done:!0,value:null};var e=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 B=[],r=-1,n="";++r<t;){var s=A[r];s<=65535?B.push(s):(s-=65536,B.push(55296+(s>>10),s%1024+56320)),(r+1===t||16384<B.length)&&(n+=String.fromCharCode.apply(String,B),B.length=0)}return n}.apply(null,t.slice(n,r));return n=r,{value:e,done:!1}}}}function GB(A){for(var e,t=NB(A),B=[];!(e=t.next()).done;)e.value&&B.push(e.value.slice());return B}function xB(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var VB,PB,kB,JB,XB,_B,YB=8,WB=9,ZB=11,qB=12,jB=(kB=function(A){var e,t,B,r,n=.75*A.length,s=A.length,o=0;"="===A[A.length-1]&&(n--,"="===A[A.length-2]&&n--);for(var n=new("undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n),i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=mB[A.charCodeAt(Q)],t=mB[A.charCodeAt(Q+1)],B=mB[A.charCodeAt(Q+2)],r=mB[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|B>>2,i[o++]=(3&B)<<6|63&r;return n}(VB=" "),JB=Array.isArray(kB)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=4)t.push(A[B+3]<<24|A[B+2]<<16|A[B+1]<<8|A[B]);return t}(kB):new Uint32Array(kB),XB=Array.isArray(kB)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=2)t.push(A[B+1]<<8|A[B]);return t}(kB):new Uint16Array(kB),VB=bB(XB,12,JB[4]/2),PB=2===JB[5]?bB(XB,(24+JB[4])/2):(kB=JB,XB=Math.ceil((24+JB[4])/4),kB.slice?kB.slice(XB,PB):new Uint32Array(Array.prototype.slice.call(kB,XB,PB))),new RB(JB[0],JB[1],JB[2],JB[3],VB,PB)),zB="×",$B=function(A,e,t,B,r){var n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),n=document.createElementNS(n,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width","100%"),n.setAttributeNS(null,"height","100%"),n.setAttributeNS(null,"x",t.toString()),n.setAttributeNS(null,"y",B.toString()),n.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(n),n.appendChild(r),s},Ar=function(B){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(B))})},er={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);e=e.getBoundingClientRect(),e=Math.round(e.height);if(A.body.removeChild(t),123===e)return!0}}return!1}(document);return Object.defineProperty(er,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=er.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var B=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var r=e.firstChild,t=Q(r.data).map(function(A){return w(A)}),n=0,s={},t=t.every(function(A,e){B.setStart(r,n),B.setEnd(r,n+A.length);var t=B.getBoundingClientRect();n+=A.length;A=t.x>s.x||t.y>s.y;return s=t,0===e||A});return A.body.removeChild(e),t}(document);return Object.defineProperty(er,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),A=t.getContext("2d");if(!A)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{A.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(er,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(t){var A=t.createElement("canvas"),B=100;A.width=B,A.height=B;var r=A.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,B,B);var e=new Image,n=A.toDataURL();e.src=n;e=$B(B,B,0,0,e);return r.fillStyle="red",r.fillRect(0,0,B,B),Ar(e).then(function(A){r.drawImage(A,0,0);var e=r.getImageData(0,0,B,B).data;r.fillStyle="red",r.fillRect(0,0,B,B);A=t.createElement("div");return A.style.backgroundImage="url("+n+")",A.style.height="100px",xB(e)?Ar($B(B,B,0,0,A)):Promise.reject(!1)}).then(function(A){return r.drawImage(A,0,0),xB(r.getImageData(0,0,B,B).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(er,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(er,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(er,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(er,"SUPPORT_CORS_XHR",{value:A}),A}},tr=function(A,e){this.text=A,this.bounds=e},Br=function(A,e){var t=e.ownerDocument;if(t){var B=t.createElement("html2canvaswrapper");B.appendChild(e.cloneNode(!0));t=e.parentNode;if(t){t.replaceChild(B,e);A=E(A,B);return B.firstChild&&t.replaceChild(B.firstChild,B),A}}return d.EMPTY},rr=function(A,e,t){var B=A.ownerDocument;if(!B)throw new Error("Node has no owner document");B=B.createRange();return B.setStart(A,e),B.setEnd(A,e+t),B},nr=function(A,e,t,B){return d.fromClientRect(A,rr(e,t,B).getBoundingClientRect())},sr=function(A,e){return 0!==e.letterSpacing?GB(A):ir(A,e)},or=[32,160,4961,65792,65793,4153,4241],ir=function(A,e){for(var t,B=oA(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),r=[];!(t=B.next()).done;)!function(){var A,e;t.value&&(A=t.value.slice(),A=Q(A),e="",A.forEach(function(A){-1===or.indexOf(A)?e+=w(A):(e.length&&r.push(e),r.push(w(A)),e="")}),e.length&&r.push(e))}();return r},Qr=function(A,e,t){var B,r,n,s,o;this.text=cr(e.data,t.textTransform),this.textBounds=(B=A,A=this.text,n=e,A=sr(A,r=t),s=[],o=0,A.forEach(function(A){var e;r.textDecorationLine.length||0<A.trim().length?er.SUPPORT_RANGE_BOUNDS?er.SUPPORT_WORD_BREAKING?s.push(new tr(A,nr(B,n,o,A.length))):s.push(new tr(A,d.fromDOMRectList(B,rr(n,o,A.length).getClientRects()))):(e=n.splitText(A.length),s.push(new tr(A,Br(B,n))),n=e):er.SUPPORT_RANGE_BOUNDS||(n=n.splitText(A.length)),o+=A.length}),s)},cr=function(A,e){switch(e){case Vt.LOWERCASE:return A.toLowerCase();case Vt.CAPITALIZE:return A.replace(ar,wr);case Vt.UPPERCASE:return A.toUpperCase();default:return A}},ar=/(^|\s|:|-|\(|\))([a-z])/g,wr=function(A,e,t){return 0<A.length?e+t.toUpperCase():A},gr=(A(Cr,_B=KB),Cr);function Cr(A,e){A=_B.call(this,A,e)||this;return A.src=e.currentSrc||e.src,A.intrinsicWidth=e.naturalWidth,A.intrinsicHeight=e.naturalHeight,A.context.cache.addImage(A.src),A}var Ur,Fr=(A(lr,Ur=KB),lr);function lr(A,e){A=Ur.call(this,A,e)||this;return A.canvas=e,A.intrinsicWidth=e.width,A.intrinsicHeight=e.height,A}var ur,hr=(A(dr,ur=KB),dr);function dr(A,e){var t=ur.call(this,A,e)||this,B=new XMLSerializer,A=E(A,e);return e.setAttribute("width",A.width+"px"),e.setAttribute("height",A.height+"px"),t.svg="data:image/svg+xml,"+encodeURIComponent(B.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,t.context.cache.addImage(t.svg),t}var Er,Hr=(A(fr,Er=KB),fr);function fr(A,e){A=Er.call(this,A,e)||this;return A.value=e.value,A}var Ir,pr=(A(yr,Ir=KB),yr);function yr(A,e){A=Ir.call(this,A,e)||this;return A.start=e.start,A.reversed="boolean"==typeof e.reversed&&!0===e.reversed,A}var Kr,Lr=[{type:15,flags:0,unit:"px",number:3}],mr=[{type:16,flags:0,number:50}],Dr="checkbox",br="radio",Rr="password",Or=707406591,Sr=(A(Tr,Kr=KB),Tr);function Tr(A,e){var t=Kr.call(this,A,e)||this;switch(t.type=e.type.toLowerCase(),t.checked=e.checked,t.value=0===(e=(A=e).type===Rr?new Array(A.value.length+1).join("•"):A.value).length?A.placeholder||"":e,t.type!==Dr&&t.type!==br||(t.styles.backgroundColor=3739148031,t.styles.borderTopColor=t.styles.borderRightColor=t.styles.borderBottomColor=t.styles.borderLeftColor=2779096575,t.styles.borderTopWidth=t.styles.borderRightWidth=t.styles.borderBottomWidth=t.styles.borderLeftWidth=1,t.styles.borderTopStyle=t.styles.borderRightStyle=t.styles.borderBottomStyle=t.styles.borderLeftStyle=_e.SOLID,t.styles.backgroundClip=[Fe.BORDER_BOX],t.styles.backgroundOrigin=[0],t.bounds=(e=t.bounds).width>e.height?new d(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new d(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e),t.type){case Dr:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=Lr;break;case br:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=mr}return t}var vr,Mr=(A(Nr,vr=KB),Nr);function Nr(A,e){A=vr.call(this,A,e)||this,e=e.options[e.selectedIndex||0];return A.value=e&&e.text||"",A}var Gr,xr=(A(Vr,Gr=KB),Vr);function Vr(A,e){A=Gr.call(this,A,e)||this;return A.value=e.value,A}var Pr,kr=(A(Jr,Pr=KB),Jr);function Jr(A,e){var t,B,r=Pr.call(this,A,e)||this;r.src=e.src,r.width=parseInt(e.width,10)||0,r.height=parseInt(e.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&(r.tree=Zr(A,e.contentWindow.document.documentElement),t=e.contentWindow.document.documentElement?Ue(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):he.TRANSPARENT,B=e.contentWindow.document.body?Ue(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):he.TRANSPARENT,r.backgroundColor=ee(t)?ee(B)?r.styles.backgroundColor:B:t)}catch(A){}return r}function Xr(A){return"STYLE"===A.tagName}var _r=["OL","UL","MENU"],Yr=function(e,A,t,B){for(var r=A.firstChild;r;r=s){var n,s=r.nextSibling;zr(r)&&0<r.data.trim().length?t.textNodes.push(new Qr(e,r,t.styles)):$r(r)&&(gn(r)&&r.assignedNodes?r.assignedNodes().forEach(function(A){return Yr(e,A,t,B)}):(n=Wr(e,r)).styles.isVisible()&&(qr(r,n,B)?n.flags|=4:jr(n.styles)&&(n.flags|=2),-1!==_r.indexOf(r.tagName)&&(n.flags|=8),t.elements.push(n),r.slot,r.shadowRoot?Yr(e,r.shadowRoot,n,B):an(r)||nn(r)||wn(r)||Yr(e,r,n,B)))}},Wr=function(A,e){return new(Qn(e)?gr:on(e)?Fr:nn(e)?hr:tn(e)?Hr:Bn(e)?pr:rn(e)?Sr:wn(e)?Mr:an(e)?xr:cn(e)?kr:KB)(A,e)},Zr=function(A,e){var t=Wr(A,e);return t.flags|=4,Yr(A,e,t,t),t},qr=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||sn(A)&&t.styles.isTransparent()},jr=function(A){return A.isPositioned()||A.isFloating()},zr=function(A){return A.nodeType===Node.TEXT_NODE},$r=function(A){return A.nodeType===Node.ELEMENT_NODE},An=function(A){return $r(A)&&void 0!==A.style&&!en(A)},en=function(A){return"object"==typeof A.className},tn=function(A){return"LI"===A.tagName},Bn=function(A){return"OL"===A.tagName},rn=function(A){return"INPUT"===A.tagName},nn=function(A){return"svg"===A.tagName},sn=function(A){return"BODY"===A.tagName},on=function(A){return"CANVAS"===A.tagName},Qn=function(A){return"IMG"===A.tagName},cn=function(A){return"IFRAME"===A.tagName},an=function(A){return"TEXTAREA"===A.tagName},wn=function(A){return"SELECT"===A.tagName},gn=function(A){return"SLOT"===A.tagName},Cn=(Un.prototype.getCounterValue=function(A){A=this.counters[A];return A&&A.length?A[A.length-1]:1},Un.prototype.getCounterValues=function(A){A=this.counters[A];return A||[]},Un.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},Un.prototype.parse=function(A){var t=this,e=A.counterIncrement,A=A.counterReset,B=!0;null!==e&&e.forEach(function(A){var e=t.counters[A.counter];e&&0!==A.increment&&(B=!1,e.length||e.push(1),e[Math.max(0,e.length-1)]+=A.increment)});var r=[];return B&&A.forEach(function(A){var e=t.counters[A.counter];r.push(A.counter),(e=e||(t.counters[A.counter]=[])).push(A.reset)}),r},Un);function Un(){this.counters={}}function Fn(B,A,e,r,t,n){return B<A||e<B?Kn(B,t,0<n.length):r.integers.reduce(function(A,e,t){for(;e<=B;)B-=e,A+=r.values[t];return A},"")+n}function ln(A,e,t,B){for(var r="";t||A--,r=B(A)+r,e<=(A/=e)*e;);return r}function un(A,e,t,B,r){var n=t-e+1;return(A<0?"-":"")+(ln(Math.abs(A),n,B,function(A){return w(Math.floor(A%n)+e)})+r)}function hn(A,e,t){void 0===t&&(t=". ");var B=e.length;return ln(Math.abs(A),B,!1,function(A){return e[Math.floor(A%B)]})+t}function dn(A,e,t,B,r,n){if(A<-9999||9999<A)return Kn(A,It.CJK_DECIMAL,0<r.length);var s=Math.abs(A),o=r;if(0===s)return e[0]+o;for(var i=0;0<s&&i<=4;i++){var Q=s%10;0==Q&&QB(n,1)&&""!==o?o=e[Q]+o:1<Q||1==Q&&0===i||1==Q&&1===i&&QB(n,2)||1==Q&&1===i&&QB(n,4)&&100<A||1==Q&&1<i&&QB(n,8)?o=e[Q]+(0<i?t[i-1]:"")+o:1==Q&&0<i&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?B:"")+o}var En,Hn={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"]},fn={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},In={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},pn={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},yn="마이너스",Kn=function(A,e,t){var B=t?". ":"",r=t?"、":"",n=t?", ":"",s=t?" ":"";switch(e){case It.DISC:return"•"+s;case It.CIRCLE:return"◦"+s;case It.SQUARE:return"◾"+s;case It.DECIMAL_LEADING_ZERO:var o=un(A,48,57,!0,B);return o.length<4?"0"+o:o;case It.CJK_DECIMAL:return hn(A,"〇一二三四五六七八九",r);case It.LOWER_ROMAN:return Fn(A,1,3999,Hn,It.DECIMAL,B).toLowerCase();case It.UPPER_ROMAN:return Fn(A,1,3999,Hn,It.DECIMAL,B);case It.LOWER_GREEK:return un(A,945,969,!1,B);case It.LOWER_ALPHA:return un(A,97,122,!1,B);case It.UPPER_ALPHA:return un(A,65,90,!1,B);case It.ARABIC_INDIC:return un(A,1632,1641,!0,B);case It.ARMENIAN:case It.UPPER_ARMENIAN:return Fn(A,1,9999,fn,It.DECIMAL,B);case It.LOWER_ARMENIAN:return Fn(A,1,9999,fn,It.DECIMAL,B).toLowerCase();case It.BENGALI:return un(A,2534,2543,!0,B);case It.CAMBODIAN:case It.KHMER:return un(A,6112,6121,!0,B);case It.CJK_EARTHLY_BRANCH:return hn(A,"子丑寅卯辰巳午未申酉戌亥",r);case It.CJK_HEAVENLY_STEM:return hn(A,"甲乙丙丁戊己庚辛壬癸",r);case It.CJK_IDEOGRAPHIC:case It.TRAD_CHINESE_INFORMAL:return dn(A,"零一二三四五六七八九","十百千萬","負",r,14);case It.TRAD_CHINESE_FORMAL:return dn(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",r,15);case It.SIMP_CHINESE_INFORMAL:return dn(A,"零一二三四五六七八九","十百千萬","负",r,14);case It.SIMP_CHINESE_FORMAL:return dn(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",r,15);case It.JAPANESE_INFORMAL:return dn(A,"〇一二三四五六七八九","十百千万","マイナス",r,0);case It.JAPANESE_FORMAL:return dn(A,"零壱弐参四伍六七八九","拾百千万","マイナス",r,7);case It.KOREAN_HANGUL_FORMAL:return dn(A,"영일이삼사오육칠팔구","십백천만",yn,n,7);case It.KOREAN_HANJA_INFORMAL:return dn(A,"零一二三四五六七八九","十百千萬",yn,n,0);case It.KOREAN_HANJA_FORMAL:return dn(A,"零壹貳參四五六七八九","拾百千",yn,n,7);case It.DEVANAGARI:return un(A,2406,2415,!0,B);case It.GEORGIAN:return Fn(A,1,19999,pn,It.DECIMAL,B);case It.GUJARATI:return un(A,2790,2799,!0,B);case It.GURMUKHI:return un(A,2662,2671,!0,B);case It.HEBREW:return Fn(A,1,10999,In,It.DECIMAL,B);case It.HIRAGANA:return hn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case It.HIRAGANA_IROHA:return hn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case It.KANNADA:return un(A,3302,3311,!0,B);case It.KATAKANA:return hn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case It.KATAKANA_IROHA:return hn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case It.LAO:return un(A,3792,3801,!0,B);case It.MONGOLIAN:return un(A,6160,6169,!0,B);case It.MYANMAR:return un(A,4160,4169,!0,B);case It.ORIYA:return un(A,2918,2927,!0,B);case It.PERSIAN:return un(A,1776,1785,!0,B);case It.TAMIL:return un(A,3046,3055,!0,B);case It.TELUGU:return un(A,3174,3183,!0,B);case It.THAI:return un(A,3664,3673,!0,B);case It.TIBETAN:return un(A,3872,3881,!0,B);default:It.DECIMAL;return un(A,48,57,!0,B)}},Ln="data-html2canvas-ignore",mn=(Dn.prototype.toIFrame=function(A,B){var e=this,r=Rn(A,B);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var t=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,s=r.contentWindow,o=s.document,A=Sn(r).then(function(){return a(e,void 0,void 0,function(){var e,t;return H(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(Gn),s&&(s.scrollTo(B.left,B.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===B.top&&s.scrollX===B.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-B.left,s.scrollY-B.top,0,0))),e=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:A.sent(),A.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,On(o)]:[3,4];case 3:A.sent(),A.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(o,t)}).then(function(){return r})]:[2,r]}})})});return o.open(),o.write(Mn(document.doctype)+"<html></html>"),Nn(this.referenceElement.ownerDocument,t,n),o.replaceChild(o.adoptNode(this.documentElement),o.documentElement),o.close(),A},Dn.prototype.createElementClone=function(A){if(on(A))return this.createCanvasClone(A);if(Xr(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Qn(e)&&(Qn(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),e},Dn.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},""),B=A.cloneNode(!1);return B.textContent=t,B}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},Dn.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){this.context.logger.info("Unable to clone canvas contents, canvas is tainted")}}e=A.cloneNode(!1);try{e.width=A.width,e.height=A.height;var t=A.getContext("2d"),B=e.getContext("2d");return B&&(!this.options.allowTaint&&t?B.putImageData(t.getImageData(0,0,A.width,A.height),0,0):B.drawImage(A,0,0)),e}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted")}return e},Dn.prototype.cloneNode=function(A){if(zr(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(e&&$r(A)&&(An(A)||en(A))){var t=this.createElementClone(A),B=e.getComputedStyle(A),r=e.getComputedStyle(A,":before"),n=e.getComputedStyle(A,":after");this.referenceElement===A&&An(t)&&(this.clonedReferenceElement=t),sn(t)&&kn(t);for(var e=this.counters.parse(new pB(this.context,B)),r=this.resolvePseudoContent(A,t,r,En.BEFORE),s=A.firstChild;s;s=s.nextSibling)$r(s)&&("SCRIPT"===s.tagName||s.hasAttribute(Ln)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(s))||this.options.copyStyles&&$r(s)&&Xr(s)||t.appendChild(this.cloneNode(s));r&&t.insertBefore(r,t.firstChild);n=this.resolvePseudoContent(A,t,n,En.AFTER);return n&&t.appendChild(n),this.counters.pop(e),B&&(this.options.copyStyles||en(A))&&!cn(A)&&vn(B,t),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([t,A.scrollLeft,A.scrollTop]),(an(A)||wn(A))&&(an(t)||wn(t))&&(t.value=A.value),t}return A.cloneNode(!1)},Dn.prototype.resolvePseudoContent=function(o,A,e,t){var i=this;if(e){var B=e.content,Q=A.ownerDocument;if(Q&&B&&"none"!==B&&"-moz-alt-content"!==B&&"none"!==e.display){this.counters.parse(new pB(this.context,e));var c=new IB(this.context,e),a=Q.createElement("html2canvaspseudoelement");vn(e,a),c.content.forEach(function(A){if(0===A.type)a.appendChild(Q.createTextNode(A.value));else if(22===A.type){var e=Q.createElement("img");e.src=A.value,e.style.opacity="1",a.appendChild(e)}else if(18===A.type){var t,B,r,n,s;"attr"===A.name?(e=A.values.filter(kA)).length&&a.appendChild(Q.createTextNode(o.getAttribute(e[0].value)||"")):"counter"===A.name?(r=(B=A.values.filter(YA))[0],B=B[1],r&&kA(r)&&(t=i.counters.getCounterValue(r.value),s=B&&kA(B)?Kt.parse(i.context,B.value):It.DECIMAL,a.appendChild(Q.createTextNode(Kn(t,s,!1))))):"counters"===A.name&&(r=(t=A.values.filter(YA))[0],s=t[1],B=t[2],r&&kA(r)&&(r=i.counters.getCounterValues(r.value),n=B&&kA(B)?Kt.parse(i.context,B.value):It.DECIMAL,s=s&&0===s.type?s.value:"",s=r.map(function(A){return Kn(A,n,!1)}).join(s),a.appendChild(Q.createTextNode(s))))}else if(20===A.type)switch(A.value){case"open-quote":a.appendChild(Q.createTextNode(cB(c.quotes,i.quoteDepth++,!0)));break;case"close-quote":a.appendChild(Q.createTextNode(cB(c.quotes,--i.quoteDepth,!1)));break;default:a.appendChild(Q.createTextNode(A.value))}}),a.className=xn+" "+Vn;t=t===En.BEFORE?" "+xn:" "+Vn;return en(A)?A.className.baseValue+=t:A.className+=t,a}}},Dn.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},Dn);function Dn(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Cn,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}(ge=En=En||{})[ge.BEFORE=0]="BEFORE",ge[ge.AFTER=1]="AFTER";function bn(e){return new Promise(function(A){!e.complete&&e.src?(e.onload=A,e.onerror=A):A()})}var Rn=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(Ln,"true"),A.body.appendChild(t),t},On=function(A){return Promise.all([].slice.call(A.images,0).map(bn))},Sn=function(r){return new Promise(function(e,A){var t=r.contentWindow;if(!t)return A("No window assigned for iframe");var B=t.document;t.onload=r.onload=function(){t.onload=r.onload=null;var A=setInterval(function(){0<B.body.childNodes.length&&"complete"===B.readyState&&(clearInterval(A),e(r))},50)}})},Tn=["all","d","content"],vn=function(A,e){for(var t=A.length-1;0<=t;t--){var B=A.item(t);-1===Tn.indexOf(B)&&e.style.setProperty(B,A.getPropertyValue(B))}return e},Mn=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},Nn=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Gn=function(A){var e=A[0],t=A[1],A=A[2];e.scrollLeft=t,e.scrollTop=A},xn="___html2canvas___pseudoelement_before",Vn="___html2canvas___pseudoelement_after",Pn='{\n    content: "" !important;\n    display: none !important;\n}',kn=function(A){Jn(A,"."+xn+":before"+Pn+"\n         ."+Vn+":after"+Pn)},Jn=function(A,e){var t=A.ownerDocument;t&&((t=t.createElement("style")).textContent=e,A.appendChild(t))},Xn=(_n.getOrigin=function(A){var e=_n._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},_n.isSameOrigin=function(A){return _n.getOrigin(A)===_n._origin},_n.setContext=function(A){_n._link=A.document.createElement("a"),_n._origin=_n.getOrigin(A.location.href)},_n._origin="about:blank",_n);function _n(){}var Yn=(Wn.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(ts(A)||$n(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},Wn.prototype.match=function(A){return this._cache[A]},Wn.prototype.loadImage=function(s){return a(this,void 0,void 0,function(){var e,B,t,r,n=this;return H(this,function(A){switch(A.label){case 0:return(e=Xn.isSameOrigin(s),B=!As(s)&&!0===this._options.useCORS&&er.SUPPORT_CORS_IMAGES&&!e,t=!As(s)&&!e&&!ts(s)&&"string"==typeof this._options.proxy&&er.SUPPORT_CORS_XHR&&!B,e||!1!==this._options.allowTaint||As(s)||ts(s)||t||B)?(r=s,t?[4,this.proxy(r)]:[3,2]):[2];case 1:r=A.sent(),A.label=2;case 2:return this.context.logger.debug("Added image "+s.substring(0,256)),[4,new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(es(r)||B)&&(t.crossOrigin="anonymous"),t.src=r,!0===t.complete&&setTimeout(function(){return A(t)},500),0<n._options.imageTimeout&&setTimeout(function(){return e("Timed out ("+n._options.imageTimeout+"ms) loading image")},n._options.imageTimeout)})];case 3:return[2,A.sent()]}})})},Wn.prototype.has=function(A){return void 0!==this._cache[A]},Wn.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Wn.prototype.proxy=function(s){var o=this,i=this._options.proxy;if(!i)throw new Error("No proxy defined");var Q=s.substring(0,256);return new Promise(function(e,t){var B=er.SUPPORT_RESPONSE_TYPE?"blob":"text",r=new XMLHttpRequest;r.onload=function(){var A;200===r.status?"text"==B?e(r.response):((A=new FileReader).addEventListener("load",function(){return e(A.result)},!1),A.addEventListener("error",function(A){return t(A)},!1),A.readAsDataURL(r.response)):t("Failed to proxy resource "+Q+" with status code "+r.status)},r.onerror=t;var A,n=-1<i.indexOf("?")?"&":"?";r.open("GET",i+n+"url="+encodeURIComponent(s)+"&responseType="+B),"text"!=B&&r instanceof XMLHttpRequest&&(r.responseType=B),o._options.imageTimeout&&(A=o._options.imageTimeout,r.timeout=A,r.ontimeout=function(){return t("Timed out ("+A+"ms) proxying "+Q)}),r.send()})},Wn);function Wn(A,e){this.context=A,this._options=e,this._cache={}}var Zn,qn=/^data:image\/svg\+xml/i,jn=/^data:image\/.*;base64,/i,zn=/^data:image\/.*/i,$n=function(A){return er.SUPPORT_SVG_DRAWING||!Bs(A)},As=function(A){return zn.test(A)},es=function(A){return jn.test(A)},ts=function(A){return"blob"===A.substr(0,4)},Bs=function(A){return"svg"===A.substr(-3).toLowerCase()||qn.test(A)};(ge=Zn=Zn||{})[ge.VECTOR=0]="VECTOR",ge[ge.BEZIER_CURVE=1]="BEZIER_CURVE";function rs(A,t){return A.length===t.length&&A.some(function(A,e){return A===t[e]})}var ns=(ss.prototype.add=function(A,e){return new ss(this.x+A,this.y+e)},ss);function ss(A,e){this.type=Zn.VECTOR,this.x=A,this.y=e}function os(A,e,t){return new ns(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var is=(Qs.prototype.subdivide=function(A,e){var t=os(this.start,this.startControl,A),B=os(this.startControl,this.endControl,A),r=os(this.endControl,this.end,A),n=os(t,B,A),B=os(B,r,A),A=os(n,B,A);return e?new Qs(this.start,t,n,A):new Qs(A,B,r,this.end)},Qs.prototype.add=function(A,e){return new Qs(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},Qs.prototype.reverse=function(){return new Qs(this.end,this.endControl,this.startControl,this.start)},Qs);function Qs(A,e,t,B){this.type=Zn.BEZIER_CURVE,this.start=A,this.startControl=e,this.endControl=t,this.end=B}function cs(A){return A.type===Zn.BEZIER_CURVE}var as,ws=function(A){var e=A.styles,t=A.bounds,B=(F=zA(e.borderTopLeftRadius,t.width,t.height))[0],r=F[1],n=(l=zA(e.borderTopRightRadius,t.width,t.height))[0],s=l[1],o=(u=zA(e.borderBottomRightRadius,t.width,t.height))[0],i=u[1],Q=(h=zA(e.borderBottomLeftRadius,t.width,t.height))[0],c=h[1];(d=[]).push((B+n)/t.width),d.push((Q+o)/t.width),d.push((r+c)/t.height),d.push((s+i)/t.height),1<(E=Math.max.apply(Math,d))&&(B/=E,r/=E,n/=E,s/=E,o/=E,i/=E,Q/=E,c/=E);var a=t.width-n,w=t.height-i,g=t.width-o,C=t.height-c,U=e.borderTopWidth,F=e.borderRightWidth,l=e.borderBottomWidth,u=e.borderLeftWidth,h=ie(e.paddingTop,A.bounds.width),d=ie(e.paddingRight,A.bounds.width),E=ie(e.paddingBottom,A.bounds.width),A=ie(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=0<B||0<r?Us(t.left+u/3,t.top+U/3,B-u/3,r-U/3,as.TOP_LEFT):new ns(t.left+u/3,t.top+U/3),this.topRightBorderDoubleOuterBox=0<B||0<r?Us(t.left+a,t.top+U/3,n-F/3,s-U/3,as.TOP_RIGHT):new ns(t.left+t.width-F/3,t.top+U/3),this.bottomRightBorderDoubleOuterBox=0<o||0<i?Us(t.left+g,t.top+w,o-F/3,i-l/3,as.BOTTOM_RIGHT):new ns(t.left+t.width-F/3,t.top+t.height-l/3),this.bottomLeftBorderDoubleOuterBox=0<Q||0<c?Us(t.left+u/3,t.top+C,Q-u/3,c-l/3,as.BOTTOM_LEFT):new ns(t.left+u/3,t.top+t.height-l/3),this.topLeftBorderDoubleInnerBox=0<B||0<r?Us(t.left+2*u/3,t.top+2*U/3,B-2*u/3,r-2*U/3,as.TOP_LEFT):new ns(t.left+2*u/3,t.top+2*U/3),this.topRightBorderDoubleInnerBox=0<B||0<r?Us(t.left+a,t.top+2*U/3,n-2*F/3,s-2*U/3,as.TOP_RIGHT):new ns(t.left+t.width-2*F/3,t.top+2*U/3),this.bottomRightBorderDoubleInnerBox=0<o||0<i?Us(t.left+g,t.top+w,o-2*F/3,i-2*l/3,as.BOTTOM_RIGHT):new ns(t.left+t.width-2*F/3,t.top+t.height-2*l/3),this.bottomLeftBorderDoubleInnerBox=0<Q||0<c?Us(t.left+2*u/3,t.top+C,Q-2*u/3,c-2*l/3,as.BOTTOM_LEFT):new ns(t.left+2*u/3,t.top+t.height-2*l/3),this.topLeftBorderStroke=0<B||0<r?Us(t.left+u/2,t.top+U/2,B-u/2,r-U/2,as.TOP_LEFT):new ns(t.left+u/2,t.top+U/2),this.topRightBorderStroke=0<B||0<r?Us(t.left+a,t.top+U/2,n-F/2,s-U/2,as.TOP_RIGHT):new ns(t.left+t.width-F/2,t.top+U/2),this.bottomRightBorderStroke=0<o||0<i?Us(t.left+g,t.top+w,o-F/2,i-l/2,as.BOTTOM_RIGHT):new ns(t.left+t.width-F/2,t.top+t.height-l/2),this.bottomLeftBorderStroke=0<Q||0<c?Us(t.left+u/2,t.top+C,Q-u/2,c-l/2,as.BOTTOM_LEFT):new ns(t.left+u/2,t.top+t.height-l/2),this.topLeftBorderBox=0<B||0<r?Us(t.left,t.top,B,r,as.TOP_LEFT):new ns(t.left,t.top),this.topRightBorderBox=0<n||0<s?Us(t.left+a,t.top,n,s,as.TOP_RIGHT):new ns(t.left+t.width,t.top),this.bottomRightBorderBox=0<o||0<i?Us(t.left+g,t.top+w,o,i,as.BOTTOM_RIGHT):new ns(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=0<Q||0<c?Us(t.left,t.top+C,Q,c,as.BOTTOM_LEFT):new ns(t.left,t.top+t.height),this.topLeftPaddingBox=0<B||0<r?Us(t.left+u,t.top+U,Math.max(0,B-u),Math.max(0,r-U),as.TOP_LEFT):new ns(t.left+u,t.top+U),this.topRightPaddingBox=0<n||0<s?Us(t.left+Math.min(a,t.width-F),t.top+U,a>t.width+F?0:Math.max(0,n-F),Math.max(0,s-U),as.TOP_RIGHT):new ns(t.left+t.width-F,t.top+U),this.bottomRightPaddingBox=0<o||0<i?Us(t.left+Math.min(g,t.width-u),t.top+Math.min(w,t.height-l),Math.max(0,o-F),Math.max(0,i-l),as.BOTTOM_RIGHT):new ns(t.left+t.width-F,t.top+t.height-l),this.bottomLeftPaddingBox=0<Q||0<c?Us(t.left+u,t.top+Math.min(C,t.height-l),Math.max(0,Q-u),Math.max(0,c-l),as.BOTTOM_LEFT):new ns(t.left+u,t.top+t.height-l),this.topLeftContentBox=0<B||0<r?Us(t.left+u+A,t.top+U+h,Math.max(0,B-(u+A)),Math.max(0,r-(U+h)),as.TOP_LEFT):new ns(t.left+u+A,t.top+U+h),this.topRightContentBox=0<n||0<s?Us(t.left+Math.min(a,t.width+u+A),t.top+U+h,a>t.width+u+A?0:n-u+A,s-(U+h),as.TOP_RIGHT):new ns(t.left+t.width-(F+d),t.top+U+h),this.bottomRightContentBox=0<o||0<i?Us(t.left+Math.min(g,t.width-(u+A)),t.top+Math.min(w,t.height+U+h),Math.max(0,o-(F+d)),i-(l+E),as.BOTTOM_RIGHT):new ns(t.left+t.width-(F+d),t.top+t.height-(l+E)),this.bottomLeftContentBox=0<Q||0<c?Us(t.left+u+A,t.top+C,Math.max(0,Q-(u+A)),c-(l+E),as.BOTTOM_LEFT):new ns(t.left+u+A,t.top+t.height-(l+E))};(ge=as=as||{})[ge.TOP_LEFT=0]="TOP_LEFT",ge[ge.TOP_RIGHT=1]="TOP_RIGHT",ge[ge.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",ge[ge.BOTTOM_LEFT=3]="BOTTOM_LEFT";function gs(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]}function Cs(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]}var Us=function(A,e,t,B,r){var n=(Math.sqrt(2)-1)/3*4,s=t*n,o=B*n,i=A+t,Q=e+B;switch(r){case as.TOP_LEFT:return new is(new ns(A,Q),new ns(A,Q-o),new ns(i-s,e),new ns(i,e));case as.TOP_RIGHT:return new is(new ns(A,e),new ns(A+s,e),new ns(i,Q-o),new ns(i,Q));case as.BOTTOM_RIGHT:return new is(new ns(i,e),new ns(i,e+o),new ns(A+s,Q),new ns(A,Q));default:as.BOTTOM_LEFT;return new is(new ns(i,Q),new ns(i-s,Q),new ns(A,e+o),new ns(A,e))}},Fs=function(A,e,t){this.type=0,this.target=6,this.offsetX=A,this.offsetY=e,this.matrix=t},ls=function(A,e){this.type=1,this.target=e,this.path=A},us=function(A){this.type=2,this.target=6,this.opacity=A},hs=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},ds=(Es.prototype.getParentEffects=function(){var A,e,t=this.effects.slice(0);return this.container.styles.overflowX!==yt.VISIBLE&&(A=gs(this.curves),e=Cs(this.curves),rs(A,e)||t.push(new ls(e,6))),t},Es);function Es(A,e){var t,B;this.container=A,this.effects=e.slice(0),this.curves=new ws(A),A.styles.opacity<1&&this.effects.push(new us(A.styles.opacity)),null!==A.styles.transform&&(t=A.bounds.left+A.styles.transformOrigin[0].number,e=A.bounds.top+A.styles.transformOrigin[1].number,B=A.styles.transform,this.effects.push(new Fs(t,e,B))),A.styles.overflowX!==yt.VISIBLE&&(B=gs(this.curves),A=Cs(this.curves),rs(B,A)?this.effects.push(new ls(B,6)):(this.effects.push(new ls(B,2)),this.effects.push(new ls(A,4))))}function Hs(A,e){switch(e){case 0:return bs(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return bs(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return bs(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return bs(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}function fs(A){var e=A.bounds,A=A.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))}function Is(A){var e=A.styles,t=A.bounds,B=ie(e.paddingLeft,t.width),r=ie(e.paddingRight,t.width),n=ie(e.paddingTop,t.width),A=ie(e.paddingBottom,t.width);return t.add(B+e.borderLeftWidth,n+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+B+r),-(e.borderTopWidth+e.borderBottomWidth+n+A))}function ps(A,e,t){var B=(r=Os(A.styles.backgroundOrigin,e),n=A,0===r?n.bounds:(2===r?Is:fs)(n)),r=(s=Os(A.styles.backgroundClip,e),o=A,s===Fe.BORDER_BOX?o.bounds:(s===Fe.CONTENT_BOX?Is:fs)(o)),n=Rs(Os(A.styles.backgroundSize,e),t,B),s=n[0],o=n[1],t=zA(Os(A.styles.backgroundPosition,e),B.width-s,B.height-o);return[Ss(Os(A.styles.backgroundRepeat,e),t,n,B,r),Math.round(B.left+t[0]),Math.round(B.top+t[1]),s,o]}function ys(A){return kA(A)&&A.value===ke.AUTO}function Ks(A){return"number"==typeof A}var Ls=function(Q,c,a,w){Q.container.elements.forEach(function(A){var e=QB(A.flags,4),t=QB(A.flags,2),B=new ds(A,Q.getParentEffects());QB(A.styles.display,2048)&&w.push(B);var r,n,s,o,i=QB(A.flags,8)?[]:w;e||t?(r=e||A.styles.isPositioned()?a:c,t=new hs(B),A.styles.isPositioned()||A.styles.opacity<1||A.styles.isTransformed()?(n=A.styles.zIndex.order)<0?(s=0,r.negativeZIndex.some(function(A,e){return n>A.element.container.styles.zIndex.order?(s=e,!1):0<s}),r.negativeZIndex.splice(s,0,t)):0<n?(o=0,r.positiveZIndex.some(function(A,e){return n>=A.element.container.styles.zIndex.order?(o=e+1,!1):0<o}),r.positiveZIndex.splice(o,0,t)):r.zeroOrAutoZIndexOrTransformedOrOpacity.push(t):(A.styles.isFloating()?r.nonPositionedFloats:r.nonPositionedInlineLevel).push(t),Ls(B,t,e?t:a,i)):((A.styles.isInlineLevel()?c.inlineLevel:c.nonInlineLevel).push(B),Ls(B,c,a,i)),QB(A.flags,8)&&ms(A,i)})},ms=function(A,e){for(var t=A instanceof pr?A.start:1,B=A instanceof pr&&A.reversed,r=0;r<e.length;r++){var n=e[r];n.container instanceof Hr&&"number"==typeof n.container.value&&0!==n.container.value&&(t=n.container.value),n.listValue=Kn(t,n.container.styles.listStyleType,!0),t+=B?-1:1}},Ds=function(A,e){var t=[];return cs(A)?t.push(A.subdivide(.5,!1)):t.push(A),cs(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},bs=function(A,e,t,B){var r=[];return cs(A)?r.push(A.subdivide(.5,!1)):r.push(A),cs(t)?r.push(t.subdivide(.5,!0)):r.push(t),cs(B)?r.push(B.subdivide(.5,!0).reverse()):r.push(B),cs(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r},Rs=function(A,e,t){var B=e[0],r=e[1],n=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(qA(s)&&o&&qA(o))return[ie(s,t.width),ie(o,t.height)];var i=Ks(n);if(kA(s)&&(s.value===ke.CONTAIN||s.value===ke.COVER))return Ks(n)?t.width/t.height<n!=(s.value===ke.COVER)?[t.width,t.width/n]:[t.height*n,t.height]:[t.width,t.height];var Q=Ks(B),e=Ks(r),A=Q||e;if(ys(s)&&(!o||ys(o)))return Q&&e?[B,r]:i||A?A&&i?[Q?B:r*n,e?r:B/n]:[Q?B:t.width,e?r:t.height]:[t.width,t.height];if(i){var c=0,a=0;return qA(s)?c=ie(s,t.width):qA(o)&&(a=ie(o,t.height)),ys(s)?c=a*n:o&&!ys(o)||(a=c/n),[c,a]}c=null,a=null;if(qA(s)?c=ie(s,t.width):o&&qA(o)&&(a=ie(o,t.height)),null!==(c=null!==(a=null!==c&&(!o||ys(o))?Q&&e?c/B*r:t.height:a)&&ys(s)?Q&&e?a/r*B:t.width:c)&&null!==a)return[c,a];throw new Error("Unable to calculate background-size for element")},Os=function(A,e){e=A[e];return void 0===e?A[0]:e},Ss=function(A,e,t,B,r){var n=e[0],s=e[1],o=t[0],i=t[1];switch(A){case Ne.REPEAT_X:return[new ns(Math.round(B.left),Math.round(B.top+s)),new ns(Math.round(B.left+B.width),Math.round(B.top+s)),new ns(Math.round(B.left+B.width),Math.round(i+B.top+s)),new ns(Math.round(B.left),Math.round(i+B.top+s))];case Ne.REPEAT_Y:return[new ns(Math.round(B.left+n),Math.round(B.top)),new ns(Math.round(B.left+n+o),Math.round(B.top)),new ns(Math.round(B.left+n+o),Math.round(B.height+B.top)),new ns(Math.round(B.left+n),Math.round(B.height+B.top))];case Ne.NO_REPEAT:return[new ns(Math.round(B.left+n),Math.round(B.top+s)),new ns(Math.round(B.left+n+o),Math.round(B.top+s)),new ns(Math.round(B.left+n+o),Math.round(B.top+s+i)),new ns(Math.round(B.left+n),Math.round(B.top+s+i))];default:return[new ns(Math.round(r.left),Math.round(r.top)),new ns(Math.round(r.left+r.width),Math.round(r.top)),new ns(Math.round(r.left+r.width),Math.round(r.height+r.top)),new ns(Math.round(r.left),Math.round(r.height+r.top))]}},Ts="Hidden Text",vs=(Ms.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),B=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",n.appendChild(t),B.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B.width=1,B.height=1,B.style.margin="0",B.style.padding="0",B.style.verticalAlign="baseline",r.style.fontFamily=A,r.style.fontSize=e,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(Ts)),t.appendChild(r),t.appendChild(B);e=B.offsetTop-r.offsetTop+2;t.removeChild(r),t.appendChild(this._document.createTextNode(Ts)),t.style.lineHeight="normal",B.style.verticalAlign="super";B=B.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:e,middle:B}},Ms.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]},Ms);function Ms(A){this._data={},this._document=A}var Ns,ge=function(A,e){this.context=A,this.options=e},Gs=(A(xs,Ns=ge),xs.prototype.applyEffects=function(A,e){for(var t=this;this._activeEffects.length;)this.popEffect();A.filter(function(A){return QB(A.target,e)}).forEach(function(A){return t.applyEffect(A)})},xs.prototype.applyEffect=function(A){this.ctx.save(),2===A.type&&(this.ctx.globalAlpha=A.opacity),0===A.type&&(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)),1===A.type&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},xs.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},xs.prototype.renderStack=function(e){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:A.sent(),A.label=2;case 2:return[2]}})})},xs.prototype.renderNode=function(e){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(e)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},xs.prototype.renderTextWithLetterSpacing=function(t,A,B){var r=this;0===A?this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+B):GB(t.text).reduce(function(A,e){return r.ctx.fillText(e,A,t.bounds.top+B),A+r.ctx.measureText(e).width},t.bounds.left)},xs.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=A.fontFamily.join(", "),B=VA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,B,t].join(" "),t,B]},xs.prototype.renderTextNode=function(i,Q){return a(this,void 0,void 0,function(){var e,t,B,r,n,s,o=this;return H(this,function(A){return B=this.createFontStyle(Q),e=B[0],t=B[1],B=B[2],this.ctx.font=e,this.ctx.direction=1===Q.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",B=this.fontMetrics.getMetrics(t,B),r=B.baseline,n=B.middle,s=Q.paintOrder,i.textBounds.forEach(function(t){s.forEach(function(A){switch(A){case aB.FILL:o.ctx.fillStyle=te(Q.color),o.renderTextWithLetterSpacing(t,Q.letterSpacing,r);var e=Q.textShadow;e.length&&t.text.trim().length&&(e.slice(0).reverse().forEach(function(A){o.ctx.shadowColor=te(A.color),o.ctx.shadowOffsetX=A.offsetX.number*o.options.scale,o.ctx.shadowOffsetY=A.offsetY.number*o.options.scale,o.ctx.shadowBlur=A.blur.number,o.renderTextWithLetterSpacing(t,Q.letterSpacing,r)}),o.ctx.shadowColor="",o.ctx.shadowOffsetX=0,o.ctx.shadowOffsetY=0,o.ctx.shadowBlur=0),Q.textDecorationLine.length&&(o.ctx.fillStyle=te(Q.textDecorationColor||Q.color),Q.textDecorationLine.forEach(function(A){switch(A){case 1:o.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top+r),t.bounds.width,1);break;case 2:o.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top),t.bounds.width,1);break;case 3:o.ctx.fillRect(t.bounds.left,Math.ceil(t.bounds.top+n),t.bounds.width,1)}}));break;case aB.STROKE:Q.webkitTextStrokeWidth&&t.text.trim().length&&(o.ctx.strokeStyle=te(Q.webkitTextStrokeColor),o.ctx.lineWidth=Q.webkitTextStrokeWidth,o.ctx.lineJoin=window.chrome?"miter":"round",o.ctx.strokeText(t.text,t.bounds.left,t.bounds.top+r)),o.ctx.strokeStyle="",o.ctx.lineWidth=0,o.ctx.lineJoin="miter"}})}),[2]})})},xs.prototype.renderReplacedElement=function(A,e,t){var B;t&&0<A.intrinsicWidth&&0<A.intrinsicHeight&&(B=Is(A),e=Cs(e),this.path(e),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,B.left,B.top,B.width,B.height),this.ctx.restore())},xs.prototype.renderNodeContent=function(g){return a(this,void 0,void 0,function(){var e,t,B,r,n,s,o,i,Q,c,a,w;return H(this,function(A){switch(A.label){case 0:this.applyEffects(g.effects,4),e=g.container,t=g.curves,B=e.styles,r=0,n=e.textNodes,A.label=1;case 1:return r<n.length?(s=n[r],[4,this.renderTextNode(s,B)]):[3,4];case 2:A.sent(),A.label=3;case 3:return r++,[3,1];case 4:if(!(e instanceof gr))return[3,8];A.label=5;case 5:return A.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return Q=A.sent(),this.renderReplacedElement(e,t,Q),[3,8];case 7:return A.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof Fr&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof hr))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return Q=A.sent(),this.renderReplacedElement(e,t,Q),[3,12];case 11:return A.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof kr&&e.tree?[4,new xs(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:s=A.sent(),e.width&&e.height&&this.ctx.drawImage(s,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),A.label=14;case 14:if(e instanceof Sr&&(i=Math.min(e.bounds.width,e.bounds.height),e.type===Dr?e.checked&&(this.ctx.save(),this.path([new ns(e.bounds.left+.39363*i,e.bounds.top+.79*i),new ns(e.bounds.left+.16*i,e.bounds.top+.5549*i),new ns(e.bounds.left+.27347*i,e.bounds.top+.44071*i),new ns(e.bounds.left+.39694*i,e.bounds.top+.5649*i),new ns(e.bounds.left+.72983*i,e.bounds.top+.23*i),new ns(e.bounds.left+.84*i,e.bounds.top+.34085*i),new ns(e.bounds.left+.39363*i,e.bounds.top+.79*i)]),this.ctx.fillStyle=te(Or),this.ctx.fill(),this.ctx.restore()):e.type===br&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+i/2,e.bounds.top+i/2,i/4,0,2*Math.PI,!0),this.ctx.fillStyle=te(Or),this.ctx.fill(),this.ctx.restore())),Ps(e)&&e.value.length){switch(c=this.createFontStyle(B),a=c[0],i=c[1],c=this.fontMetrics.getMetrics(a,i).baseline,this.ctx.font=a,this.ctx.fillStyle=te(B.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Js(e.styles.textAlign),w=Is(e),o=0,e.styles.textAlign){case Rt.CENTER:o+=w.width/2;break;case Rt.RIGHT:o+=w.width}i=w.add(o,0,0,-w.height/2+1),this.ctx.save(),this.path([new ns(w.left,w.top),new ns(w.left+w.width,w.top),new ns(w.left+w.width,w.top+w.height),new ns(w.left,w.top+w.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new tr(e.value,i),B.letterSpacing,c),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!QB(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if((c=e.styles.listStyleImage).type!==pe.URL)return[3,18];Q=void 0,c=c.url,A.label=15;case 15:return A.trys.push([15,17,,18]),[4,this.context.cache.match(c)];case 16:return Q=A.sent(),this.ctx.drawImage(Q,e.bounds.left-(Q.width+10),e.bounds.top),[3,18];case 17:return A.sent(),this.context.logger.error("Error loading list-style-image "+c),[3,18];case 18:return[3,20];case 19:g.listValue&&e.styles.listStyleType!==It.NONE&&(a=this.createFontStyle(B)[0],this.ctx.font=a,this.ctx.fillStyle=te(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",w=new d(e.bounds.left,e.bounds.top+ie(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ft(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new tr(g.listValue,w),B.letterSpacing,Ft(B.lineHeight,B.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),A.label=20;case 20:return[2]}})})},xs.prototype.renderStackContent=function(F){return a(this,void 0,void 0,function(){var e,t,B,r,n,s,o,i,Q,c,a,w,g,C,U;return H(this,function(A){switch(A.label){case 0:return[4,this.renderNodeBackgroundAndBorders(F.element)];case 1:A.sent(),e=0,t=F.negativeZIndex,A.label=2;case 2:return e<t.length?(U=t[e],[4,this.renderStack(U)]):[3,5];case 3:A.sent(),A.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(F.element)];case 6:A.sent(),B=0,r=F.nonInlineLevel,A.label=7;case 7:return B<r.length?(U=r[B],[4,this.renderNode(U)]):[3,10];case 8:A.sent(),A.label=9;case 9:return B++,[3,7];case 10:n=0,s=F.nonPositionedFloats,A.label=11;case 11:return n<s.length?(U=s[n],[4,this.renderStack(U)]):[3,14];case 12:A.sent(),A.label=13;case 13:return n++,[3,11];case 14:o=0,i=F.nonPositionedInlineLevel,A.label=15;case 15:return o<i.length?(U=i[o],[4,this.renderStack(U)]):[3,18];case 16:A.sent(),A.label=17;case 17:return o++,[3,15];case 18:Q=0,c=F.inlineLevel,A.label=19;case 19:return Q<c.length?(U=c[Q],[4,this.renderNode(U)]):[3,22];case 20:A.sent(),A.label=21;case 21:return Q++,[3,19];case 22:a=0,w=F.zeroOrAutoZIndexOrTransformedOrOpacity,A.label=23;case 23:return a<w.length?(U=w[a],[4,this.renderStack(U)]):[3,26];case 24:A.sent(),A.label=25;case 25:return a++,[3,23];case 26:g=0,C=F.positiveZIndex,A.label=27;case 27:return g<C.length?(U=C[g],[4,this.renderStack(U)]):[3,30];case 28:A.sent(),A.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},xs.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()},xs.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},xs.prototype.formatPath=function(A){var B=this;A.forEach(function(A,e){var t=cs(A)?A.start:A;0===e?B.ctx.moveTo(t.x,t.y):B.ctx.lineTo(t.x,t.y),cs(A)&&B.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},xs.prototype.renderRepeat=function(A,e,t,B){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,B),this.ctx.fill(),this.ctx.translate(-t,-B)},xs.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var B=(null!==(B=this.canvas.ownerDocument)&&void 0!==B?B:document).createElement("canvas");return B.width=Math.max(1,e),B.height=Math.max(1,t),B.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),B},xs.prototype.renderBackgroundImage=function(E){return a(this,void 0,void 0,function(){var h,e,d,t,B,r;return H(this,function(A){switch(A.label){case 0:h=E.styles.backgroundImage.length-1,e=function(e){var t,B,r,n,s,o,i,Q,c,a,w,g,C,U,F,l,u;return H(this,function(A){switch(A.label){case 0:if(e.type!==pe.URL)return[3,5];t=void 0,B=e.url,A.label=1;case 1:return A.trys.push([1,3,,4]),[4,d.context.cache.match(B)];case 2:return t=A.sent(),[3,4];case 3:return A.sent(),d.context.logger.error("Error loading background-image "+B),[3,4];case 4:return t&&(r=ps(E,h,[t.width,t.height,t.width/t.height]),o=r[0],w=r[1],g=r[2],c=r[3],a=r[4],s=d.ctx.createPattern(d.resizeImage(t,c,a),"repeat"),d.renderRepeat(o,s,w,g)),[3,6];case 5:e.type===pe.LINEAR_GRADIENT?(u=ps(E,h,[null,null,null]),o=u[0],w=u[1],g=u[2],c=u[3],a=u[4],F=He(e.angle,c,a),U=F[0],r=F[1],i=F[2],l=F[3],Q=F[4],(u=document.createElement("canvas")).width=c,u.height=a,F=u.getContext("2d"),n=F.createLinearGradient(r,l,i,Q),Ee(e.stops,U).forEach(function(A){return n.addColorStop(A.stop,te(A.color))}),F.fillStyle=n,F.fillRect(0,0,c,a),0<c&&0<a&&(s=d.ctx.createPattern(u,"repeat"),d.renderRepeat(o,s,w,g))):e.type===pe.RADIAL_GRADIENT&&(l=ps(E,h,[null,null,null]),o=l[0],i=l[1],Q=l[2],c=l[3],a=l[4],U=0===e.position.length?[se]:e.position,w=ie(U[0],c),g=ie(U[U.length-1],a),F=function(A,e,t,B,r){var n,s,o,i,Q=0,c=0;switch(A.size){case Te.CLOSEST_SIDE:A.shape===Se.CIRCLE?Q=c=Math.min(Math.abs(e),Math.abs(e-B),Math.abs(t),Math.abs(t-r)):A.shape===Se.ELLIPSE&&(Q=Math.min(Math.abs(e),Math.abs(e-B)),c=Math.min(Math.abs(t),Math.abs(t-r)));break;case Te.CLOSEST_CORNER:A.shape===Se.CIRCLE?Q=c=Math.min(fe(e,t),fe(e,t-r),fe(e-B,t),fe(e-B,t-r)):A.shape===Se.ELLIPSE&&(n=Math.min(Math.abs(t),Math.abs(t-r))/Math.min(Math.abs(e),Math.abs(e-B)),o=(s=Ie(B,r,e,t,!0))[0],i=s[1],c=n*(Q=fe(o-e,(i-t)/n)));break;case Te.FARTHEST_SIDE:A.shape===Se.CIRCLE?Q=c=Math.max(Math.abs(e),Math.abs(e-B),Math.abs(t),Math.abs(t-r)):A.shape===Se.ELLIPSE&&(Q=Math.max(Math.abs(e),Math.abs(e-B)),c=Math.max(Math.abs(t),Math.abs(t-r)));break;case Te.FARTHEST_CORNER:A.shape===Se.CIRCLE?Q=c=Math.max(fe(e,t),fe(e,t-r),fe(e-B,t),fe(e-B,t-r)):A.shape===Se.ELLIPSE&&(n=Math.max(Math.abs(t),Math.abs(t-r))/Math.max(Math.abs(e),Math.abs(e-B)),o=(s=Ie(B,r,e,t,!1))[0],i=s[1],c=n*(Q=fe(o-e,(i-t)/n)))}return Array.isArray(A.size)&&(Q=ie(A.size[0],B),c=2===A.size.length?ie(A.size[1],r):Q),[Q,c]}(e,w,g,c,a),u=F[0],l=F[1],0<u&&0<l&&(C=d.ctx.createRadialGradient(i+w,Q+g,0,i+w,Q+g,u),Ee(e.stops,2*u).forEach(function(A){return C.addColorStop(A.stop,te(A.color))}),d.path(o),d.ctx.fillStyle=C,u!==l?(U=E.bounds.left+.5*E.bounds.width,F=E.bounds.top+.5*E.bounds.height,u=1/(l=l/u),d.ctx.save(),d.ctx.translate(U,F),d.ctx.transform(1,0,0,l,0,0),d.ctx.translate(-U,-F),d.ctx.fillRect(i,u*(Q-F)+F,c,a*u),d.ctx.restore()):d.ctx.fill())),A.label=6;case 6:return h--,[2]}})},d=this,t=0,B=E.styles.backgroundImage.slice(0).reverse(),A.label=1;case 1:return t<B.length?(r=B[t],[5,e(r)]):[3,4];case 2:A.sent(),A.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},xs.prototype.renderSolidBorder=function(e,t,B){return a(this,void 0,void 0,function(){return H(this,function(A){return this.path(Hs(B,t)),this.ctx.fillStyle=te(e),this.ctx.fill(),[2]})})},xs.prototype.renderDoubleBorder=function(t,B,r,n){return a(this,void 0,void 0,function(){var e;return H(this,function(A){switch(A.label){case 0:return B<3?[4,this.renderSolidBorder(t,r,n)]:[3,2];case 1:return A.sent(),[2];case 2:return e=function(A,e){switch(e){case 0:return bs(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return bs(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return bs(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return bs(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,r),this.path(e),this.ctx.fillStyle=te(t),this.ctx.fill(),e=function(A,e){switch(e){case 0:return bs(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return bs(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return bs(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return bs(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,r),this.path(e),this.ctx.fill(),[2]}})})},xs.prototype.renderNodeBackgroundAndBorders=function(c){return a(this,void 0,void 0,function(){var e,t,B,r,n,s,o,i,Q=this;return H(this,function(A){switch(A.label){case 0:return(this.applyEffects(c.effects,2),e=c.container.styles,t=!ee(e.backgroundColor)||e.backgroundImage.length,B=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],r=ks(Os(e.backgroundClip,0),c.curves),t||e.boxShadow.length)?(this.ctx.save(),this.path(r),this.ctx.clip(),ee(e.backgroundColor)||(this.ctx.fillStyle=te(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(c.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(A){Q.ctx.save();var t,B,r,n,e=gs(c.curves),s=A.inset?0:1e4,o=(t=-s+(A.inset?1:-1)*A.spread.number,B=(A.inset?1:-1)*A.spread.number,r=A.spread.number*(A.inset?-2:2),n=A.spread.number*(A.inset?-2:2),e.map(function(A,e){switch(e){case 0:return A.add(t,B);case 1:return A.add(t+r,B);case 2:return A.add(t+r,B+n);case 3:return A.add(t,B+n)}return A}));A.inset?(Q.path(e),Q.ctx.clip(),Q.mask(o)):(Q.mask(e),Q.ctx.clip(),Q.path(o)),Q.ctx.shadowOffsetX=A.offsetX.number+s,Q.ctx.shadowOffsetY=A.offsetY.number,Q.ctx.shadowColor=te(A.color),Q.ctx.shadowBlur=A.blur.number,Q.ctx.fillStyle=A.inset?te(A.color):"rgba(0,0,0,1)",Q.ctx.fill(),Q.ctx.restore()}),A.label=2;case 2:s=n=0,o=B,A.label=3;case 3:return s<o.length?(i=o[s]).style!==_e.NONE&&!ee(i.color)&&0<i.width?i.style!==_e.DASHED?[3,5]:[4,this.renderDashedDottedBorder(i.color,i.width,n,c.curves,_e.DASHED)]:[3,11]:[3,13];case 4:return A.sent(),[3,11];case 5:return i.style!==_e.DOTTED?[3,7]:[4,this.renderDashedDottedBorder(i.color,i.width,n,c.curves,_e.DOTTED)];case 6:return A.sent(),[3,11];case 7:return i.style!==_e.DOUBLE?[3,9]:[4,this.renderDoubleBorder(i.color,i.width,n,c.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(i.color,n,c.curves)];case 10:A.sent(),A.label=11;case 11:n++,A.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},xs.prototype.renderDashedDottedBorder=function(w,g,C,U,F){return a(this,void 0,void 0,function(){var e,t,B,r,n,s,o,i,Q,c,a;return H(this,function(A){return this.ctx.save(),Q=function(A,e){switch(e){case 0:return Ds(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Ds(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Ds(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return Ds(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(U,C),e=Hs(U,C),F===_e.DASHED&&(this.path(e),this.ctx.clip()),s=cs(e[0])?(t=e[0].start.x,e[0].start.y):(t=e[0].x,e[0].y),o=cs(e[1])?(B=e[1].end.x,e[1].end.y):(B=e[1].x,e[1].y),r=0===C||2===C?Math.abs(t-B):Math.abs(s-o),this.ctx.beginPath(),F===_e.DOTTED?this.formatPath(Q):this.formatPath(e.slice(0,2)),n=g<3?3*g:2*g,s=g<3?2*g:g,F===_e.DOTTED&&(s=n=g),o=!0,r<=2*n?o=!1:r<=2*n+s?(n*=i=r/(2*n+s),s*=i):(Q=Math.floor((r+s)/(n+s)),i=(r-Q*n)/(Q-1),s=(Q=(r-(Q+1)*n)/Q)<=0||Math.abs(s-i)<Math.abs(s-Q)?i:Q),o&&(F===_e.DOTTED?this.ctx.setLineDash([0,n+s]):this.ctx.setLineDash([n,s])),F===_e.DOTTED?(this.ctx.lineCap="round",this.ctx.lineWidth=g):this.ctx.lineWidth=2*g+1.1,this.ctx.strokeStyle=te(w),this.ctx.stroke(),this.ctx.setLineDash([]),F===_e.DASHED&&(cs(e[0])&&(c=e[3],a=e[0],this.ctx.beginPath(),this.formatPath([new ns(c.end.x,c.end.y),new ns(a.start.x,a.start.y)]),this.ctx.stroke()),cs(e[1])&&(c=e[1],a=e[2],this.ctx.beginPath(),this.formatPath([new ns(c.end.x,c.end.y),new ns(a.start.x,a.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},xs.prototype.render=function(r){return a(this,void 0,void 0,function(){return H(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=te(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=new ds(e=r,[]),B=new hs(t),Ls(t,B,B,e=[]),ms(t.container,e),[4,this.renderStack(B)];case 1:return A.sent(),this.applyEffects([],2),[2,this.canvas]}var e,t,B})})},xs);function xs(A,e){A=Ns.call(this,A,e)||this;return A._activeEffects=[],A.canvas=e.canvas||document.createElement("canvas"),A.ctx=A.canvas.getContext("2d"),e.canvas||(A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+"px",A.canvas.style.height=e.height+"px"),A.fontMetrics=new vs(document),A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.ctx.textBaseline="bottom",A._activeEffects=[],A.context.logger.debug("Canvas renderer initialized ("+e.width+"x"+e.height+") with scale "+e.scale),A}var Vs,Ps=function(A){return A instanceof xr||(A instanceof Mr||A instanceof Sr&&A.type!==br&&A.type!==Dr)},ks=function(A,e){switch(A){case Fe.BORDER_BOX:return gs(e);case Fe.CONTENT_BOX:return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox];default:Fe.PADDING_BOX;return Cs(e)}},Js=function(A){switch(A){case Rt.CENTER:return"center";case Rt.RIGHT:return"right";default:Rt.LEFT;return"left"}},Xs=(A(_s,Vs=ge),_s.prototype.render=function(t){return a(this,void 0,void 0,function(){var e;return H(this,function(A){switch(A.label){case 0:return e=$B(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Ys(e)];case 1:return e=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=te(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},_s);function _s(A,e){A=Vs.call(this,A,e)||this;return A.canvas=e.canvas||document.createElement("canvas"),A.ctx=A.canvas.getContext("2d"),A.options=e,A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+"px",A.canvas.style.height=e.height+"px",A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale),A}var Ys=function(B){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(B))})},Ws=(Zs.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,t([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Zs.prototype.getTime=function(){return Date.now()-this.start},Zs.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,t([this.id,this.getTime()+"ms"],A))},Zs.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,t([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Zs.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,t([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Zs.instances={},Zs);function Zs(A){var e=A.id,A=A.enabled;this.id=e,this.enabled=A,this.start=Date.now()}var qs=(js.instanceCount=1,js);function js(A,e){this.windowBounds=e,this.instanceName="#"+js.instanceCount++,this.logger=new Ws({id:this.instanceName,enabled:A.logging}),this.cache=null!==(e=A.cache)&&void 0!==e?e:new Yn(this,A)}"undefined"!=typeof window&&Xn.setContext(window);var zs=function(l,u){return a(void 0,void 0,void 0,function(){var e,t,B,r,n,s,o,i,Q,c,a,w,g,C,U,F;return H(this,function(A){switch(A.label){case 0:if(!l||"object"!=typeof l)return[2,Promise.reject("Invalid element provided as first argument")];if(!(e=l.ownerDocument))throw new Error("Element is not attached to a Document");if(!(t=e.defaultView))throw new Error("Document is not attached to a Window");return g={allowTaint:null!==(C=u.allowTaint)&&void 0!==C&&C,imageTimeout:null!==(c=u.imageTimeout)&&void 0!==c?c:15e3,proxy:u.proxy,useCORS:null!==(a=u.useCORS)&&void 0!==a&&a},C=h({logging:null===(w=u.logging)||void 0===w||w,cache:u.cache},g),c={windowWidth:null!==(c=u.windowWidth)&&void 0!==c?c:t.innerWidth,windowHeight:null!==(a=u.windowHeight)&&void 0!==a?a:t.innerHeight,scrollX:null!==(w=u.scrollX)&&void 0!==w?w:t.pageXOffset,scrollY:null!==(g=u.scrollY)&&void 0!==g?g:t.pageYOffset},a=new d(c.scrollX,c.scrollY,c.windowWidth,c.windowHeight),w=new qs(C,a),c=null!==(g=u.foreignObjectRendering)&&void 0!==g&&g,g={allowTaint:null!==(C=u.allowTaint)&&void 0!==C&&C,onclone:u.onclone,ignoreElements:u.ignoreElements,inlineImages:c,copyStyles:c},w.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),C=new mn(w,l,g),(g=C.clonedReferenceElement)?[4,C.toIFrame(e,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return(B=A.sent(),U=sn(g)||"HTML"===g.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");A=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),t=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new d(0,0,A,t)}(g.ownerDocument):E(w,g),r=U.width,n=U.height,s=U.left,o=U.top,i=$s(w,g,u.backgroundColor),U={canvas:u.canvas,backgroundColor:i,scale:null!==(U=null!==(U=u.scale)&&void 0!==U?U:t.devicePixelRatio)&&void 0!==U?U:1,x:(null!==(U=u.x)&&void 0!==U?U:0)+s,y:(null!==(U=u.y)&&void 0!==U?U:0)+o,width:null!==(U=u.width)&&void 0!==U?U:Math.ceil(r),height:null!==(U=u.height)&&void 0!==U?U:Math.ceil(n)},c)?(w.logger.debug("Document cloned, using foreign object rendering"),[4,new Xs(w,U).render(g)]):[3,3];case 2:return Q=A.sent(),[3,5];case 3:return w.logger.debug("Document cloned, element located at "+s+","+o+" with size "+r+"x"+n+" using computed rendering"),w.logger.debug("Starting DOM parsing"),F=Zr(w,g),i===F.styles.backgroundColor&&(F.styles.backgroundColor=he.TRANSPARENT),w.logger.debug("Starting renderer for element at "+U.x+","+U.y+" with size "+U.width+"x"+U.height),[4,new Gs(w,U).render(F)];case 4:Q=A.sent(),A.label=5;case 5:return null!==(F=u.removeContainer)&&void 0!==F&&!F||mn.destroy(B)||w.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore"),w.logger.debug("Finished rendering"),[2,Q]}})})},$s=function(A,e,t){var B=e.ownerDocument,r=B.documentElement?Ue(A,getComputedStyle(B.documentElement).backgroundColor):he.TRANSPARENT,n=B.body?Ue(A,getComputedStyle(B.body).backgroundColor):he.TRANSPARENT,t="string"==typeof t?Ue(A,t):null===t?he.TRANSPARENT:4294967295;return e===B.documentElement?ee(r)?ee(n)?t:n:r:t};return function(A,e){return zs(A,e=void 0===e?{}:e)}});