/*!
 * html2canvas-pro 1.5.8 <https://yorickshan.github.io/html2canvas-pro/>
 * Copyright (c) 2024 yorickshan <https://github.com/yorickshan>
 * 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 r=function(A,e){return(r=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}r(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,r=arguments.length;t<r;t++)for(var B in e=arguments[t])Object.prototype.hasOwnProperty.call(e,B)&&(A[B]=e[B]);return A}).apply(this,arguments)};function c(A,s,o,i){return new(o=o||Promise)(function(t,e){function r(A){try{n(i.next(A))}catch(A){e(A)}}function B(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(r,B)}n((i=i.apply(A,s||[])).next())})}function p(t,r){var B,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(B)throw new TypeError("Generator is already executing.");for(;o;)try{if(B=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=r.call(t,o)}catch(A){e=[6,A],n=0}finally{B=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 r,B=0,n=e.length;B<n;B++)!r&&B in e||((r=r||Array.prototype.slice.call(e,0,B))[B]=e[B]);return A.concat(r||e)}var d=(B.prototype.add=function(A,e,t,r){return new B(this.left+A,this.top+e,this.width+t,this.height+r)},B.fromClientRect=function(A,e){return new B(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},B.fromDOMRectList=function(A,e){e=Array.from(e).find(function(A){return 0!==A.width});return e?new B(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height):B.EMPTY},B.EMPTY=new B(0,0,0,0),B);function B(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}for(var f=function(A,e){return d.fromClientRect(A,e.getBoundingClientRect())},a=function(A){for(var e=[],t=0,r=A.length;t<r;){var B,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<r?56320==(64512&(B=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--):e.push(n)}return e},Q=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],B=-1,n="";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(B+1===t||16384<r.length)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<e.length;s++)n[e.charCodeAt(s)]=s;for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="undefined"==typeof Uint8Array?[]:new Uint8Array(256),i=0;i<o.length;i++)g[o.charCodeAt(i)]=i;function w(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var u=(l.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},l);function l(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}for(var U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C="undefined"==typeof Uint8Array?[]:new Uint8Array(256),F=0;F<U.length;F++)C[U.charCodeAt(F)]=F;function H(A,e,t,r){var B=r[t];if(Array.isArray(A)?-1!==A.indexOf(B):A===B)for(var n=t;n<=r.length;){if((o=r[++n])===e)return 1;if(o!==v)break}if(B===v)for(n=t;0<n;){var s=r[--n];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o,i=t;i<=r.length;){if((o=r[++i])===e)return 1;if(o!==v)break}if(s!==v)break}}function E(A,e){for(var t=A;0<=t;){var r=e[t];if(r!==v)return r;t--}return 0}function I(t,A){var e=(B=function(A,r){void 0===r&&(r="strict");var B=[],n=[],s=[];return A.forEach(function(A,e){var t=rA.get(A);if(50<t?(s.push(!0),t-=50):s.push(!1),-1!==["normal","auto","loose"].indexOf(r)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(e),B.push(16);if(4!==t&&11!==t)return n.push(e),31===t?B.push("strict"===r?O:q):t===AA||29===t?B.push(J):43===t?131072<=A&&A<=196605||196608<=A&&A<=262141?B.push(q):B.push(J):void B.push(t);if(0===e)return n.push(e),B.push(J);t=B[e-1];return-1===iA.indexOf(t)?(n.push(n[e-1]),B.push(t)):(n.push(e),B.push(J))}),[n,B,s]}(t,(A=A||{lineBreak:"normal",wordBreak:"normal"}).lineBreak))[0],r=B[1],B=B[2];return[e,r="break-all"===A.wordBreak||"break-word"===A.wordBreak?r.map(function(A){return-1!==[R,J,AA].indexOf(A)?q:A}):r,"keep-all"===A.wordBreak?B.map(function(A,e){return A&&19968<=t[e]&&t[e]<=40959}):void 0]}var y,K,m,L,b,v=10,D=13,M=15,x=17,S=18,T=19,G=20,O=21,V=22,k=24,R=25,N=26,P=27,X=28,J=30,Y=32,W=33,Z=34,_=35,q=37,j=38,z=39,$=40,AA=42,eA=[9001,65288],tA="×",rA=(m=function(A){var e,t,r,B,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),c=0;c<s;c+=4)e=g[A.charCodeAt(c)],t=g[A.charCodeAt(c+1)],r=g[A.charCodeAt(c+2)],B=g[A.charCodeAt(c+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|r>>2,i[o++]=(3&r)<<6|63&B;return n}(y=" "),L=Array.isArray(m)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(m):new Uint32Array(m),b=Array.isArray(m)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(m):new Uint16Array(m),y=w(b,12,L[4]/2),K=2===L[5]?w(b,(24+L[4])/2):(m=L,b=Math.ceil((24+L[4])/4),m.slice?m.slice(b,K):new Uint32Array(Array.prototype.slice.call(m,b,K))),new u(L[0],L[1],L[2],L[3],y,K)),BA=[J,36],nA=[1,2,3,5],sA=[v,8],oA=[P,N],iA=nA.concat(sA),cA=[j,z,$,Z,_],aA=[M,D],QA=(gA.prototype.slice=function(){return Q.apply(void 0,this.codePoints.slice(this.start,this.end))},gA);function gA(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}function wA(A,e){var t=a(A),r=(e=I(t,e))[0],B=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=tA;i<s&&(A=function(A,e,t,r,B){if(0===t[r])return tA;var n=r-1;if(Array.isArray(B)&&!0===B[n])return tA;var s=n-1,o=1+n,i=e[n],r=0<=s?e[s]:0,B=e[o];if(2===i&&3===B)return tA;if(-1!==nA.indexOf(i))return"!";if(-1!==nA.indexOf(B))return tA;if(-1!==sA.indexOf(B))return tA;if(8===E(n,e))return"÷";if(11===rA.get(A[n]))return tA;if((i===Y||i===W)&&11===rA.get(A[o]))return tA;if(7===i||7===B)return tA;if(9===i)return tA;if(-1===[v,D,M].indexOf(i)&&9===B)return tA;if(-1!==[x,S,T,k,X].indexOf(B))return tA;if(E(n,e)===V)return tA;if(H(23,V,n,e))return tA;if(H([x,S],O,n,e))return tA;if(H(12,12,n,e))return tA;if(i===v)return"÷";if(23===i||23===B)return tA;if(16===B||16===i)return"÷";if(-1!==[D,M,O].indexOf(B)||14===i)return tA;if(36===r&&-1!==aA.indexOf(i))return tA;if(i===X&&36===B)return tA;if(B===G)return tA;if(-1!==BA.indexOf(B)&&i===R||-1!==BA.indexOf(i)&&B===R)return tA;if(i===P&&-1!==[q,Y,W].indexOf(B)||-1!==[q,Y,W].indexOf(i)&&B===N)return tA;if(-1!==BA.indexOf(i)&&-1!==oA.indexOf(B)||-1!==oA.indexOf(i)&&-1!==BA.indexOf(B))return tA;if(-1!==[P,N].indexOf(i)&&(B===R||-1!==[V,M].indexOf(B)&&e[1+o]===R)||-1!==[V,M].indexOf(i)&&B===R||i===R&&-1!==[R,X,k].indexOf(B))return tA;if(-1!==[R,X,k,x,S].indexOf(B))for(var c=n;0<=c;){if((a=e[c])===R)return tA;if(-1===[X,k].indexOf(a))break;c--}if(-1!==[P,N].indexOf(B))for(var a,c=-1!==[x,S].indexOf(i)?s:n;0<=c;){if((a=e[c])===R)return tA;if(-1===[X,k].indexOf(a))break;c--}if(j===i&&-1!==[j,z,Z,_].indexOf(B)||-1!==[z,Z].indexOf(i)&&-1!==[z,$].indexOf(B)||-1!==[$,_].indexOf(i)&&B===$)return tA;if(-1!==cA.indexOf(i)&&-1!==[G,N].indexOf(B)||-1!==cA.indexOf(B)&&i===P)return tA;if(-1!==BA.indexOf(i)&&-1!==BA.indexOf(B))return tA;if(i===k&&-1!==BA.indexOf(B))return tA;if(-1!==BA.concat(R).indexOf(i)&&B===V&&-1===eA.indexOf(A[o])||-1!==BA.concat(R).indexOf(B)&&i===S)return tA;if(41===i&&41===B){for(var Q=t[n],g=1;0<Q&&41===e[--Q];)g++;if(g%2!=0)return tA}return i===Y&&B===W?tA:"÷"}(t,B,r,++i,n))===tA;);if(A===tA&&i!==s)return{done:!0,value:null};var e=new QA(t,A,o,i);return o=i,{value:e,done:!1}}}}function uA(A){return 48<=A&&A<=57}function lA(A){return uA(A)||65<=A&&A<=70||97<=A&&A<=102}function UA(A){return 10===A||9===A||32===A}function CA(A){return 97<=(t=e=A)&&t<=122||65<=(e=e)&&e<=90||128<=A||95===A;var e,t}function FA(A){return CA(A)||uA(A)||45===A}function hA(A,e){return 92===A&&10!==e}function dA(A,e,t){return 45===A?CA(e)||hA(e,t):!!CA(A)||92===A&&10!==e}function fA(A,e,t){return 43===A||45===A?!!uA(e)||46===e&&uA(t):uA(46===A?e:A)}var pA={type:2},HA={type:3},EA={type:4},IA={type:13},yA={type:8},KA={type:21},mA={type:9},LA={type:10},bA={type:11},vA={type:12},DA={type:14},MA={type:23},xA={type:1},SA={type:25},TA={type:24},GA={type:26},OA={type:27},VA={type:28},kA={type:29},RA={type:31},NA={type:32},PA=(XA.prototype.write=function(A){this._value=this._value.concat(a(A))},XA.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==NA;)A.push(e),e=this.consumeToken();return A},XA.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(FA(e)||hA(t,r)){var B=dA(e,t,r)?2:1;return{type:5,value:this.consumeName(),flags:B}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case 39:return this.consumeStringToken(39);case 40:return pA;case 41:return HA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),DA;break;case 43:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return EA;case 45:var r=A,B=this.peekCodePoint(0),n=this.peekCodePoint(1);if(fA(r,B,n))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(dA(r,B,n))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===B&&62===n)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 46:if(fA(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 GA;case 59:return OA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),SA;break;case 64:var n=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);if(dA(n,o,i))return{type:7,value:this.consumeName()};break;case 91:return VA;case 92:if(hA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return kA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),yA;break;case 123:return bA;case 125:return vA;case 117:case 85:o=this.peekCodePoint(0),i=this.peekCodePoint(1);return 43!==o||!lA(i)&&63!==i||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),mA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),KA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),LA;break;case-1:return NA}return UA(A)?(this.consumeWhiteSpace(),RA):uA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):CA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:Q(A)}},XA.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},XA.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},XA.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},XA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();lA(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(Q.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(Q.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var r=parseInt(Q.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&lA(this.peekCodePoint(1))){this.consumeCodePoint();for(var e=this.consumeCodePoint(),B=[];lA(e)&&B.length<6;)B.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(Q.apply(void 0,B),16)}}return{type:30,start:r,end:r}},XA.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}},XA.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(),MA)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:22,value:Q.apply(void 0,A)};if(UA(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:Q.apply(void 0,A)}):(this.consumeBadUrlRemnants(),MA);if(34===r||39===r||40===r||(0<=(e=r)&&e<=8||11===e||14<=e&&e<=31||127===e))return this.consumeBadUrlRemnants(),MA;if(92===r){if(!hA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),MA;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},XA.prototype.consumeWhiteSpace=function(){for(;UA(this.peekCodePoint(0));)this.consumeCodePoint()},XA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;hA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},XA.prototype.consumeStringSlice=function(A){for(var e="";0<A;){var t=Math.min(5e4,A);e+=Q.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},XA.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r,B=this._value[t];if(-1===B||void 0===B||B===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===B)return this._value.splice(0,t),xA;92!==B||-1!==(r=this._value[t+1])&&void 0!==r&&(10===r?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):hA(B,r)&&(e+=this.consumeStringSlice(t),e+=Q(this.consumeEscapedCodePoint()),t=-1)),t++}},XA.prototype.consumeNumber=function(){var A=[],e=4;for(43!==(t=this.peekCodePoint(0))&&45!==t||A.push(this.consumeCodePoint());uA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());var t=this.peekCodePoint(0),r=this.peekCodePoint(1);if(46===t&&uA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;uA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1),B=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&uA(B)||uA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;uA(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 r=[];uA(A[e]);)r.push(A[e++]);var B=r.length?parseInt(Q.apply(void 0,r),10):0;46===A[e]&&e++;for(var n=[];uA(A[e]);)n.push(A[e++]);var s=n.length,o=s?parseInt(Q.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 c=[];uA(A[e]);)c.push(A[e++]);var a=c.length?parseInt(Q.apply(void 0,c),10):0;return t*(B+o*Math.pow(10,-s))*Math.pow(10,i*a)}(A),e]},XA.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),B=this.peekCodePoint(1),A=this.peekCodePoint(2);return dA(r,B,A)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},XA.prototype.consumeEscapedCodePoint=function(){var A,e=this.consumeCodePoint();if(lA(e)){for(var t=Q(e);lA(this.peekCodePoint(0))&&t.length<6;)t+=Q(this.consumeCodePoint());UA(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return 0===r||55296<=(A=r)&&A<=57343||1114111<r?65533:r}return-1===e?65533:e},XA.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(FA(e))A+=Q(e);else{if(!hA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=Q(this.consumeEscapedCodePoint())}}},XA);function XA(){this._value=[]}var JA=(YA.create=function(A){var e=new PA;return e.write(A),new YA(e.read())},YA.parseValue=function(A){return YA.create(A).parseComponentValue()},YA.parseValues=function(A){return YA.create(A).parseComponentValues()},YA.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")},YA.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},YA.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},YA.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||be(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},YA.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())}},YA.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?NA:A},YA.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},YA);function YA(A){this._tokens=A}function WA(A){return 15===A.type}function ZA(A){return 17===A.type}function _A(A){return 20===A.type}function qA(A){return 0===A.type}function jA(A,e){return _A(A)&&A.value===e}function zA(A){return 31!==A.type}function $A(A){return 31!==A.type&&4!==A.type}function Ae(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 ee(A){return 17===A.type||15===A.type}function te(A){return 16===A.type||ee(A)}function re(A){return 1<A.length?[A[0],A[1]]:[A[0]]}function Be(A,e,t){var r=A[0],A=A[1];return[xe(r,e),xe(void 0!==A?A:r,t)]}function ne(A){return 15===A.type&&("deg"===A.unit||"grad"===A.unit||"rad"===A.unit||"turn"===A.unit)}function se(A){switch(A.filter(_A).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ve,ve];case"to top":case"bottom":return Te(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ve,Me];case"to right":case"left":return Te(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Me,Me];case"to bottom":case"top":return Te(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Me,ve];case"to left":case"right":return Te(270)}return 0}function oe(A){return 0==(255&A)}function ie(A){var e=255&A,t=255&A>>8,r=255&A>>16,A=255&A>>24;return e<255?"rgba(".concat(A,",").concat(r,",").concat(t,",").concat(e/255,")"):"rgb(".concat(A,",").concat(r,",").concat(t,")")}function ce(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0}function ae(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)}function Qe(A){return"from"===(20===A[0].type?A[0].value:"unknown")}function ge(A,e,t){return Math.min(Math.max(A,e),t)}function we(A,e){return[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]]}function ue(A){var e=A[0],t=A[1],r=A[2],A=A[3],r=We([e,t,r]);return ce(ge(Math.round(255*r[0]),0,255),ge(Math.round(255*r[1]),0,255),ge(Math.round(255*r[2]),0,255),A)}function le(A){var e=Je([A[0],A[1],A[2]]);return ue([e[0],e[1],e[2],A[3]])}function Ue(A,e){var t=(B=e.filter($A))[0],r=B[1],e=B[2],B=B[3];return[(17===t.type?Te(t.number):Se(A,t))/(2*Math.PI),te(r)?r.number/100:0,te(e)?e.number/100:0,void 0!==B&&te(B)?xe(B,1):1]}function Ce(A){return we([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A)}function Fe(A){return we([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A)}function he(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 de(A){return A}function fe(A){return le([A[0],A[1],A[2],A[3]])}function pe(A){return A=[(A=[A[0],A[1],A[2]].map(function(A){var e=A<0?-1:1;return A*e<=.04045?A/12.92:e*Math.pow((A+.055)/1.055,2.4)||0}))[0],A[1],A[2]],we([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],A)}function He(A){return A=[A[0],A[1],A[2]].map(function(A){return A<.03125?A/16:Math.pow(A,1.8)}),Fe((A=[A[0],A[1],A[2]],we([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],A)))}function Ee(A){return A=[(A=[A[0],A[1],A[2]].map(function(A){return A<4.5*qe?A/4.5:Math.pow((A+_e-1)/_e,1/.45)}))[0],A[1],A[2]],we([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],A)}function Ie(A,e){return A=je(A,e[0]),(e=e[1])&&te(e)?{color:A,stop:e}:{color:A,stop:null}}function ye(A,t){var e=A[0],r=A[A.length-1];null===e.stop&&(e.stop=ve),null===r.stop&&(r.stop=Me);for(var B=[],n=0,s=0;s<A.length;s++){var o=A[s].stop;null!==o?(n<(o=xe(o,t))?B.push(o):B.push(n),n=o):B.push(null)}for(var i=null,s=0;s<B.length;s++){var c=B[s];if(null===c)null===i&&(i=s);else if(null!==i){for(var a=s-i,Q=(c-B[i-1])/(1+a),g=1;g<=a;g++)B[i+g-1]=Q*g;i=null}}return A.map(function(A,e){return{color:A.color,stop:Math.max(Math.min(1,B[e]/t),0)}})}function Ke(A,e,t){var r="number"==typeof A?A:(s=e/2,r=(n=t)/2,s=xe((B=A)[0],e)-s,n=r-xe(B[1],n),(Math.atan2(n,s)+2*Math.PI)%(2*Math.PI)),B=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),n=e/2,s=t/2,e=B/2,t=Math.sin(r-Math.PI/2)*e,e=Math.cos(r-Math.PI/2)*e;return[B,n-e,n+e,s-t,s+t]}function me(A,e){return Math.sqrt(A*A+e*e)}function Le(A,e,B,n,s){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var t=e[0],r=e[1],r=me(B-t,n-r);return(s?r<A.optimumDistance:r>A.optimumDistance)?{optimumCorner:e,optimumDistance:r}:A},{optimumDistance:s?1/0:-1/0,optimumCorner:null}).optimumCorner}var be=function(A,e){return 11===e&&12===A.type||(28===e&&29===A.type||2===e&&3===A.type)},ve={type:17,number:0,flags:4},De={type:16,number:50,flags:4},Me={type:16,number:100,flags:4},xe=function(A,e){if(16===A.type)return A.number/100*e;if(WA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Se=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")},Te=function(A){return Math.PI*A/180},Ge=function(A,e){if(Qe(e))throw new Error("Relative color not supported for hsl()");var t=Ue(A,e),r=t[0],A=t[1],e=t[2],t=t[3],e=Re([r,A,e]);return ce(255*e[0],255*e[1],255*e[2],0===A?1:t)},Oe=function(A){A=A.filter($A);return[te(A[0])?A[0].number:0,te(A[1])?A[1].number:0,ZA(A[2])||WA(A[2])?A[2].number:0,void 0!==A[4]&&te(A[4])?xe(A[4],1):1]},Ve=function(A){A=A.filter($A);return[16===A[0].type?A[0].number/100:ZA(A[0])?A[0].number:0,16===A[1].type?A[1].number/100:ZA(A[1])?A[1].number:0,ZA(A[2])||WA(A[2])?A[2].number:0,void 0!==A[4]&&te(A[4])?xe(A[4],1):1]},ke=function(A){A=A.filter($A);return[16===A[0].type?A[0].number/100:ZA(A[0])?A[0].number:0,16===A[1].type?A[1].number/100:ZA(A[1])?A[1].number:0,ZA(A[2])||WA(A[2])?A[2].number:0,void 0!==A[4]&&te(A[4])?xe(A[4],1):1]},Re=function(A){var e=A[0],t=A[1],A=A[2];if(0===t)return[255*A,255*A,255*A];t=A<=.5?A*(t+1):A+t-A*t,A=2*A-t;return[he(A,t,e+1/3),he(A,t,e),he(A,t,e-1/3)]},Ne=function(A){var e=A[0],t=A[1],A=A[2];return t<0&&(t=0),isNaN(A)&&(A=0),[e,t*Math.cos(A*Math.PI/180),t*Math.sin(A*Math.PI/180)]},Pe=function(A){A=we([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map(function(A){return Math.pow(A,3)});return we([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],A)},Xe=function(A){var e=(A[0]+16)/116,t=A[1]/500+e,r=e-A[2]/200,B=24389/27,B=[.3457*(24/116<t?Math.pow(t,3):(116*t-16)/B)/.3585,8<A[0]?Math.pow(e,3):A[0]/B,.2958*(24/116<r?Math.pow(r,3):(116*r-16)/B)/.3585];return Fe([B[0],B[1],B[2]])},Je=function(A){return we([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A)},Ye=function(A){return we([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A)},We=function(A){return A.map(function(A){var e=A<0?-1:1,t=Math.abs(A);return.0031308<t?e*(1.055*Math.pow(t,1/2.4)-.055):12.92*A})},Ze=function(A){return A.map(function(A){var e=A<0?-1:1,t=Math.abs(A);return t<=.04045?A/12.92:e*Math.pow((t+.055)/1.055,2.4)})},_e=1.09929682680944,qe=.018053968510807,je=function(A,e){if(18===e.type){var t=rt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(A,e.values)}if(5===e.type){var r=ze(e),B=r[0],t=r[1],A=r[2],r=r[3];return ce(B,t,A,r)}if(20===e.type){e=nt[e.value.toUpperCase()];if(void 0!==e)return e}return nt.TRANSPARENT},ze=function(A){if(3===A.value.length){var e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(4===A.value.length){var e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3),B=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(B+B,16)/255]}if(6===A.value.length){e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(8!==A.value.length)return[0,0,0,1];e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6),B=A.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(B,16)/255]},$e=function(A,e){e=e.filter($A);if(Qe(e))throw new Error("Relative color not supported for rgb()");if(3===e.length){var t=e.map(ae),r=t[0],B=t[1],t=t[2];return ce(r,B,t,1)}if(4!==e.length)return 0;e=e.map(ae),r=e[0],B=e[1],t=e[2],e=e[3];return ce(r,B,t,e)},At={srgb:function(A){return ce(ge(Math.round(255*A[0]),0,255),ge(Math.round(255*A[1]),0,255),ge(Math.round(255*A[2]),0,255),ge(A[3],0,1))},"srgb-linear":ue,"display-p3":function(A){var e=pe([A[0],A[1],A[2]]);return le([e[0],e[1],e[2],A[3]])},"a98-rgb":function(A){var e,e=Je((e=function(A){A=A.map(function(A){var e=A<0?-1:1,A=Math.abs(A);return e*Math.pow(A,563/256)});return[A[0],A[1],A[2]]}([A[0],A[1],A[2]]),we([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],e)));return ue([e[0],e[1],e[2],A[3]])},"prophoto-rgb":function(A){var e=He([A[0],A[1],A[2]]);return le([e[0],e[1],e[2],A[3]])},xyz:fe,"xyz-d50":function(A){var e,e=(e=[A[0],A[1],A[2]],Fe([e[0],e[1],e[2]]));return le([e[0],e[1],e[2],A[3]])},"xyz-d65":fe,rec2020:function(A){var e=Ee([A[0],A[1],A[2]]);return le([e[0],e[1],e[2],A[3]])}},et={rgb:function(A,e){var t=e.filter($A);if(3===t.length){var e=t.map(ae),r=e[0],B=e[1],n=e[2],s=Ze([r/255,B/255,n/255]),e=Ye([s[0],s[1],s[2]]);return[e[0],e[1],e[2],1]}if(4!==t.length)return[0,0,0,1];t=t.map(ae),r=t[0],B=t[1],n=t[2],t=t[3],s=Ze([r/255,B/255,n/255]),s=Ye([s[0],s[1],s[2]]);return[s[0],s[1],s[2],t]},hsl:function(A,e){var t=Ue(A,e),r=t[0],A=t[1],e=t[2],t=t[3],e=Ze(Re([r,A,e])),e=Ye([e[0],e[1],e[2]]);return[e[0],e[1],e[2],t]},lab:function(A,e){var t=Ve(e),r=t[0],B=t[1],e=t[2],t=t[3],e=Xe([r,B,e]);return[e[0],e[1],e[2],t]},lch:function(A,e){var t=Oe(e),r=t[0],B=t[1],e=t[2],t=t[3],e=Xe(Ne([r,B,e]));return[e[0],e[1],e[2],t]},oklab:function(A,e){var t=Ve(e),r=t[0],B=t[1],e=t[2],t=t[3],e=Pe([r,B,e]);return[e[0],e[1],e[2],t]},oklch:function(A,e){var t=ke(e),r=t[0],B=t[1],e=t[2],t=t[3],e=Pe(Ne([r,B,e]));return[e[0],e[1],e[2],t]}},tt={srgb:function(A){var e=We(Je([A[0],A[1],A[2]]));return[e[0],e[1],e[2],A[3]]},"srgb-linear":function(A){var e=Je([A[0],A[1],A[2]]),t=e[0],r=e[1],e=e[2];return[ge(Math.round(255*t),0,255),ge(Math.round(255*r),0,255),ge(Math.round(255*e),0,255),A[3]]},"display-p3":function(A){var e,e=(e=[A[0],A[1],A[2]],e=we([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],e),We(e));return[e[0],e[1],e[2],A[3]]},"a98-rgb":function(A){var e,e=function(A){A=A.map(function(A){var e=A<0?-1:1,A=Math.abs(A);return e*Math.pow(A,256/563)});return[A[0],A[1],A[2]]}((e=[A[0],A[1],A[2]],we([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],e)));return[e[0],e[1],e[2],A[3]]},"prophoto-rgb":function(A){var e,e=(e=Ce([A[0],A[1],A[2]]),we([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],e).map(function(A){return 1/512<A?Math.pow(A,1/1.8):16*A}));return[e[0],e[1],e[2],A[3]]},xyz:de,"xyz-d50":function(A){var e=Ce([A[0],A[2],A[3]]);return[e[0],e[1],e[2],A[3]]},"xyz-d65":de,rec2020:function(A){var e,e=(e=[A[0],A[1],A[2]],we([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],e).map(function(A){return qe<=A?_e*Math.pow(A,.45)-(_e-1):4.5*A}));return[e[0],e[1],e[2],A[3]]}},rt={hsl:Ge,hsla:Ge,rgb:$e,rgba:$e,lch:function(A,e){if(Qe(e.filter($A)))throw new Error("Relative color not supported for lch()");var t=Oe(e),r=t[0],B=t[1],e=t[2],t=t[3],e=We(Je(Xe(Ne([r,B,e]))));return ce(ge(Math.round(255*e[0]),0,255),ge(Math.round(255*e[1]),0,255),ge(Math.round(255*e[2]),0,255),t)},oklch:function(A,e){if(Qe(e.filter($A)))throw new Error("Relative color not supported for oklch()");var t=ke(e),r=t[0],B=t[1],e=t[2],t=t[3],e=We(Je(Pe(Ne([r,B,e]))));return ce(ge(Math.round(255*e[0]),0,255),ge(Math.round(255*e[1]),0,255),ge(Math.round(255*e[2]),0,255),t)},oklab:function(A,e){if(Qe(e.filter($A)))throw new Error("Relative color not supported for oklab()");var t=Ve(e),r=t[0],B=t[1],e=t[2],t=t[3],e=We(Je(Pe([r,B,e])));return ce(ge(Math.round(255*e[0]),0,255),ge(Math.round(255*e[1]),0,255),ge(Math.round(255*e[2]),0,255),t)},lab:function(A,e){if(Qe(e.filter($A)))throw new Error("Relative color not supported for lab()");var t=Ve(e),r=t[0],B=t[1],e=t[2],t=t[3],e=We(Je(Xe([r,B,e])));return ce(ge(Math.round(255*e[0]),0,255),ge(Math.round(255*e[1]),0,255),ge(Math.round(255*e[2]),0,255),t)},color:function(A,e){var t=e.filter($A),r=20===t[0].type?t[0].value:"unknown";if(!Qe(t)){var B=At[r];if(void 0===B)throw new Error('Attempting to parse an unsupported color space "'.concat(r,'" for color() function'));return B([c=ZA(t[1])?t[1].number:0,a=ZA(t[2])?t[2].number:0,Q=ZA(t[3])?t[3].number:0,g=4<t.length&&6===t[4].type&&"/"===t[4].value&&ZA(t[5])?t[5].number:1])}function n(A,e){if(ZA(e))return e.number;if(_A(e))return A["r"===(t=e.value)||"x"===t?0:"g"===t||"y"===t?1:2];var n=function(A){for(var e="(",t=0,r=A.filter($A);t<r.length;t++){var B=r[t];e+=18===B.type&&"calc"===B.name?n(B.values):ZA(B)?B.number:6===B.type||_A(B)?B.value:""}return e+=")"};if(18===e.type){var t=e.values.filter($A);if("calc"===e.name){A=n(t).replace(/r|x/,A[0].toString()).replace(/g|y/,A[1].toString()).replace(/b|z/,A[2].toString());return new Function("return "+A)()}}return null}e=18===t[1].type?t[1].name:_A(t[1])||5===t[1].type?"rgb":"unknown",r=_A(t[2])?t[2].value:"unknown",B=18===t[1].type?t[1].values:_A(t[1])?[t[1]]:[];if(_A(t[1])){if(void 0===nt[t[1].value.toUpperCase()])throw new Error("Attempting to use unknown color in relative color 'from'");var s=Bt(A,t[1].value),B=[{type:17,number:255&s>>24,flags:1},{type:17,number:255&s>>16,flags:1},{type:17,number:255&s>>8,flags:1},{type:17,number:1<(i=255&s)?i/255:i,flags:1}]}else 5===t[1].type&&(B=[{type:17,number:(o=ze(t[1]))[0],flags:1},{type:17,number:o[1],flags:1},{type:17,number:o[2],flags:1},{type:17,number:1<(i=o[3])?i/255:i,flags:1}]);if(0===B.length)throw new Error("Attempting to use unknown color in relative color 'from'");if("unknown"===r)throw new Error("Attempting to use unknown colorspace in relative color 'to'");var s=et[e],o=tt[r],i=At[r];if(void 0===s)throw new Error('Attempting to parse an unsupported color space "'.concat(e,'" for color() function'));if(void 0===o)throw new Error('Attempting to parse an unsupported color space "'.concat(r,'" for color() function'));var B=o(s(A,B)),c=n(B,t[3]),a=n(B,t[4]),Q=n(B,t[5]),g=6<t.length&&6===t[6].type&&"/"===t[6].value&&ZA(t[7])?t[7].number:1;if(null===c||null===a||null===Q)throw new Error("Invalid relative color in color() function");return i([c,a,Q,g])}},Bt=function(A,e){return je(A,JA.create(e).parseComponentValue())},nt={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},st={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(_A(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ot={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ge=function(t,A){var r=Te(180),B=[];return Ae(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(r=se(A));if(ne(e))return void(r=(Se(t,e)+Te(270))%Te(360))}A=Ie(t,A);B.push(A)}),{angle:r,stops:B,type:1}},it="closest-side",ct="farthest-side",at="closest-corner",Qt="farthest-corner",gt="ellipse",wt="contain",$e=function(r,A){var B=0,n=3,s=[],o=[];return Ae(A).forEach(function(A,e){var t=!0;0===e?t=A.reduce(function(A,e){if(_A(e))switch(e.value){case"center":return o.push(De),!1;case"top":case"left":return o.push(ve),!1;case"right":case"bottom":return o.push(Me),!1}else if(te(e)||ee(e))return o.push(e),!1;return A},t):1===e&&(t=A.reduce(function(A,e){if(_A(e))switch(e.value){case"circle":return B=0,!1;case gt:return!(B=1);case wt:case it:return n=0,!1;case ct:return!(n=1);case at:return!(n=2);case"cover":case Qt:return!(n=3)}else if(ee(e)||te(e))return(n=!Array.isArray(n)?[]:n).push(e),!1;return A},t)),t&&(A=Ie(r,A),s.push(A))}),{size:n,shape:B,stops:s,position:o,type:2}},ut=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18!==e.type)throw new Error("Unsupported image type ".concat(e.type));t=Ut[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return t(A,e.values)};var lt,Ut={"linear-gradient":function(t,A){var r=Te(180),B=[];return Ae(A).forEach(function(A,e){if(0===e){e=A[0];if(20===e.type&&"to"===e.value)return void(r=se(A));if(ne(e))return void(r=Se(t,e))}A=Ie(t,A);B.push(A)}),{angle:r,stops:B,type:1}},"-moz-linear-gradient":Ge,"-ms-linear-gradient":Ge,"-o-linear-gradient":Ge,"-webkit-linear-gradient":Ge,"radial-gradient":function(B,A){var n=0,s=3,o=[],i=[];return Ae(A).forEach(function(A,e){var t,r=!0;0===e&&(t=!1,r=A.reduce(function(A,e){if(t)if(_A(e))switch(e.value){case"center":return i.push(De),A;case"top":case"left":return i.push(ve),A;case"right":case"bottom":return i.push(Me),A}else(te(e)||ee(e))&&i.push(e);else if(_A(e))switch(e.value){case"circle":return n=0,!1;case gt:return!(n=1);case"at":return!(t=!0);case it:return s=0,!1;case"cover":case ct:return!(s=1);case wt:case at:return!(s=2);case Qt:return!(s=3)}else if(ee(e)||te(e))return(s=!Array.isArray(s)?[]:s).push(e),!1;return A},r)),r&&(A=Ie(B,A),o.push(A))}),{size:s,shape:n,stops:o,position:i,type:2}},"-moz-radial-gradient":$e,"-ms-radial-gradient":$e,"-o-radial-gradient":$e,"-webkit-radial-gradient":$e,"-webkit-gradient":function(r,A){var e=Te(180),B=[],n=1;return Ae(A).forEach(function(A,e){var t,A=A[0];if(0===e){if(_A(A)&&"linear"===A.value)return void(n=1);if(_A(A)&&"radial"===A.value)return void(n=2)}18===A.type&&("from"===A.name?(t=je(r,A.values[0]),B.push({stop:ve,color:t})):"to"===A.name?(t=je(r,A.values[0]),B.push({stop:Me,color:t})):"color-stop"!==A.name||2===(A=A.values.filter($A)).length&&(t=je(r,A[1]),A=A[0],ZA(A)&&B.push({stop:{type:16,number:100*A.number,flags:A.flags},color:t})))}),1===n?{angle:(e+Te(180))%Te(360),stops:B,type:n}:{size:3,shape:0,stops:B,position:[],type:n}}},Ct={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 $A(A)&&!(20===(A=A).type&&"none"===A.value||18===A.type&&!Ut[A.name])}).map(function(A){return ut(e,A)})}},Ft={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(_A(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ht={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(te)}).map(re)}},dt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(_A).map(function(A){return A.value}).join(" ")}).map(ft)}},ft=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};($e=lt=lt||{}).AUTO="auto",$e.CONTAIN="contain";function pt(A,e){return _A(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:te(A)?xe(A,e):e}var Ht,Et,It={name:"background-size",initialValue:"0",prefix:!($e.COVER="cover"),type:1,parse:function(A,e){return Ae(e).map(function(A){return A.filter(yt)})}},yt=function(A){return _A(A)||te(A)},$e=function(A){return{name:"border-".concat(A,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},Kt=$e("top"),mt=$e("right"),Lt=$e("bottom"),bt=$e("left"),$e=function(A){return{name:"border-radius-".concat(A),initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return re(e.filter(te))}}},vt=$e("top-left"),Dt=$e("top-right"),Mt=$e("bottom-right"),xt=$e("bottom-left"),$e=function(A){return{name:"border-".concat(A,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},St=$e("top"),Tt=$e("right"),Gt=$e("bottom"),Ot=$e("left"),$e=function(A){return{name:"border-".concat(A,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:0}}},Vt=$e("top"),kt=$e("right"),Rt=$e("bottom"),Nt=$e("left"),Pt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Xt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"!==e?0:1}},Jt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).reduce(function(A,e){return A|Yt(e.value)},0)}},Yt=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},Wt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Zt={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}},_t={name:"line-break",initialValue:($e=Ht=Ht||{}).NORMAL="normal",prefix:!($e.STRICT="strict"),type:2,parse:function(A,e){return"strict"!==e?Ht.NORMAL:Ht.STRICT}},qt={name:"line-height",initialValue:"normal",prefix:!1,type:4},jt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:ut(A,e)}},zt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"!==e?1:0}},$t={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},$e=function(A){return{name:"margin-".concat(A),initialValue:"0",prefix:!1,type:4}},Ar=$e("top"),er=$e("right"),tr=$e("bottom"),rr=$e("left"),Br={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},nr={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"!==e?"normal":"break-word"}},$e=function(A){return{name:"padding-".concat(A),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},sr=$e("top"),or=$e("right"),ir=$e("bottom"),cr=$e("left"),ar={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Qr={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},gr={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&jA(A[0],"none")?[]:Ae(A).map(function(A){for(var e={color:nt.TRANSPARENT,offsetX:ve,offsetY:ve,blur:ve},t=0,r=0;r<A.length;r++){var B=A[r];ee(B)?(0===t?e.offsetX=B:1===t?e.offsetY=B:e.blur=B,t++):e.color=je(n,B)}return e})}},wr={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},ur={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=lr[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}},lr={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],r=e[1];e[2],e[3];var B=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,r,B,n,s,A]:null}},$e={type:16,number:50,flags:4},Ur=[$e,$e],Cr={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){e=e.filter(te);return 2!==e.length?Ur:[e[0],e[1]]}},Fr={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};($e=Et=Et||{}).NORMAL="normal",$e.BREAK_ALL="break-all";function hr(A,e){return 0!=(A&e)}function dr(A,e,t){return(A=A&&A[Math.min(e,A.length-1)])?t?A.open:A.close:""}var fr={name:"word-break",initialValue:"normal",prefix:!($e.KEEP_ALL="keep-all"),type:2,parse:function(A,e){switch(e){case"break-all":return Et.BREAK_ALL;case"keep-all":return Et.KEEP_ALL;default:return Et.NORMAL}}},pr={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(ZA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Hr=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")},Er={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return ZA(e)?e.number:1}},Ir={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},yr={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).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})}},Kr={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],r=[];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:r.push(t.join(" ")),t.length=0}}),t.length&&r.push(t.join(" ")),r.map(function(A){return-1===A.indexOf(" ")?A:"'".concat(A,"'")})}},mr={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},Lr={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return ZA(e)?e.number:!_A(e)||"bold"!==e.value?400:700}},br={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(_A).map(function(A){return A.value})}},vr={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},Dr={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}},Mr={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 r=[],B=e.filter(zA),n=0;n<B.length;n++){var s=B[n],o=B[n+1];20===s.type&&(o=o&&ZA(o)?o.number:1,r.push({counter:s.value,increment:o}))}return r}},xr={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],r=e.filter(zA),B=0;B<r.length;B++){var n=r[B],s=r[B+1];_A(n)&&"none"!==n.value&&(s=s&&ZA(s)?s.number:0,t.push({counter:n.value,reset:s}))}return t}},Sr={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,A){return A.filter(WA).map(function(A){return Hr(e,A)})}},Tr={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 r=[],B=e.filter(qA);if(B.length%2!=0)return null;for(var n=0;n<B.length;n+=2){var s=B[n].value,o=B[n+1].value;r.push({open:s,close:o})}return r}},Gr={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&jA(A[0],"none")?[]:Ae(A).map(function(A){for(var e={color:255,offsetX:ve,offsetY:ve,blur:ve,spread:ve,inset:!1},t=0,r=0;r<A.length;r++){var B=A[r];jA(B,"inset")?e.inset=!0:ee(B)?(0===t?e.offsetX=B:1===t?e.offsetY=B:2===t?e.blur=B:e.spread=B,t++):e.color=je(n,B)}return e})}},Or={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(_A).forEach(function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(A){-1===t.indexOf(A)&&t.push(A)}),t}},Vr={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},kr={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:0}},Rr={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(A,e){return e.filter(_A).reduce(function(A,e){return A|Nr(e.value)},0)}},Nr=function(A){switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},Pr=(Xr.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&0===this.visibility},Xr.prototype.isTransparent=function(){return oe(this.backgroundColor)},Xr.prototype.isTransformed=function(){return null!==this.transform},Xr.prototype.isPositioned=function(){return 0!==this.position},Xr.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},Xr.prototype.isFloating=function(){return 0!==this.float},Xr.prototype.isInlineLevel=function(){return hr(this.display,4)||hr(this.display,33554432)||hr(this.display,268435456)||hr(this.display,536870912)||hr(this.display,67108864)||hr(this.display,134217728)},Xr);function Xr(A,e){this.animationDuration=Wr(A,Sr,e.animationDuration),this.backgroundClip=Wr(A,st,e.backgroundClip),this.backgroundColor=Wr(A,ot,e.backgroundColor),this.backgroundImage=Wr(A,Ct,e.backgroundImage),this.backgroundOrigin=Wr(A,Ft,e.backgroundOrigin),this.backgroundPosition=Wr(A,ht,e.backgroundPosition),this.backgroundRepeat=Wr(A,dt,e.backgroundRepeat),this.backgroundSize=Wr(A,It,e.backgroundSize),this.borderTopColor=Wr(A,Kt,e.borderTopColor),this.borderRightColor=Wr(A,mt,e.borderRightColor),this.borderBottomColor=Wr(A,Lt,e.borderBottomColor),this.borderLeftColor=Wr(A,bt,e.borderLeftColor),this.borderTopLeftRadius=Wr(A,vt,e.borderTopLeftRadius),this.borderTopRightRadius=Wr(A,Dt,e.borderTopRightRadius),this.borderBottomRightRadius=Wr(A,Mt,e.borderBottomRightRadius),this.borderBottomLeftRadius=Wr(A,xt,e.borderBottomLeftRadius),this.borderTopStyle=Wr(A,St,e.borderTopStyle),this.borderRightStyle=Wr(A,Tt,e.borderRightStyle),this.borderBottomStyle=Wr(A,Gt,e.borderBottomStyle),this.borderLeftStyle=Wr(A,Ot,e.borderLeftStyle),this.borderTopWidth=Wr(A,Vt,e.borderTopWidth),this.borderRightWidth=Wr(A,kt,e.borderRightWidth),this.borderBottomWidth=Wr(A,Rt,e.borderBottomWidth),this.borderLeftWidth=Wr(A,Nt,e.borderLeftWidth),this.boxShadow=Wr(A,Gr,e.boxShadow),this.color=Wr(A,Pt,e.color),this.direction=Wr(A,Xt,e.direction),this.display=Wr(A,Jt,e.display),this.float=Wr(A,Wt,e.cssFloat),this.fontFamily=Wr(A,Kr,e.fontFamily),this.fontSize=Wr(A,mr,e.fontSize),this.fontStyle=Wr(A,vr,e.fontStyle),this.fontVariant=Wr(A,br,e.fontVariant),this.fontWeight=Wr(A,Lr,e.fontWeight),this.letterSpacing=Wr(A,Zt,e.letterSpacing),this.lineBreak=Wr(A,_t,e.lineBreak),this.lineHeight=Wr(A,qt,e.lineHeight),this.listStyleImage=Wr(A,jt,e.listStyleImage),this.listStylePosition=Wr(A,zt,e.listStylePosition),this.listStyleType=Wr(A,$t,e.listStyleType),this.marginTop=Wr(A,Ar,e.marginTop),this.marginRight=Wr(A,er,e.marginRight),this.marginBottom=Wr(A,tr,e.marginBottom),this.marginLeft=Wr(A,rr,e.marginLeft),this.opacity=Wr(A,Er,e.opacity);var t=Wr(A,Br,e.overflow);this.overflowX=t[0],this.overflowY=t[1<t.length?1:0],this.overflowWrap=Wr(A,nr,e.overflowWrap),this.paddingTop=Wr(A,sr,e.paddingTop),this.paddingRight=Wr(A,or,e.paddingRight),this.paddingBottom=Wr(A,ir,e.paddingBottom),this.paddingLeft=Wr(A,cr,e.paddingLeft),this.paintOrder=Wr(A,Or,e.paintOrder),this.position=Wr(A,Qr,e.position),this.textAlign=Wr(A,ar,e.textAlign),this.textDecorationColor=Wr(A,Ir,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Wr(A,yr,null!==(t=e.textDecorationLine)&&void 0!==t?t:e.textDecoration),this.textShadow=Wr(A,gr,e.textShadow),this.textTransform=Wr(A,wr,e.textTransform),this.transform=Wr(A,ur,e.transform),this.transformOrigin=Wr(A,Cr,e.transformOrigin),this.visibility=Wr(A,Fr,e.visibility),this.webkitTextStrokeColor=Wr(A,Vr,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Wr(A,kr,e.webkitTextStrokeWidth),this.wordBreak=Wr(A,fr,e.wordBreak),this.zIndex=Wr(A,pr,e.zIndex),this.objectFit=Wr(A,Rr,e.objectFit)}for(var Jr=function(A,e){this.content=Wr(A,Dr,e.content),this.quotes=Wr(A,Tr,e.quotes)},Yr=function(A,e){this.counterIncrement=Wr(A,Mr,e.counterIncrement),this.counterReset=Wr(A,xr,e.counterReset)},Wr=function(A,e,t){var r=new PA,t=null!=t?t.toString():e.initialValue;r.write(t);var B=new JA(r.read());switch(e.type){case 2:var n=B.parseComponentValue();return e.parse(A,_A(n)?n.value:e.initialValue);case 0:return e.parse(A,B.parseComponentValue());case 1:return e.parse(A,B.parseComponentValues());case 4:return B.parseComponentValue();case 3:switch(e.format){case"angle":return Se(A,B.parseComponentValue());case"color":return je(A,B.parseComponentValue());case"image":return ut(A,B.parseComponentValue());case"length":var s=B.parseComponentValue();return ee(s)?s:ve;case"length-percentage":s=B.parseComponentValue();return te(s)?s:ve;case"time":return Hr(A,B.parseComponentValue())}}},Zr=function(A,e){A=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===A||e===A},_r=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Zr(e,3),this.styles=new Pr(A,window.getComputedStyle(e,null)),En(e)&&(this.styles.animationDuration.some(function(A){return 0<A})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=f(this.context,e),Zr(e,4)&&(this.flags|=16)},qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zr=0;zr<qr.length;zr++)jr[qr.charCodeAt(zr)]=zr;function $r(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var AB=(eB.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},eB);function eB(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}for(var tB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rB="undefined"==typeof Uint8Array?[]:new Uint8Array(256),BB=0;BB<tB.length;BB++)rB[tB.charCodeAt(BB)]=BB;function nB(A){return FB.get(A)}function sB(A){var t=function(A){for(var e=[],t=0,r=A.length;t<r;){var B,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<r?56320==(64512&(B=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--):e.push(n)}return e}(A),r=t.length,B=0,n=0,s=t.map(nB);return{next:function(){if(r<=B)return{done:!0,value:null};for(var A=hB;B<r&&(A=function(A,e){var t=e-2,r=A[t],B=A[e-1],e=A[e];if(2===B&&3===e)return hB;if(2===B||3===B||4===B)return"÷";if(2===e||3===e||4===e)return"÷";if(B===uB&&-1!==[uB,lB,UB,CB].indexOf(e))return hB;if(!(B!==UB&&B!==lB||e!==lB&&10!==e))return hB;if((B===CB||10===B)&&10===e)return hB;if(13===e||5===e)return hB;if(7===e)return hB;if(1===B)return hB;if(13===B&&14===e){for(;5===r;)r=A[--t];if(14===r)return hB}if(15===B&&15===e){for(var n=0;15===r;)n++,r=A[--t];if(n%2==0)return hB}return"÷"}(s,++B))===hB;);if(A===hB&&B!==r)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 r=[],B=-1,n="";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(B+1===t||16384<r.length)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n}.apply(null,t.slice(n,B));return n=B,{value:e,done:!1}}}}function oB(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var iB,cB,aB,QB,gB,wB,uB=8,lB=9,UB=11,CB=12,FB=(aB=function(A){var e,t,r,B,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),c=0;c<s;c+=4)e=jr[A.charCodeAt(c)],t=jr[A.charCodeAt(c+1)],r=jr[A.charCodeAt(c+2)],B=jr[A.charCodeAt(c+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|r>>2,i[o++]=(3&r)<<6|63&B;return n}(iB=" "),QB=Array.isArray(aB)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(aB):new Uint32Array(aB),gB=Array.isArray(aB)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(aB):new Uint16Array(aB),iB=$r(gB,12,QB[4]/2),cB=2===QB[5]?$r(gB,(24+QB[4])/2):(aB=QB,gB=Math.ceil((24+QB[4])/4),aB.slice?aB.slice(gB,cB):new Uint32Array(Array.prototype.slice.call(aB,gB,cB))),new AB(QB[0],QB[1],QB[2],QB[3],iB,cB)),hB="×",dB=function(A,e,t,r,B){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",r.toString()),n.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(n),n.appendChild(B),s},fB=function(r){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,".concat(encodeURIComponent((new XMLSerializer).serializeToString(r)))})},pB={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="".concat(123,"px"),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(pB,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=pB.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 r=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var B=e.firstChild,t=a(B.data).map(function(A){return Q(A)}),n=0,s={},t=t.every(function(A,e){r.setStart(B,n),r.setEnd(B,n+A.length);var t=r.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(pB,"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(pB,"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"),r=100;A.width=r,A.height=r;var B=A.getContext("2d");if(!B)return Promise.reject(!1);B.fillStyle="rgb(0, 255, 0)",B.fillRect(0,0,r,r);var e=new Image,n=A.toDataURL();e.src=n;e=dB(r,r,0,0,e);return B.fillStyle="red",B.fillRect(0,0,r,r),fB(e).then(function(A){B.drawImage(A,0,0);var e=B.getImageData(0,0,r,r).data;B.fillStyle="red",B.fillRect(0,0,r,r);A=t.createElement("div");return A.style.backgroundImage="url(".concat(n,")"),A.style.height="".concat(r,"px"),oB(e)?fB(dB(r,r,0,0,A)):Promise.reject(!1)}).then(function(A){return B.drawImage(A,0,0),oB(B.getImageData(0,0,r,r).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(pB,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(pB,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(pB,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(pB,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(pB,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},HB=function(A,e){this.text=A,this.bounds=e},EB=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));t=e.parentNode;if(t){t.replaceChild(r,e);A=f(A,r);return r.firstChild&&t.replaceChild(r.firstChild,r),A}}return d.EMPTY},IB=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");r=r.createRange();return r.setStart(A,e),r.setEnd(A,e+t),r},yB=function(A){if(pB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(function(A){return A.segment})}return function(A){for(var e,t=sB(A),r=[];!(e=t.next()).done;)e.value&&r.push(e.value.slice());return r}(A)},KB=function(A,e){return 0!==e.letterSpacing?yB(A):function(A,e){if(pB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(function(A){return A.segment})}return LB(A,e)}(A,e)},mB=[32,160,4961,65792,65793,4153,4241],LB=function(A,e){for(var t,r=wA(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),B=[];!(t=r.next()).done;)!function(){var A,e;t.value&&(A=t.value.slice(),A=a(A),e="",A.forEach(function(A){-1===mB.indexOf(A)?e+=Q(A):(e.length&&B.push(e),B.push(Q(A)),e="")}),e.length&&B.push(e))}();return B},bB=function(A,e,t){var B,n,s,o,i;this.text=vB(e.data,t.textTransform),this.textBounds=(B=A,A=this.text,s=e,A=KB(A,n=t),o=[],i=0,A.forEach(function(A){var e,t,r;n.textDecorationLine.length||0<A.trim().length?pB.SUPPORT_RANGE_BOUNDS?1<(r=IB(s,i,A.length).getClientRects()).length?(e=yB(A),t=0,e.forEach(function(A){o.push(new HB(A,d.fromDOMRectList(B,IB(s,t+i,A.length).getClientRects()))),t+=A.length})):o.push(new HB(A,d.fromDOMRectList(B,r))):(r=s.splitText(A.length),o.push(new HB(A,EB(B,s))),s=r):pB.SUPPORT_RANGE_BOUNDS||(s=s.splitText(A.length)),i+=A.length}),o)},vB=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(DB,MB);case 2:return A.toUpperCase();default:return A}},DB=/(^|\s|:|-|\(|\))([a-z])/g,MB=function(A,e,t){return 0<A.length?e+t.toUpperCase():A},xB=(A(SB,wB=_r),SB);function SB(A,e){A=wB.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 TB,GB=(A(OB,TB=_r),OB);function OB(A,e){A=TB.call(this,A,e)||this;return A.canvas=e,A.intrinsicWidth=e.width,A.intrinsicHeight=e.height,A}var VB,kB=(A(RB,VB=_r),RB);function RB(A,e){var t=VB.call(this,A,e)||this,r=new XMLSerializer,A=f(A,e);return e.setAttribute("width","".concat(A.width,"px")),e.setAttribute("height","".concat(A.height,"px")),t.svg="data:image/svg+xml,".concat(encodeURIComponent(r.serializeToString(e))),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,t.context.cache.addImage(t.svg),t}var NB,PB=(A(XB,NB=_r),XB);function XB(A,e){A=NB.call(this,A,e)||this;return A.value=e.value,A}var JB,YB=(A(WB,JB=_r),WB);function WB(A,e){A=JB.call(this,A,e)||this;return A.start=e.start,A.reversed="boolean"==typeof e.reversed&&!0===e.reversed,A}var ZB,_B=[{type:15,flags:0,unit:"px",number:3}],qB=[{type:16,flags:0,number:50}],jB="checkbox",zB="radio",$B="password",An=707406591,en=(A(tn,ZB=_r),tn);function tn(A,e){var t=ZB.call(this,A,e)||this;switch(t.type=e.type.toLowerCase(),t.checked=e.checked,t.value=0===(e=(A=e).type===$B?new Array(A.value.length+1).join("•"):A.value).length?A.placeholder||"":e,t.type!==jB&&t.type!==zB||(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=1,t.styles.backgroundClip=[0],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 jB:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=_B;break;case zB:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=qB}return t}var rn,Bn=(A(nn,rn=_r),nn);function nn(A,e){A=rn.call(this,A,e)||this,e=e.options[e.selectedIndex||0];return A.value=e&&e.text||"",A}var sn,on=(A(cn,sn=_r),cn);function cn(A,e){A=sn.call(this,A,e)||this;return A.value=e.value,A}var an,Qn=(A(gn,an=_r),gn);function gn(A,e){var t,r,B=an.call(this,A,e)||this;B.src=e.src,B.width=parseInt(e.width,10)||0,B.height=parseInt(e.height,10)||0,B.backgroundColor=B.styles.backgroundColor;try{e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&(B.tree=hn(A,e.contentWindow.document.documentElement),t=e.contentWindow.document.documentElement?Bt(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):nt.TRANSPARENT,r=e.contentWindow.document.body?Bt(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):nt.TRANSPARENT,B.backgroundColor=oe(t)?oe(r)?B.styles.backgroundColor:r:t)}catch(A){}return B}function wn(A){return"VIDEO"===A.tagName}function un(A){return"STYLE"===A.tagName}function ln(A){return 0<A.tagName.indexOf("-")}var Un=["OL","UL","MENU"],Cn=function(e,A,t,r){for(var B=A.firstChild;B;B=s){var n,s=B.nextSibling;pn(B)&&0<B.data.length?t.textNodes.push(new bB(e,B,t.styles)):Hn(B)&&(Tn(B)&&B.assignedNodes?B.assignedNodes().forEach(function(A){return Cn(e,A,t,r)}):(n=Fn(e,B)).styles.isVisible()&&(dn(B,n,r)?n.flags|=4:fn(n.styles)&&(n.flags|=2),-1!==Un.indexOf(B.tagName)&&(n.flags|=8),t.elements.push(n),B.slot,B.shadowRoot?Cn(e,B.shadowRoot,n,r):xn(B)||Ln(B)||Sn(B)||Cn(e,B,n,r)))}},Fn=function(A,e){return new(Dn(e)?xB:vn(e)?GB:Ln(e)?kB:yn(e)?PB:Kn(e)?YB:mn(e)?en:Sn(e)?Bn:xn(e)?on:Mn(e)?Qn:_r)(A,e)},hn=function(A,e){var t=Fn(A,e);return t.flags|=4,Cn(A,e,t,t),t},dn=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||bn(A)&&t.styles.isTransparent()},fn=function(A){return A.isPositioned()||A.isFloating()},pn=function(A){return A.nodeType===Node.TEXT_NODE},Hn=function(A){return A.nodeType===Node.ELEMENT_NODE},En=function(A){return Hn(A)&&void 0!==A.style&&!In(A)},In=function(A){return"object"==typeof A.className},yn=function(A){return"LI"===A.tagName},Kn=function(A){return"OL"===A.tagName},mn=function(A){return"INPUT"===A.tagName},Ln=function(A){return"svg"===A.tagName},bn=function(A){return"BODY"===A.tagName},vn=function(A){return"CANVAS"===A.tagName},Dn=function(A){return"IMG"===A.tagName},Mn=function(A){return"IFRAME"===A.tagName},xn=function(A){return"TEXTAREA"===A.tagName},Sn=function(A){return"SELECT"===A.tagName},Tn=function(A){return"SLOT"===A.tagName},Gn=(On.prototype.getCounterValue=function(A){A=this.counters[A];return A&&A.length?A[A.length-1]:1},On.prototype.getCounterValues=function(A){A=this.counters[A];return A||[]},On.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},On.prototype.parse=function(A){var t=this,e=A.counterIncrement,A=A.counterReset,r=!0;null!==e&&e.forEach(function(A){var e=t.counters[A.counter];e&&0!==A.increment&&(r=!1,e.length||e.push(1),e[Math.max(0,e.length-1)]+=A.increment)});var B=[];return r&&A.forEach(function(A){var e=t.counters[A.counter];B.push(A.counter),(e=e||(t.counters[A.counter]=[])).push(A.reset)}),B},On);function On(){this.counters={}}function Vn(r,A,e,B,t,n){return r<A||e<r?qn(r,t,0<n.length):B.integers.reduce(function(A,e,t){for(;e<=r;)r-=e,A+=B.values[t];return A},"")+n}function kn(A,e,t,r){for(var B="";t||A--,B=r(A)+B,e<=(A/=e)*e;);return B}function Rn(A,e,t,r,B){var n=t-e+1;return(A<0?"-":"")+(kn(Math.abs(A),n,r,function(A){return Q(Math.floor(A%n)+e)})+B)}function Nn(A,e,t){void 0===t&&(t=". ");var r=e.length;return kn(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t}function Pn(A,e,t,r,B,n){if(A<-9999||9999<A)return qn(A,4,0<B.length);var s=Math.abs(A),o=B;if(0===s)return e[0]+o;for(var i=0;0<s&&i<=4;i++){var c=s%10;0==c&&hr(n,1)&&""!==o?o=e[c]+o:1<c||1==c&&0===i||1==c&&1===i&&hr(n,2)||1==c&&1===i&&hr(n,4)&&100<A||1==c&&1<i&&hr(n,8)?o=e[c]+(0<i?t[i-1]:"")+o:1==c&&0<i&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o}var Xn,Jn={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"]},Yn={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Wn={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Zn={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},_n="마이너스",qn=function(A,e,t){var r=t?". ":"",B=t?"、":"",n=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=Rn(A,48,57,!0,r);return o.length<4?"0".concat(o):o;case 4:return Nn(A,"〇一二三四五六七八九",B);case 6:return Vn(A,1,3999,Jn,3,r).toLowerCase();case 7:return Vn(A,1,3999,Jn,3,r);case 8:return Rn(A,945,969,!1,r);case 9:return Rn(A,97,122,!1,r);case 10:return Rn(A,65,90,!1,r);case 11:return Rn(A,1632,1641,!0,r);case 12:case 49:return Vn(A,1,9999,Yn,3,r);case 35:return Vn(A,1,9999,Yn,3,r).toLowerCase();case 13:return Rn(A,2534,2543,!0,r);case 14:case 30:return Rn(A,6112,6121,!0,r);case 15:return Nn(A,"子丑寅卯辰巳午未申酉戌亥",B);case 16:return Nn(A,"甲乙丙丁戊己庚辛壬癸",B);case 17:case 48:return Pn(A,"零一二三四五六七八九","十百千萬","負",B,14);case 47:return Pn(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",B,15);case 42:return Pn(A,"零一二三四五六七八九","十百千萬","负",B,14);case 41:return Pn(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",B,15);case 26:return Pn(A,"〇一二三四五六七八九","十百千万","マイナス",B,0);case 25:return Pn(A,"零壱弐参四伍六七八九","拾百千万","マイナス",B,7);case 31:return Pn(A,"영일이삼사오육칠팔구","십백천만",_n,n,7);case 33:return Pn(A,"零一二三四五六七八九","十百千萬",_n,n,0);case 32:return Pn(A,"零壹貳參四五六七八九","拾百千",_n,n,7);case 18:return Rn(A,2406,2415,!0,r);case 20:return Vn(A,1,19999,Zn,3,r);case 21:return Rn(A,2790,2799,!0,r);case 22:return Rn(A,2662,2671,!0,r);case 22:return Vn(A,1,10999,Wn,3,r);case 23:return Nn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Nn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Rn(A,3302,3311,!0,r);case 28:return Nn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",B);case 29:return Nn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",B);case 34:return Rn(A,3792,3801,!0,r);case 37:return Rn(A,6160,6169,!0,r);case 38:return Rn(A,4160,4169,!0,r);case 39:return Rn(A,2918,2927,!0,r);case 40:return Rn(A,1776,1785,!0,r);case 43:return Rn(A,3046,3055,!0,r);case 44:return Rn(A,3174,3183,!0,r);case 45:return Rn(A,3664,3673,!0,r);case 46:return Rn(A,3872,3881,!0,r);default:return Rn(A,48,57,!0,r)}},jn="data-html2canvas-ignore",zn=($n.prototype.toIFrame=function(A,r){var e=this,B=es(A,r);if(!B.contentWindow)return Promise.reject("Unable to find iframe window");var t=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,s=B.contentWindow,o=s.document,i=rs(B).then(function(){return c(e,void 0,void 0,function(){var e,t;return p(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(is),s&&(s.scrollTo(r.left,r.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===r.top&&s.scrollX===r.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-r.left,s.scrollY-r.top,0,0))),e=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the ".concat(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,ts(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 B})]:[2,B]}})})}),A=o.adoptNode(this.documentElement);return us(A,o),o.open(),o.write("".concat(ss(document.doctype),"<html></html>")),os(this.referenceElement.ownerDocument,t,n),o.replaceChild(A,o.documentElement),o.close(),i},$n.prototype.createElementClone=function(A){if(Zr(A,2),vn(A))return this.createCanvasClone(A);if(wn(A))return this.createVideoClone(A);if(un(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Dn(e)&&(Dn(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),ln(e)?this.createCustomElementClone(e):e},$n.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return ns(A.style,e),e},$n.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},$n.prototype.createCanvasClone=function(e){var A;if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(A){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}t=e.cloneNode(!1);try{t.width=e.width,t.height=e.height;var r,B,n=e.getContext("2d"),s=t.getContext("2d",{willReadFrequently:!0});return s&&(!this.options.allowTaint&&n?s.putImageData(n.getImageData(0,0,e.width,e.height),0,0):(!(r=null!==(A=e.getContext("webgl2"))&&void 0!==A?A:e.getContext("webgl"))||!1===(null==(B=r.getContextAttributes())?void 0:B.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e),s.drawImage(e,0,0))),t}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return t},$n.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext("2d");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info("Unable to clone video as it is tainted",e)}A=e.ownerDocument.createElement("canvas");return A.width=e.offsetWidth,A.height=e.offsetHeight,A},$n.prototype.appendChildNode=function(A,e,t){Hn(e)&&("SCRIPT"===e.tagName||e.hasAttribute(jn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Hn(e)&&un(e)||A.appendChild(this.cloneNode(e,t))},$n.prototype.cloneChildNodes=function(A,e,t){for(var r,B=this,n=(A.shadowRoot||A).firstChild;n;n=n.nextSibling)Hn(n)&&Tn(n)&&"function"==typeof n.assignedNodes?(r=n.assignedNodes()).length&&r.forEach(function(A){return B.appendChildNode(e,A,t)}):this.appendChildNode(e,n,t)},$n.prototype.cloneNode=function(A,e){if(pn(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Hn(A)&&(En(A)||In(A))){var r=this.createElementClone(A);r.style.transitionProperty="none";var B=t.getComputedStyle(A),n=t.getComputedStyle(A,":before"),s=t.getComputedStyle(A,":after");this.referenceElement===A&&En(r)&&(this.clonedReferenceElement=r),bn(r)&&gs(r);t=this.counters.parse(new Yr(this.context,B)),n=this.resolvePseudoContent(A,r,n,Xn.BEFORE);ln(A)&&(e=!0),wn(A)||this.cloneChildNodes(A,r,e),n&&r.insertBefore(n,r.firstChild);s=this.resolvePseudoContent(A,r,s,Xn.AFTER);return s&&r.appendChild(s),this.counters.pop(t),(B&&(this.options.copyStyles||In(A))&&!Mn(A)||e)&&ns(B,r),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(xn(A)||Sn(A))&&(xn(r)||Sn(r))&&(r.value=A.value),r}return A.cloneNode(!1)},$n.prototype.resolvePseudoContent=function(o,A,e,t){var i=this;if(e){var r=e.content,c=A.ownerDocument;if(c&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==e.display){this.counters.parse(new Yr(this.context,e));var a=new Jr(this.context,e),Q=c.createElement("html2canvaspseudoelement");ns(e,Q),a.content.forEach(function(A){if(0===A.type)Q.appendChild(c.createTextNode(A.value));else if(22===A.type){var e=c.createElement("img");e.src=A.value,e.style.opacity="1",Q.appendChild(e)}else if(18===A.type){var t,r,B,n,s;"attr"===A.name?(e=A.values.filter(_A)).length&&Q.appendChild(c.createTextNode(o.getAttribute(e[0].value)||"")):"counter"===A.name?(B=(r=A.values.filter($A))[0],r=r[1],B&&_A(B)&&(t=i.counters.getCounterValue(B.value),s=r&&_A(r)?$t.parse(i.context,r.value):3,Q.appendChild(c.createTextNode(qn(t,s,!1))))):"counters"===A.name&&(B=(t=A.values.filter($A))[0],s=t[1],r=t[2],B&&_A(B)&&(B=i.counters.getCounterValues(B.value),n=r&&_A(r)?$t.parse(i.context,r.value):3,s=s&&0===s.type?s.value:"",s=B.map(function(A){return qn(A,n,!1)}).join(s),Q.appendChild(c.createTextNode(s))))}else if(20===A.type)switch(A.value){case"open-quote":Q.appendChild(c.createTextNode(dr(a.quotes,i.quoteDepth++,!0)));break;case"close-quote":Q.appendChild(c.createTextNode(dr(a.quotes,--i.quoteDepth,!1)));break;default:Q.appendChild(c.createTextNode(A.value))}}),Q.className="".concat(cs," ").concat(as);t=t===Xn.BEFORE?" ".concat(cs):" ".concat(as);return In(A)?A.className.baseValue+=t:A.className+=t,Q}}},$n.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},$n);function $n(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Gn,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}($e=Xn=Xn||{})[$e.BEFORE=0]="BEFORE",$e[$e.AFTER=1]="AFTER";function As(e){return new Promise(function(A){!e.complete&&e.src?(e.onload=A,e.onerror=A):A()})}var es=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(jn,"true"),A.body.appendChild(t),t},ts=function(A){return Promise.all([].slice.call(A.images,0).map(As))},rs=function(B){return new Promise(function(e,A){var t=B.contentWindow;if(!t)return A("No window assigned for iframe");var r=t.document;t.onload=B.onload=function(){t.onload=B.onload=null;var A=setInterval(function(){0<r.body.childNodes.length&&"complete"===r.readyState&&(clearInterval(A),e(B))},50)}})},Bs=["all","d","content"],ns=function(A,e){for(var t=A.length-1;0<=t;t--){var r=A.item(t);-1===Bs.indexOf(r)&&e.style.setProperty(r,A.getPropertyValue(r))}return e},ss=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'.concat(A.publicId,'"')),A.systemId&&(e+='"'.concat(A.systemId,'"')),e+=">"),e},os=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},is=function(A){var e=A[0],t=A[1],A=A[2];e.scrollLeft=t,e.scrollTop=A},cs="___html2canvas___pseudoelement_before",as="___html2canvas___pseudoelement_after",Qs='{\n    content: "" !important;\n    display: none !important;\n}',gs=function(A){ws(A,".".concat(cs).concat(":before").concat(Qs,"\n         .").concat(as).concat(":after").concat(Qs))},ws=function(A,e){var t=A.ownerDocument;t&&((t=t.createElement("style")).textContent=e,A.appendChild(t))},us=function(A,e){var t=e.createElement("base");t.href=e.baseURI;var A=A.getElementsByTagName("head").item(0);null!=A&&A.insertBefore(t,null!==(A=null==A?void 0:A.firstChild)&&void 0!==A?A:null)},ls=(Us.getOrigin=function(A){var e=Us._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},Us.isSameOrigin=function(A){return Us.getOrigin(A)===Us._origin},Us.setContext=function(A){Us._link=A.document.createElement("a"),Us._origin=Us.getOrigin(A.location.href)},Us._origin="about:blank",Us);function Us(){}var Cs=(Fs.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Is(A)||ps(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},Fs.prototype.match=function(A){return this._cache[A]},Fs.prototype.loadImage=function(s){return c(this,void 0,void 0,function(){var e,r,t,B,n=this;return p(this,function(A){switch(A.label){case 0:return(e=ls.isSameOrigin(s),r=!Hs(s)&&!0===this._options.useCORS&&pB.SUPPORT_CORS_IMAGES&&!e,t=!Hs(s)&&!e&&!Is(s)&&"string"==typeof this._options.proxy&&pB.SUPPORT_CORS_XHR&&!r,e||!1!==this._options.allowTaint||Hs(s)||Is(s)||t||r)?(B=s,t?[4,this.proxy(B)]:[3,2]):[2];case 1:B=A.sent(),A.label=2;case 2:return this.context.logger.debug("Added image ".concat(s.substring(0,256))),[4,new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(Es(B)||r)&&(t.crossOrigin="anonymous"),t.src=B,!0===t.complete&&setTimeout(function(){return A(t)},500),0<n._options.imageTimeout&&setTimeout(function(){return e("Timed out (".concat(n._options.imageTimeout,"ms) loading image"))},n._options.imageTimeout)})];case 3:return[2,A.sent()]}})})},Fs.prototype.has=function(A){return void 0!==this._cache[A]},Fs.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Fs.prototype.proxy=function(s){var o=this,i=this._options.proxy;if(!i)throw new Error("No proxy defined");var c=s.substring(0,256);return new Promise(function(e,t){var r=pB.SUPPORT_RESPONSE_TYPE?"blob":"text",B=new XMLHttpRequest;B.onload=function(){var A;200===B.status?"text"==r?e(B.response):((A=new FileReader).addEventListener("load",function(){return e(A.result)},!1),A.addEventListener("error",function(A){return t(A)},!1),A.readAsDataURL(B.response)):t("Failed to proxy resource ".concat(c," with status code ").concat(B.status))},B.onerror=t;var A,n=-1<i.indexOf("?")?"&":"?";B.open("GET","".concat(i).concat(n,"url=").concat(encodeURIComponent(s),"&responseType=").concat(r)),"text"!=r&&B instanceof XMLHttpRequest&&(B.responseType=r),o._options.imageTimeout&&(A=o._options.imageTimeout,B.timeout=A,B.ontimeout=function(){return t("Timed out (".concat(A,"ms) proxying ").concat(c))}),B.send()})},Fs);function Fs(A,e){this.context=A,this._options=e,this._cache={}}var hs=/^data:image\/svg\+xml/i,ds=/^data:image\/.*;base64,/i,fs=/^data:image\/.*/i,ps=function(A){return pB.SUPPORT_SVG_DRAWING||!ys(A)},Hs=function(A){return fs.test(A)},Es=function(A){return ds.test(A)},Is=function(A){return"blob"===A.substr(0,4)},ys=function(A){return"svg"===A.substr(-3).toLowerCase()||hs.test(A)},Ks=(ms.prototype.add=function(A,e){return new ms(this.x+A,this.y+e)},ms);function ms(A,e){this.type=0,this.x=A,this.y=e}function Ls(A,e,t){return new Ks(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var bs=(vs.prototype.subdivide=function(A,e){var t=Ls(this.start,this.startControl,A),r=Ls(this.startControl,this.endControl,A),B=Ls(this.endControl,this.end,A),n=Ls(t,r,A),r=Ls(r,B,A),A=Ls(n,r,A);return e?new vs(this.start,t,n,A):new vs(A,r,B,this.end)},vs.prototype.add=function(A,e){return new vs(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},vs.prototype.reverse=function(){return new vs(this.end,this.endControl,this.startControl,this.start)},vs);function vs(A,e,t,r){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=r}function Ds(A){return 1===A.type}var Ms,xs=function(A){var e=A.styles,t=A.bounds,r=(U=Be(e.borderTopLeftRadius,t.width,t.height))[0],B=U[1],n=(C=Be(e.borderTopRightRadius,t.width,t.height))[0],s=C[1],o=(F=Be(e.borderBottomRightRadius,t.width,t.height))[0],i=F[1],c=(h=Be(e.borderBottomLeftRadius,t.width,t.height))[0],a=h[1];(d=[]).push((r+n)/t.width),d.push((c+o)/t.width),d.push((B+a)/t.height),d.push((s+i)/t.height),1<(f=Math.max.apply(Math,d))&&(r/=f,B/=f,n/=f,s/=f,o/=f,i/=f,c/=f,a/=f);var Q=t.width-n,g=t.height-i,w=t.width-o,u=t.height-a,l=e.borderTopWidth,U=e.borderRightWidth,C=e.borderBottomWidth,F=e.borderLeftWidth,h=xe(e.paddingTop,A.bounds.width),d=xe(e.paddingRight,A.bounds.width),f=xe(e.paddingBottom,A.bounds.width),A=xe(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=0<r||0<B?Vs(t.left+F/3,t.top+l/3,r-F/3,B-l/3,Ms.TOP_LEFT):new Ks(t.left+F/3,t.top+l/3),this.topRightBorderDoubleOuterBox=0<r||0<B?Vs(t.left+Q,t.top+l/3,n-U/3,s-l/3,Ms.TOP_RIGHT):new Ks(t.left+t.width-U/3,t.top+l/3),this.bottomRightBorderDoubleOuterBox=0<o||0<i?Vs(t.left+w,t.top+g,o-U/3,i-C/3,Ms.BOTTOM_RIGHT):new Ks(t.left+t.width-U/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=0<c||0<a?Vs(t.left+F/3,t.top+u,c-F/3,a-C/3,Ms.BOTTOM_LEFT):new Ks(t.left+F/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=0<r||0<B?Vs(t.left+2*F/3,t.top+2*l/3,r-2*F/3,B-2*l/3,Ms.TOP_LEFT):new Ks(t.left+2*F/3,t.top+2*l/3),this.topRightBorderDoubleInnerBox=0<r||0<B?Vs(t.left+Q,t.top+2*l/3,n-2*U/3,s-2*l/3,Ms.TOP_RIGHT):new Ks(t.left+t.width-2*U/3,t.top+2*l/3),this.bottomRightBorderDoubleInnerBox=0<o||0<i?Vs(t.left+w,t.top+g,o-2*U/3,i-2*C/3,Ms.BOTTOM_RIGHT):new Ks(t.left+t.width-2*U/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=0<c||0<a?Vs(t.left+2*F/3,t.top+u,c-2*F/3,a-2*C/3,Ms.BOTTOM_LEFT):new Ks(t.left+2*F/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=0<r||0<B?Vs(t.left+F/2,t.top+l/2,r-F/2,B-l/2,Ms.TOP_LEFT):new Ks(t.left+F/2,t.top+l/2),this.topRightBorderStroke=0<r||0<B?Vs(t.left+Q,t.top+l/2,n-U/2,s-l/2,Ms.TOP_RIGHT):new Ks(t.left+t.width-U/2,t.top+l/2),this.bottomRightBorderStroke=0<o||0<i?Vs(t.left+w,t.top+g,o-U/2,i-C/2,Ms.BOTTOM_RIGHT):new Ks(t.left+t.width-U/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=0<c||0<a?Vs(t.left+F/2,t.top+u,c-F/2,a-C/2,Ms.BOTTOM_LEFT):new Ks(t.left+F/2,t.top+t.height-C/2),this.topLeftBorderBox=0<r||0<B?Vs(t.left,t.top,r,B,Ms.TOP_LEFT):new Ks(t.left,t.top),this.topRightBorderBox=0<n||0<s?Vs(t.left+Q,t.top,n,s,Ms.TOP_RIGHT):new Ks(t.left+t.width,t.top),this.bottomRightBorderBox=0<o||0<i?Vs(t.left+w,t.top+g,o,i,Ms.BOTTOM_RIGHT):new Ks(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=0<c||0<a?Vs(t.left,t.top+u,c,a,Ms.BOTTOM_LEFT):new Ks(t.left,t.top+t.height),this.topLeftPaddingBox=0<r||0<B?Vs(t.left+F,t.top+l,Math.max(0,r-F),Math.max(0,B-l),Ms.TOP_LEFT):new Ks(t.left+F,t.top+l),this.topRightPaddingBox=0<n||0<s?Vs(t.left+Math.min(Q,t.width-U),t.top+l,Q>t.width+U?0:Math.max(0,n-U),Math.max(0,s-l),Ms.TOP_RIGHT):new Ks(t.left+t.width-U,t.top+l),this.bottomRightPaddingBox=0<o||0<i?Vs(t.left+Math.min(w,t.width-F),t.top+Math.min(g,t.height-C),Math.max(0,o-U),Math.max(0,i-C),Ms.BOTTOM_RIGHT):new Ks(t.left+t.width-U,t.top+t.height-C),this.bottomLeftPaddingBox=0<c||0<a?Vs(t.left+F,t.top+Math.min(u,t.height-C),Math.max(0,c-F),Math.max(0,a-C),Ms.BOTTOM_LEFT):new Ks(t.left+F,t.top+t.height-C),this.topLeftContentBox=0<r||0<B?Vs(t.left+F+A,t.top+l+h,Math.max(0,r-(F+A)),Math.max(0,B-(l+h)),Ms.TOP_LEFT):new Ks(t.left+F+A,t.top+l+h),this.topRightContentBox=0<n||0<s?Vs(t.left+Math.min(Q,t.width+F+A),t.top+l+h,Q>t.width+F+A?0:n-F+A,s-(l+h),Ms.TOP_RIGHT):new Ks(t.left+t.width-(U+d),t.top+l+h),this.bottomRightContentBox=0<o||0<i?Vs(t.left+Math.min(w,t.width-(F+A)),t.top+Math.min(g,t.height+l+h),Math.max(0,o-(U+d)),i-(C+f),Ms.BOTTOM_RIGHT):new Ks(t.left+t.width-(U+d),t.top+t.height-(C+f)),this.bottomLeftContentBox=0<c||0<a?Vs(t.left+F+A,t.top+u,Math.max(0,c-(F+A)),a-(C+f),Ms.BOTTOM_LEFT):new Ks(t.left+F+A,t.top+t.height-(C+f))};($e=Ms=Ms||{})[$e.TOP_LEFT=0]="TOP_LEFT",$e[$e.TOP_RIGHT=1]="TOP_RIGHT",$e[$e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",$e[$e.BOTTOM_LEFT=3]="BOTTOM_LEFT";function Ss(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]}function Ts(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]}function Gs(A){return 1===A.type}function Os(A,t){return A.length===t.length&&A.some(function(A,e){return A===t[e]})}var Vs=function(A,e,t,r,B){var n=(Math.sqrt(2)-1)/3*4,s=t*n,o=r*n,i=A+t,c=e+r;switch(B){case Ms.TOP_LEFT:return new bs(new Ks(A,c),new Ks(A,c-o),new Ks(i-s,e),new Ks(i,e));case Ms.TOP_RIGHT:return new bs(new Ks(A,e),new Ks(A+s,e),new Ks(i,c-o),new Ks(i,c));case Ms.BOTTOM_RIGHT:return new bs(new Ks(i,e),new Ks(i,e+o),new Ks(A+s,c),new Ks(A,c));default:Ms.BOTTOM_LEFT;return new bs(new Ks(i,c),new Ks(i-s,c),new Ks(A,e+o),new Ks(A,e))}},ks=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Rs=function(A,e){this.path=A,this.target=e,this.type=1},Ns=function(A){this.opacity=A,this.type=2,this.target=6},Ps=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Xs=(Js.prototype.getEffects=function(e){for(var A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var B,n,s=t.effects.filter(function(A){return!Gs(A)});!A&&0===t.container.styles.position&&t.parent||(A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX&&(B=Ss(t.curves),n=Ts(t.curves),Os(B,n)||r.unshift(new Rs(n,6)))),r.unshift.apply(r,s),t=t.parent}return r.filter(function(A){return hr(A.target,e)})},Js);function Js(A,e){var t,r;this.container=A,this.parent=e,this.effects=[],this.curves=new xs(this.container),this.container.styles.opacity<1&&this.effects.push(new Ns(this.container.styles.opacity)),null!==this.container.styles.transform&&(e=this.container.bounds.left+this.container.styles.transformOrigin[0].number,t=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform,this.effects.push(new ks(e,t,r))),0!==this.container.styles.overflowX&&(t=Ss(this.curves),r=Ts(this.curves),Os(t,r)?this.effects.push(new Rs(t,6)):(this.effects.push(new Rs(t,2)),this.effects.push(new Rs(r,4))))}function Ys(A,e){switch(e){case 0:return eo(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return eo(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return eo(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return eo(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}function Ws(A){var e=A.bounds,A=A.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))}function Zs(A){var e=A.styles,t=A.bounds,r=xe(e.paddingLeft,t.width),B=xe(e.paddingRight,t.width),n=xe(e.paddingTop,t.width),A=xe(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,n+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+B),-(e.borderTopWidth+e.borderBottomWidth+n+A))}function _s(A,e,t){var r=(B=ro(A.styles.backgroundOrigin,e),n=A,0===B?n.bounds:(2===B?Zs:Ws)(n)),B=(s=ro(A.styles.backgroundClip,e),o=A,0===s?o.bounds:(2===s?Zs:Ws)(o)),n=to(ro(A.styles.backgroundSize,e),t,r),s=n[0],o=n[1],t=Be(ro(A.styles.backgroundPosition,e),r.width-s,r.height-o);return[Bo(ro(A.styles.backgroundRepeat,e),t,n,r,B),Math.round(r.left+t[0]),Math.round(r.top+t[1]),s=Math.max(1,s),o=Math.max(1,o)]}function qs(A){return _A(A)&&A.value===lt.AUTO}function js(A){return"number"==typeof A}var zs=function(c,a,Q,g){c.container.elements.forEach(function(A){var e=hr(A.flags,4),t=hr(A.flags,2),r=new Xs(A,c);hr(A.styles.display,2048)&&g.push(r);var B,n,s,o,i=hr(A.flags,8)?[]:g;e||t?(B=e||A.styles.isPositioned()?Q:a,t=new Ps(r),A.styles.isPositioned()||A.styles.opacity<1||A.styles.isTransformed()?(n=A.styles.zIndex.order)<0?(s=0,B.negativeZIndex.some(function(A,e){return n>A.element.container.styles.zIndex.order?(s=e,!1):0<s}),B.negativeZIndex.splice(s,0,t)):0<n?(o=0,B.positiveZIndex.some(function(A,e){return n>=A.element.container.styles.zIndex.order?(o=e+1,!1):0<o}),B.positiveZIndex.splice(o,0,t)):B.zeroOrAutoZIndexOrTransformedOrOpacity.push(t):(A.styles.isFloating()?B.nonPositionedFloats:B.nonPositionedInlineLevel).push(t),zs(r,t,e?t:Q,i)):((A.styles.isInlineLevel()?a.inlineLevel:a.nonInlineLevel).push(r),zs(r,a,Q,i)),hr(A.flags,8)&&$s(A,i)})},$s=function(A,e){for(var t=A instanceof YB?A.start:1,r=A instanceof YB&&A.reversed,B=0;B<e.length;B++){var n=e[B];n.container instanceof PB&&"number"==typeof n.container.value&&0!==n.container.value&&(t=n.container.value),n.listValue=qn(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},Ao=function(A,e){var t=[];return Ds(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ds(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},eo=function(A,e,t,r){var B=[];return Ds(A)?B.push(A.subdivide(.5,!1)):B.push(A),Ds(t)?B.push(t.subdivide(.5,!0)):B.push(t),Ds(r)?B.push(r.subdivide(.5,!0).reverse()):B.push(r),Ds(e)?B.push(e.subdivide(.5,!1).reverse()):B.push(e),B},to=function(A,e,t){var r=e[0],B=e[1],n=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(te(s)&&o&&te(o))return[xe(s,t.width),xe(o,t.height)];var i=js(n);if(_A(s)&&(s.value===lt.CONTAIN||s.value===lt.COVER))return js(n)?t.width/t.height<n!=(s.value===lt.COVER)?[t.width,t.width/n]:[t.height*n,t.height]:[t.width,t.height];var c=js(r),e=js(B),A=c||e;if(qs(s)&&(!o||qs(o)))return c&&e?[r,B]:i||A?A&&i?[c?r:B*n,e?B:r/n]:[c?r:t.width,e?B:t.height]:[t.width,t.height];if(i){var a=0,Q=0;return te(s)?a=xe(s,t.width):te(o)&&(Q=xe(o,t.height)),qs(s)?a=Q*n:o&&!qs(o)||(Q=a/n),[a,Q]}a=null,Q=null;if(te(s)?a=xe(s,t.width):o&&te(o)&&(Q=xe(o,t.height)),null!==(a=null!==(Q=null!==a&&(!o||qs(o))?c&&e?a/r*B:t.height:Q)&&qs(s)?c&&e?Q/B*r:t.width:a)&&null!==Q)return[a,Q];throw new Error("Unable to calculate background-size for element")},ro=function(A,e){e=A[e];return void 0===e?A[0]:e},Bo=function(A,e,t,r,B){var n=e[0],s=e[1],o=t[0],i=t[1];switch(A){case 2:return[new Ks(Math.round(r.left),Math.round(r.top+s)),new Ks(Math.round(r.left+r.width),Math.round(r.top+s)),new Ks(Math.round(r.left+r.width),Math.round(i+r.top+s)),new Ks(Math.round(r.left),Math.round(i+r.top+s))];case 3:return[new Ks(Math.round(r.left+n),Math.round(r.top)),new Ks(Math.round(r.left+n+o),Math.round(r.top)),new Ks(Math.round(r.left+n+o),Math.round(r.height+r.top)),new Ks(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new Ks(Math.round(r.left+n),Math.round(r.top+s)),new Ks(Math.round(r.left+n+o),Math.round(r.top+s)),new Ks(Math.round(r.left+n+o),Math.round(r.top+s+i)),new Ks(Math.round(r.left+n),Math.round(r.top+s+i))];default:return[new Ks(Math.round(B.left),Math.round(B.top)),new Ks(Math.round(B.left+B.width),Math.round(B.top)),new Ks(Math.round(B.left+B.width),Math.round(B.height+B.top)),new Ks(Math.round(B.left),Math.round(B.height+B.top))]}},no="Hidden Text",so=(oo.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),r=this._document.createElement("img"),B=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",t.style.whiteSpace="nowrap",n.appendChild(t),r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",B.style.fontFamily=A,B.style.fontSize=e,B.style.margin="0",B.style.padding="0",B.appendChild(this._document.createTextNode(no)),t.appendChild(B),t.appendChild(r);e=r.offsetTop-B.offsetTop+2;t.removeChild(B),t.appendChild(this._document.createTextNode(no)),t.style.lineHeight="normal",r.style.verticalAlign="super";r=r.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:e,middle:r}},oo.prototype.getMetrics=function(A,e){var t="".concat(A," ").concat(e);return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},oo);function oo(A){this._data={},this._document=A}var io,$e=function(A,e){this.context=A,this.options=e},co=(A(ao,io=$e),ao.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach(function(A){return e.applyEffect(A)})},ao.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)),Gs(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},ao.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},ao.prototype.renderStack=function(e){return c(this,void 0,void 0,function(){return p(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]}})})},ao.prototype.renderNode=function(e){return c(this,void 0,void 0,function(){return p(this,function(A){switch(A.label){case 0:return hr(e.container.flags,16),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]}})})},ao.prototype.renderTextWithLetterSpacing=function(t,A,r){var B=this;0===A?-1===navigator.userAgent.indexOf("Firefox")?(this.ctx.textBaseline="ideographic",this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+t.bounds.height)):this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+r):yB(t.text).reduce(function(A,e){return B.ctx.fillText(e,A,t.bounds.top+r),A+B.ctx.measureText(e).width},t.bounds.left)},ao.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=Uo(A.fontFamily).join(", "),r=WA(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]},ao.prototype.renderTextNode=function(t,n){return c(this,void 0,void 0,function(){var e,r,B=this;return p(this,function(A){return e=this.createFontStyle(n)[0],this.ctx.font=e,this.ctx.direction=1===n.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",r=n.paintOrder,t.textBounds.forEach(function(t){r.forEach(function(A){switch(A){case 0:B.ctx.fillStyle=ie(n.color),B.renderTextWithLetterSpacing(t,n.letterSpacing,n.fontSize.number);var e=n.textShadow;e.length&&t.text.trim().length&&(e.slice(0).reverse().forEach(function(A){B.ctx.shadowColor=ie(A.color),B.ctx.shadowOffsetX=A.offsetX.number*B.options.scale,B.ctx.shadowOffsetY=A.offsetY.number*B.options.scale,B.ctx.shadowBlur=A.blur.number,B.renderTextWithLetterSpacing(t,n.letterSpacing,n.fontSize.number)}),B.ctx.shadowColor="",B.ctx.shadowOffsetX=0,B.ctx.shadowOffsetY=0,B.ctx.shadowBlur=0),n.textDecorationLine.length&&(B.ctx.fillStyle=ie(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(A){switch(A){case 1:B.ctx.fillRect(t.bounds.left,t.bounds.top+t.bounds.height-1,t.bounds.width,1);break;case 2:B.ctx.fillRect(t.bounds.left,t.bounds.top,t.bounds.width,1);break;case 3:B.ctx.fillRect(t.bounds.left,t.bounds.top+(t.bounds.height/2-.5),t.bounds.width,1)}}));break;case 1:n.webkitTextStrokeWidth&&t.text.trim().length&&(B.ctx.strokeStyle=ie(n.webkitTextStrokeColor),B.ctx.lineWidth=n.webkitTextStrokeWidth,B.ctx.lineJoin=window.chrome?"miter":"round",B.ctx.strokeText(t.text,t.bounds.left,t.bounds.top+t.bounds.height)),B.ctx.strokeStyle="",B.ctx.lineWidth=0,B.ctx.lineJoin="miter"}})}),[2]})})},ao.prototype.renderReplacedElement=function(A,e,t){var r,B,n,s,o,i,c,a,Q,g,w=t.naturalWidth||A.intrinsicWidth,u=t.naturalHeight||A.intrinsicHeight;t&&0<w&&0<u&&(r=Zs(A),g=Ts(e),this.path(g),this.ctx.save(),this.ctx.clip(),n=B=0,o=r.left,i=r.top,Q=(c=r.width)/(a=r.height),g=(s=w)/(e=u),2===(A=A.styles.objectFit)?Q<g?i+=(r.height-(a=c/g))/2:o+=(r.width-(c=a*g))/2:4===A?Q<g?B+=(w-(s=e*Q))/2:n+=(u-(e=s/Q))/2:8===A?(c<s?(B+=(s-c)/2,s=c):(o+=(c-s)/2,c=s),a<e?(n+=(e-a)/2,e=a):(i+=(a-e)/2,a=e)):16===A&&((Q<g?c:a*g)<(c<s?s:c)?Q<g?i+=(r.height-(a=c/g))/2:o+=(r.width-(c=a*g))/2:(c<s?(B+=(s-c)/2,s=c):(o+=(c-s)/2,c=s),a<e?(n+=(e-a)/2,e=a):(i+=(a-e)/2,a=e))),this.ctx.drawImage(t,B,n,s,e,o,i,c,a),this.ctx.restore())},ao.prototype.renderNodeContent=function(w){return c(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,c,a,Q,g;return p(this,function(A){switch(A.label){case 0:this.applyEffects(w.getEffects(4)),e=w.container,t=w.curves,r=e.styles,B=0,n=e.textNodes,A.label=1;case 1:return B<n.length?(s=n[B],[4,this.renderTextNode(s,r)]):[3,4];case 2:A.sent(),A.label=3;case 3:return B++,[3,1];case 4:if(!(e instanceof xB))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 c=A.sent(),this.renderReplacedElement(e,t,c),[3,8];case 7:return A.sent(),this.context.logger.error("Error loading image ".concat(e.src)),[3,8];case 8:if(e instanceof GB&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof kB))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 c=A.sent(),this.renderReplacedElement(e,t,c),[3,12];case 11:return A.sent(),this.context.logger.error("Error loading svg ".concat(e.svg.substring(0,255))),[3,12];case 12:return e instanceof Qn&&e.tree?[4,new ao(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 en&&(i=Math.min(e.bounds.width,e.bounds.height),e.type===jB?e.checked&&(this.ctx.save(),this.path([new Ks(e.bounds.left+.39363*i,e.bounds.top+.79*i),new Ks(e.bounds.left+.16*i,e.bounds.top+.5549*i),new Ks(e.bounds.left+.27347*i,e.bounds.top+.44071*i),new Ks(e.bounds.left+.39694*i,e.bounds.top+.5649*i),new Ks(e.bounds.left+.72983*i,e.bounds.top+.23*i),new Ks(e.bounds.left+.84*i,e.bounds.top+.34085*i),new Ks(e.bounds.left+.39363*i,e.bounds.top+.79*i)]),this.ctx.fillStyle=ie(An),this.ctx.fill(),this.ctx.restore()):e.type===zB&&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=ie(An),this.ctx.fill(),this.ctx.restore())),go(e)&&e.value.length){switch(a=this.createFontStyle(r),Q=a[0],i=a[1],a=this.fontMetrics.getMetrics(Q,i).baseline,this.ctx.font=Q,this.ctx.fillStyle=ie(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=uo(e.styles.textAlign),g=Zs(e),o=0,e.styles.textAlign){case 1:o+=g.width/2;break;case 2:o+=g.width}i=g.add(o,0,0,-g.height/2+1),this.ctx.save(),this.path([new Ks(g.left,g.top),new Ks(g.left+g.width,g.top),new Ks(g.left+g.width,g.top+g.height),new Ks(g.left,g.top+g.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new HB(e.value,i),r.letterSpacing,a),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!hr(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(a=e.styles.listStyleImage).type)return[3,18];c=void 0,a=a.url,A.label=15;case 15:return A.trys.push([15,17,,18]),[4,this.context.cache.match(a)];case 16:return c=A.sent(),this.ctx.drawImage(c,e.bounds.left-(c.width+10),e.bounds.top),[3,18];case 17:return A.sent(),this.context.logger.error("Error loading list-style-image ".concat(a)),[3,18];case 18:return[3,20];case 19:w.listValue&&-1!==e.styles.listStyleType&&(Q=this.createFontStyle(r)[0],this.ctx.font=Q,this.ctx.fillStyle=ie(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",g=new d(e.bounds.left,e.bounds.top+xe(e.styles.paddingTop,e.bounds.width),e.bounds.width,pt(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new HB(w.listValue,g),r.letterSpacing,pt(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),A.label=20;case 20:return[2]}})})},ao.prototype.renderStackContent=function(U){return c(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,c,a,Q,g,w,u,l;return p(this,function(A){switch(A.label){case 0:return hr(U.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(U.element)];case 1:A.sent(),e=0,t=U.negativeZIndex,A.label=2;case 2:return e<t.length?(l=t[e],[4,this.renderStack(l)]):[3,5];case 3:A.sent(),A.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(U.element)];case 6:A.sent(),r=0,B=U.nonInlineLevel,A.label=7;case 7:return r<B.length?(l=B[r],[4,this.renderNode(l)]):[3,10];case 8:A.sent(),A.label=9;case 9:return r++,[3,7];case 10:n=0,s=U.nonPositionedFloats,A.label=11;case 11:return n<s.length?(l=s[n],[4,this.renderStack(l)]):[3,14];case 12:A.sent(),A.label=13;case 13:return n++,[3,11];case 14:o=0,i=U.nonPositionedInlineLevel,A.label=15;case 15:return o<i.length?(l=i[o],[4,this.renderStack(l)]):[3,18];case 16:A.sent(),A.label=17;case 17:return o++,[3,15];case 18:c=0,a=U.inlineLevel,A.label=19;case 19:return c<a.length?(l=a[c],[4,this.renderNode(l)]):[3,22];case 20:A.sent(),A.label=21;case 21:return c++,[3,19];case 22:Q=0,g=U.zeroOrAutoZIndexOrTransformedOrOpacity,A.label=23;case 23:return Q<g.length?(l=g[Q],[4,this.renderStack(l)]):[3,26];case 24:A.sent(),A.label=25;case 25:return Q++,[3,23];case 26:w=0,u=U.positiveZIndex,A.label=27;case 27:return w<u.length?(l=u[w],[4,this.renderStack(l)]):[3,30];case 28:A.sent(),A.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},ao.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()},ao.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},ao.prototype.formatPath=function(A){var r=this;A.forEach(function(A,e){var t=Ds(A)?A.start:A;0===e?r.ctx.moveTo(t.x,t.y):r.ctx.lineTo(t.x,t.y),Ds(A)&&r.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},ao.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},ao.prototype.resizeImage=function(A,e,t){var r=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return r.width=Math.max(1,e),r.height=Math.max(1,t),r.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),r},ao.prototype.renderBackgroundImage=function(f){return c(this,void 0,void 0,function(){var h,e,d,t,r,B;return p(this,function(A){switch(A.label){case 0:h=f.styles.backgroundImage.length-1,e=function(e){var t,r,B,n,s,o,i,c,a,Q,g,w,u,l,U,C,F;return p(this,function(A){switch(A.label){case 0:if(0!==e.type)return[3,5];t=void 0,r=e.url,A.label=1;case 1:return A.trys.push([1,3,,4]),[4,d.context.cache.match(r)];case 2:return t=A.sent(),[3,4];case 3:return A.sent(),d.context.logger.error("Error loading background-image ".concat(r)),[3,4];case 4:return t&&(Q=isNaN(t.width)||0===t.width?1:t.width,s=isNaN(t.height)||0===t.height?1:t.height,B=_s(f,h,[Q,s,Q/s]),o=B[0],g=B[1],w=B[2],a=B[3],Q=B[4],s=d.ctx.createPattern(d.resizeImage(t,a,Q),"repeat"),d.renderRepeat(o,s,g,w)),[3,6];case 5:1===e.type?(F=_s(f,h,[null,null,null]),o=F[0],g=F[1],w=F[2],a=F[3],Q=F[4],U=Ke(e.angle,a,Q),l=U[0],B=U[1],i=U[2],C=U[3],c=U[4],(F=document.createElement("canvas")).width=a,F.height=Q,U=F.getContext("2d"),n=U.createLinearGradient(B,C,i,c),ye(e.stops,l).forEach(function(A){return n.addColorStop(A.stop,ie(A.color))}),U.fillStyle=n,U.fillRect(0,0,a,Q),0<a&&0<Q&&(s=d.ctx.createPattern(F,"repeat"),d.renderRepeat(o,s,g,w))):2===e.type&&(C=_s(f,h,[null,null,null]),o=C[0],i=C[1],c=C[2],a=C[3],Q=C[4],l=0===e.position.length?[De]:e.position,g=xe(l[0],a),w=xe(l[l.length-1],Q),U=function(A,e,t,r,B){var n,s,o,i,c=0,a=0;switch(A.size){case 0:0===A.shape?c=a=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(c=Math.min(Math.abs(e),Math.abs(e-r)),a=Math.min(Math.abs(t),Math.abs(t-B)));break;case 2:0===A.shape?c=a=Math.min(me(e,t),me(e,t-B),me(e-r,t),me(e-r,t-B)):1===A.shape&&(n=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(e),Math.abs(e-r)),o=(s=Le(r,B,e,t,!0))[0],i=s[1],a=n*(c=me(o-e,(i-t)/n)));break;case 1:0===A.shape?c=a=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(c=Math.max(Math.abs(e),Math.abs(e-r)),a=Math.max(Math.abs(t),Math.abs(t-B)));break;case 3:0===A.shape?c=a=Math.max(me(e,t),me(e,t-B),me(e-r,t),me(e-r,t-B)):1===A.shape&&(n=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(e),Math.abs(e-r)),o=(s=Le(r,B,e,t,!1))[0],i=s[1],a=n*(c=me(o-e,(i-t)/n)))}return Array.isArray(A.size)&&(c=xe(A.size[0],r),a=2===A.size.length?xe(A.size[1],B):c),[c,a]}(e,g,w,a,Q),F=U[0],C=U[1],0<F&&0<C&&(u=d.ctx.createRadialGradient(i+g,c+w,0,i+g,c+w,F),ye(e.stops,2*F).forEach(function(A){return u.addColorStop(A.stop,ie(A.color))}),d.path(o),d.ctx.fillStyle=u,F!==C?(l=f.bounds.left+.5*f.bounds.width,U=f.bounds.top+.5*f.bounds.height,F=1/(C=C/F),d.ctx.save(),d.ctx.translate(l,U),d.ctx.transform(1,0,0,C,0,0),d.ctx.translate(-l,-U),d.ctx.fillRect(i,F*(c-U)+U,a,Q*F),d.ctx.restore()):d.ctx.fill())),A.label=6;case 6:return h--,[2]}})},d=this,t=0,r=f.styles.backgroundImage.slice(0).reverse(),A.label=1;case 1:return t<r.length?(B=r[t],[5,e(B)]):[3,4];case 2:A.sent(),A.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},ao.prototype.renderSolidBorder=function(e,t,r){return c(this,void 0,void 0,function(){return p(this,function(A){return this.path(Ys(r,t)),this.ctx.fillStyle=ie(e),this.ctx.fill(),[2]})})},ao.prototype.renderDoubleBorder=function(t,r,B,n){return c(this,void 0,void 0,function(){var e;return p(this,function(A){switch(A.label){case 0:return r<3?[4,this.renderSolidBorder(t,B,n)]:[3,2];case 1:return A.sent(),[2];case 2:return e=function(A,e){switch(e){case 0:return eo(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return eo(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return eo(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return eo(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,B),this.path(e),this.ctx.fillStyle=ie(t),this.ctx.fill(),e=function(A,e){switch(e){case 0:return eo(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return eo(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return eo(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return eo(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,B),this.path(e),this.ctx.fill(),[2]}})})},ao.prototype.renderNodeBackgroundAndBorders=function(a){return c(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,c=this;return p(this,function(A){switch(A.label){case 0:return(this.applyEffects(a.getEffects(2)),e=a.container.styles,t=!oe(e.backgroundColor)||e.backgroundImage.length,r=[{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}],B=wo(ro(e.backgroundClip,0),a.curves),t||e.boxShadow.length)?(this.ctx.save(),this.path(B),this.ctx.clip(),oe(e.backgroundColor)||(this.ctx.fillStyle=ie(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(a.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(A){c.ctx.save();var t,r,B,n,e=Ss(a.curves),s=A.inset?0:1e4,o=(t=-s+(A.inset?1:-1)*A.spread.number,r=(A.inset?1:-1)*A.spread.number,B=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,r);case 1:return A.add(t+B,r);case 2:return A.add(t+B,r+n);case 3:return A.add(t,r+n)}return A}));A.inset?(c.path(e),c.ctx.clip(),c.mask(o)):(c.mask(e),c.ctx.clip(),c.path(o)),c.ctx.shadowOffsetX=A.offsetX.number+s,c.ctx.shadowOffsetY=A.offsetY.number,c.ctx.shadowColor=ie(A.color),c.ctx.shadowBlur=A.blur.number,c.ctx.fillStyle=A.inset?ie(A.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()}),A.label=2;case 2:s=n=0,o=r,A.label=3;case 3:return s<o.length?0!==(i=o[s]).style&&!oe(i.color)&&0<i.width?2!==i.style?[3,5]:[4,this.renderDashedDottedBorder(i.color,i.width,n,a.curves,2)]:[3,11]:[3,13];case 4:return A.sent(),[3,11];case 5:return 3!==i.style?[3,7]:[4,this.renderDashedDottedBorder(i.color,i.width,n,a.curves,3)];case 6:return A.sent(),[3,11];case 7:return 4!==i.style?[3,9]:[4,this.renderDoubleBorder(i.color,i.width,n,a.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(i.color,n,a.curves)];case 10:A.sent(),A.label=11;case 11:n++,A.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},ao.prototype.renderDashedDottedBorder=function(g,w,u,l,U){return c(this,void 0,void 0,function(){var e,t,r,B,n,s,o,i,c,a,Q;return p(this,function(A){return this.ctx.save(),c=function(A,e){switch(e){case 0:return Ao(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Ao(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Ao(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return Ao(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(l,u),e=Ys(l,u),2===U&&(this.path(e),this.ctx.clip()),s=Ds(e[0])?(t=e[0].start.x,e[0].start.y):(t=e[0].x,e[0].y),o=Ds(e[1])?(r=e[1].end.x,e[1].end.y):(r=e[1].x,e[1].y),B=0===u||2===u?Math.abs(t-r):Math.abs(s-o),this.ctx.beginPath(),3===U?this.formatPath(c):this.formatPath(e.slice(0,2)),n=w<3?3*w:2*w,s=w<3?2*w:w,3===U&&(s=n=w),o=!0,B<=2*n?o=!1:B<=2*n+s?(n*=i=B/(2*n+s),s*=i):(c=Math.floor((B+s)/(n+s)),i=(B-c*n)/(c-1),s=(c=(B-(c+1)*n)/c)<=0||Math.abs(s-i)<Math.abs(s-c)?i:c),o&&(3===U?this.ctx.setLineDash([0,n+s]):this.ctx.setLineDash([n,s])),3===U?(this.ctx.lineCap="round",this.ctx.lineWidth=w):this.ctx.lineWidth=2*w+1.1,this.ctx.strokeStyle=ie(g),this.ctx.stroke(),this.ctx.setLineDash([]),2===U&&(Ds(e[0])&&(a=e[3],Q=e[0],this.ctx.beginPath(),this.formatPath([new Ks(a.end.x,a.end.y),new Ks(Q.start.x,Q.start.y)]),this.ctx.stroke()),Ds(e[1])&&(a=e[1],Q=e[2],this.ctx.beginPath(),this.formatPath([new Ks(a.end.x,a.end.y),new Ks(Q.start.x,Q.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},ao.prototype.render=function(B){return c(this,void 0,void 0,function(){return p(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ie(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=new Xs(e=B,null),r=new Ps(t),zs(t,r,r,e=[]),$s(t.container,e),[4,this.renderStack(r)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}var e,t,r})})},ao);function ao(A,e){A=io.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="".concat(e.width,"px"),A.canvas.style.height="".concat(e.height,"px")),A.fontMetrics=new so(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 (".concat(e.width,"x").concat(e.height,") with scale ").concat(e.scale)),A}var Qo,go=function(A){return A instanceof on||(A instanceof Bn||A instanceof en&&A.type!==zB&&A.type!==jB)},wo=function(A,e){switch(A){case 0:return Ss(e);case 2:return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox];default:return Ts(e)}},uo=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},lo=["-apple-system","system-ui"],Uo=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===lo.indexOf(A)}):A},Co=(A(Fo,Qo=$e),Fo.prototype.render=function(t){return c(this,void 0,void 0,function(){var e;return p(this,function(A){switch(A.label){case 0:return e=dB(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,ho(e)];case 1:return e=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ie(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]}})})},Fo);function Fo(A,e){A=Qo.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="".concat(e.width,"px"),A.canvas.style.height="".concat(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 (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(e.scale)),A}var ho=function(r){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,".concat(encodeURIComponent((new XMLSerializer).serializeToString(r)))})},fo=(po.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,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},po.prototype.getTime=function(){return Date.now()-this.start},po.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,"".concat(this.getTime(),"ms")],A,!1))},po.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,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},po.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,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},po.instances={},po);function po(A){var e=A.id,A=A.enabled;this.id=e,this.enabled=A,this.start=Date.now()}var Ho=(Eo.instanceCount=1,Eo);function Eo(A,e){this.windowBounds=e,this.instanceName="#".concat(Eo.instanceCount++),this.logger=new fo({id:this.instanceName,enabled:A.logging}),this.cache=null!==(e=A.cache)&&void 0!==e?e:new Cs(this,A)}"undefined"!=typeof window&&ls.setContext(window);var Io=function(C,F){return c(void 0,void 0,void 0,function(){var e,t,r,B,n,s,o,i,c,a,Q,g,w,u,l,U;return p(this,function(A){switch(A.label){case 0:if(!C||"object"!=typeof C)return[2,Promise.reject("Invalid element provided as first argument")];if(!(e=C.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 w={allowTaint:null!==(u=F.allowTaint)&&void 0!==u&&u,imageTimeout:null!==(a=F.imageTimeout)&&void 0!==a?a:15e3,proxy:F.proxy,useCORS:null!==(Q=F.useCORS)&&void 0!==Q&&Q},u=h({logging:null===(g=F.logging)||void 0===g||g,cache:F.cache},w),a={windowWidth:null!==(a=F.windowWidth)&&void 0!==a?a:t.innerWidth,windowHeight:null!==(Q=F.windowHeight)&&void 0!==Q?Q:t.innerHeight,scrollX:null!==(g=F.scrollX)&&void 0!==g?g:t.pageXOffset,scrollY:null!==(w=F.scrollY)&&void 0!==w?w:t.pageYOffset},Q=new d(a.scrollX,a.scrollY,a.windowWidth,a.windowHeight),g=new Ho(u,Q),a=null!==(w=F.foreignObjectRendering)&&void 0!==w&&w,w={allowTaint:null!==(u=F.allowTaint)&&void 0!==u&&u,onclone:F.onclone,ignoreElements:F.ignoreElements,inlineImages:a,copyStyles:a},g.logger.debug("Starting document clone with size ".concat(Q.width,"x").concat(Q.height," scrolled to ").concat(-Q.left,",").concat(-Q.top)),u=new zn(g,C,w),(w=u.clonedReferenceElement)?[4,u.toIFrame(e,Q)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return(r=A.sent(),l=bn(w)||"HTML"===w.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)}(w.ownerDocument):f(g,w),B=l.width,n=l.height,s=l.left,o=l.top,i=yo(g,w,F.backgroundColor),l={canvas:F.canvas,backgroundColor:i,scale:null!==(l=null!==(l=F.scale)&&void 0!==l?l:t.devicePixelRatio)&&void 0!==l?l:1,x:(null!==(l=F.x)&&void 0!==l?l:0)+s,y:(null!==(l=F.y)&&void 0!==l?l:0)+o,width:null!==(l=F.width)&&void 0!==l?l:Math.ceil(B),height:null!==(l=F.height)&&void 0!==l?l:Math.ceil(n)},a)?(g.logger.debug("Document cloned, using foreign object rendering"),[4,new Co(g,l).render(w)]):[3,3];case 2:return c=A.sent(),[3,5];case 3:return g.logger.debug("Document cloned, element located at ".concat(s,",").concat(o," with size ").concat(B,"x").concat(n," using computed rendering")),g.logger.debug("Starting DOM parsing"),U=hn(g,w),i===U.styles.backgroundColor&&(U.styles.backgroundColor=nt.TRANSPARENT),g.logger.debug("Starting renderer for element at ".concat(l.x,",").concat(l.y," with size ").concat(l.width,"x").concat(l.height)),[4,new co(g,l).render(U)];case 4:c=A.sent(),A.label=5;case 5:return null!==(U=F.removeContainer)&&void 0!==U&&!U||zn.destroy(r)||g.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore"),g.logger.debug("Finished rendering"),[2,c]}})})},yo=function(A,e,t){var r=e.ownerDocument,B=r.documentElement?Bt(A,getComputedStyle(r.documentElement).backgroundColor):nt.TRANSPARENT,n=r.body?Bt(A,getComputedStyle(r.body).backgroundColor):nt.TRANSPARENT,t="string"==typeof t?Bt(A,t):null===t?nt.TRANSPARENT:4294967295;return e===r.documentElement?oe(B)?oe(n)?t:n:B:t};return function(A,e){return Io(A,e=void 0===e?{}:e)}});