@hyperframes/shader-transitions 0.8.75 → 0.8.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
content: "" !important;
|
|
4
4
|
display: none !important;
|
|
5
5
|
}`,lu=function(A){uu(A,"."+sn+Bu+Ks+`
|
|
6
|
-
.`+on+cu+Ks)},uu=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},Ki=(function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A})(),fu=(function(){function A(e,t){this.context=e,this._options=t,this._cache={}}return A.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Mr(e)||Cu(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return wA(this,void 0,void 0,function(){var t,r,n,s,i=this;return cA(this,function(o){switch(o.label){case 0:return t=Ki.isSameOrigin(e),r=!_r(e)&&this._options.useCORS===!0&&aA.SUPPORT_CORS_IMAGES&&!t,n=!_r(e)&&!t&&!Mr(e)&&typeof this._options.proxy=="string"&&aA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!_r(e)&&!Mr(e)&&!n&&!r?[2]:(s=e,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(a,B){var l=new Image;l.onload=function(){return a(l)},l.onerror=B,(du(s)||r)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return a(l)},500),i._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(s,i){var o=aA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(f){return i(f)},!1),u.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var B=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+B+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+n)}}a.send()})},A})(),gu=/^data:image\/svg\+xml/i,wu=/^data:image\/.*;base64,/i,Qu=/^data:image\/.*/i,Cu=function(A){return aA.SUPPORT_SVG_DRAWING||!hu(A)},_r=function(A){return Qu.test(A)},du=function(A){return wu.test(A)},Mr=function(A){return A.substr(0,4)==="blob"},hu=function(A){return A.substr(-3).toLowerCase()==="svg"||gu.test(A)},v=(function(){function A(e,t){this.type=0,this.x=e,this.y=t}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A})(),Ue=function(A,e,t){return new v(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Ht=(function(){function A(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}return A.prototype.subdivide=function(e,t){var r=Ue(this.start,this.startControl,e),n=Ue(this.startControl,this.endControl,e),s=Ue(this.endControl,this.end,e),i=Ue(r,n,e),o=Ue(n,s,e),a=Ue(i,o,e);return t?new A(this.start,r,i,a):new A(a,o,s,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),vA=function(A){return A.type===1},Uu=(function(){function A(e){var t=e.styles,r=e.bounds,n=Pe(t.borderTopLeftRadius,r.width,r.height),s=n[0],i=n[1],o=Pe(t.borderTopRightRadius,r.width,r.height),a=o[0],B=o[1],l=Pe(t.borderBottomRightRadius,r.width,r.height),u=l[0],f=l[1],C=Pe(t.borderBottomLeftRadius,r.width,r.height),g=C[0],w=C[1],x=[];x.push((s+a)/r.width),x.push((g+u)/r.width),x.push((i+w)/r.height),x.push((B+f)/r.height);var F=Math.max.apply(Math,x);F>1&&(s/=F,i/=F,a/=F,B/=F,u/=F,f/=F,g/=F,w/=F);var p=r.width-a,L=r.height-f,m=r.width-u,I=r.height-w,h=t.borderTopWidth,y=t.borderRightWidth,M=t.borderBottomWidth,S=t.borderLeftWidth,Y=z(t.paddingTop,e.bounds.width),K=z(t.paddingRight,e.bounds.width),R=z(t.paddingBottom,e.bounds.width),_=z(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?AA(r.left+S/3,r.top+h/3,s-S/3,i-h/3,J.TOP_LEFT):new v(r.left+S/3,r.top+h/3),this.topRightBorderDoubleOuterBox=s>0||i>0?AA(r.left+p,r.top+h/3,a-y/3,B-h/3,J.TOP_RIGHT):new v(r.left+r.width-y/3,r.top+h/3),this.bottomRightBorderDoubleOuterBox=u>0||f>0?AA(r.left+m,r.top+L,u-y/3,f-M/3,J.BOTTOM_RIGHT):new v(r.left+r.width-y/3,r.top+r.height-M/3),this.bottomLeftBorderDoubleOuterBox=g>0||w>0?AA(r.left+S/3,r.top+I,g-S/3,w-M/3,J.BOTTOM_LEFT):new v(r.left+S/3,r.top+r.height-M/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?AA(r.left+S*2/3,r.top+h*2/3,s-S*2/3,i-h*2/3,J.TOP_LEFT):new v(r.left+S*2/3,r.top+h*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?AA(r.left+p,r.top+h*2/3,a-y*2/3,B-h*2/3,J.TOP_RIGHT):new v(r.left+r.width-y*2/3,r.top+h*2/3),this.bottomRightBorderDoubleInnerBox=u>0||f>0?AA(r.left+m,r.top+L,u-y*2/3,f-M*2/3,J.BOTTOM_RIGHT):new v(r.left+r.width-y*2/3,r.top+r.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||w>0?AA(r.left+S*2/3,r.top+I,g-S*2/3,w-M*2/3,J.BOTTOM_LEFT):new v(r.left+S*2/3,r.top+r.height-M*2/3),this.topLeftBorderStroke=s>0||i>0?AA(r.left+S/2,r.top+h/2,s-S/2,i-h/2,J.TOP_LEFT):new v(r.left+S/2,r.top+h/2),this.topRightBorderStroke=s>0||i>0?AA(r.left+p,r.top+h/2,a-y/2,B-h/2,J.TOP_RIGHT):new v(r.left+r.width-y/2,r.top+h/2),this.bottomRightBorderStroke=u>0||f>0?AA(r.left+m,r.top+L,u-y/2,f-M/2,J.BOTTOM_RIGHT):new v(r.left+r.width-y/2,r.top+r.height-M/2),this.bottomLeftBorderStroke=g>0||w>0?AA(r.left+S/2,r.top+I,g-S/2,w-M/2,J.BOTTOM_LEFT):new v(r.left+S/2,r.top+r.height-M/2),this.topLeftBorderBox=s>0||i>0?AA(r.left,r.top,s,i,J.TOP_LEFT):new v(r.left,r.top),this.topRightBorderBox=a>0||B>0?AA(r.left+p,r.top,a,B,J.TOP_RIGHT):new v(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||f>0?AA(r.left+m,r.top+L,u,f,J.BOTTOM_RIGHT):new v(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=g>0||w>0?AA(r.left,r.top+I,g,w,J.BOTTOM_LEFT):new v(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||i>0?AA(r.left+S,r.top+h,Math.max(0,s-S),Math.max(0,i-h),J.TOP_LEFT):new v(r.left+S,r.top+h),this.topRightPaddingBox=a>0||B>0?AA(r.left+Math.min(p,r.width-y),r.top+h,p>r.width+y?0:Math.max(0,a-y),Math.max(0,B-h),J.TOP_RIGHT):new v(r.left+r.width-y,r.top+h),this.bottomRightPaddingBox=u>0||f>0?AA(r.left+Math.min(m,r.width-S),r.top+Math.min(L,r.height-M),Math.max(0,u-y),Math.max(0,f-M),J.BOTTOM_RIGHT):new v(r.left+r.width-y,r.top+r.height-M),this.bottomLeftPaddingBox=g>0||w>0?AA(r.left+S,r.top+Math.min(I,r.height-M),Math.max(0,g-S),Math.max(0,w-M),J.BOTTOM_LEFT):new v(r.left+S,r.top+r.height-M),this.topLeftContentBox=s>0||i>0?AA(r.left+S+_,r.top+h+Y,Math.max(0,s-(S+_)),Math.max(0,i-(h+Y)),J.TOP_LEFT):new v(r.left+S+_,r.top+h+Y),this.topRightContentBox=a>0||B>0?AA(r.left+Math.min(p,r.width+S+_),r.top+h+Y,p>r.width+S+_?0:a-S+_,B-(h+Y),J.TOP_RIGHT):new v(r.left+r.width-(y+K),r.top+h+Y),this.bottomRightContentBox=u>0||f>0?AA(r.left+Math.min(m,r.width-(S+_)),r.top+Math.min(L,r.height+h+Y),Math.max(0,u-(y+K)),f-(M+R),J.BOTTOM_RIGHT):new v(r.left+r.width-(y+K),r.top+r.height-(M+R)),this.bottomLeftContentBox=g>0||w>0?AA(r.left+S+_,r.top+I,Math.max(0,g-(S+_)),w-(M+R),J.BOTTOM_LEFT):new v(r.left+S+_,r.top+r.height-(M+R))}return A})(),J;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(J||(J={}));var AA=function(A,e,t,r,n){var s=4*((Math.sqrt(2)-1)/3),i=t*s,o=r*s,a=A+t,B=e+r;switch(n){case J.TOP_LEFT:return new Ht(new v(A,B),new v(A,B-o),new v(a-i,e),new v(a,e));case J.TOP_RIGHT:return new Ht(new v(A,e),new v(A+i,e),new v(a,B-o),new v(a,B));case J.BOTTOM_RIGHT:return new Ht(new v(a,e),new v(a,e+o),new v(A+i,B),new v(A,B));case J.BOTTOM_LEFT:default:return new Ht(new v(a,B),new v(a-i,B),new v(A,e+o),new v(A,e))}},Nt=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Fu=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Vt=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},pu=(function(){function A(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return A})(),yt=(function(){function A(e,t){this.path=e,this.target=t,this.type=1}return A})(),mu=(function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A})(),vu=function(A){return A.type===0},Di=function(A){return A.type===1},Eu=function(A){return A.type===2},Ds=function(A,e){return A.length===e.length?A.some(function(t,r){return t===e[r]}):!1},Hu=function(A,e,t,r,n){return A.map(function(s,i){switch(i){case 0:return s.add(e,t);case 1:return s.add(e+r,t);case 2:return s.add(e+r,t+n);case 3:return s.add(e,t+n)}return s})},_i=(function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),Mi=(function(){function A(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Uu(this.container),this.container.styles.opacity<1&&this.effects.push(new mu(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new pu(r,n,s))}if(this.container.styles.overflowX!==0){var i=Nt(this.curves),o=Vt(this.curves);Ds(i,o)?this.effects.push(new yt(i,6)):(this.effects.push(new yt(i,2)),this.effects.push(new yt(o,4)))}}return A.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var s=r.effects.filter(function(a){return!Di(a)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,s),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var i=Nt(r.curves),o=Vt(r.curves);Ds(i,o)||n.unshift(new yt(o,6))}}else n.unshift.apply(n,s);r=r.parent}return n.filter(function(a){return sA(a.target,e)})},A})(),an=function(A,e,t,r){A.container.elements.forEach(function(n){var s=sA(n.flags,4),i=sA(n.flags,2),o=new Mi(n,A);sA(n.styles.display,2048)&&r.push(o);var a=sA(n.flags,8)?[]:r;if(s||i){var B=s||n.styles.isPositioned()?t:e,l=new _i(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var f=0;B.negativeZIndex.some(function(g,w){return u>g.element.container.styles.zIndex.order?(f=w,!1):f>0}),B.negativeZIndex.splice(f,0,l)}else if(u>0){var C=0;B.positiveZIndex.some(function(g,w){return u>=g.element.container.styles.zIndex.order?(C=w+1,!1):C>0}),B.positiveZIndex.splice(C,0,l)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else n.styles.isFloating()?B.nonPositionedFloats.push(l):B.nonPositionedInlineLevel.push(l);an(o,l,s?l:t,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),an(o,e,t,a);sA(n.flags,8)&&Ri(n,a)})},Ri=function(A,e){for(var t=A instanceof tn?A.start:1,r=A instanceof tn?A.reversed:!1,n=0;n<e.length;n++){var s=e[n];s.container instanceof Fi&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=$e(t,s.container.styles.listStyleType,!0),t+=r?-1:1}},yu=function(A){var e=new Mi(A,null),t=new _i(e),r=[];return an(e,t,t,r),Ri(e.container,r),t},_s=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Iu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return HA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},bu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},xu=function(A,e){switch(e){case 0:return It(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return It(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return It(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return It(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},It=function(A,e){var t=[];return vA(A)?t.push(A.subdivide(.5,!1)):t.push(A),vA(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},HA=function(A,e,t,r){var n=[];return vA(A)?n.push(A.subdivide(.5,!1)):n.push(A),vA(t)?n.push(t.subdivide(.5,!0)):n.push(t),vA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),vA(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},Oi=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Pt=function(A){var e=A.styles,t=A.bounds,r=z(e.paddingLeft,t.width),n=z(e.paddingRight,t.width),s=z(e.paddingTop,t.width),i=z(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},Tu=function(A,e){return A===0?e.bounds:A===2?Pt(e):Oi(e)},Lu=function(A,e){return A===0?e.bounds:A===2?Pt(e):Oi(e)},Rr=function(A,e,t){var r=Tu(me(A.styles.backgroundOrigin,e),A),n=Lu(me(A.styles.backgroundClip,e),A),s=Su(me(A.styles.backgroundSize,e),t,r),i=s[0],o=s[1],a=Pe(me(A.styles.backgroundPosition,e),r.width-i,r.height-o),B=Ku(me(A.styles.backgroundRepeat,e),a,s,r,n),l=Math.round(r.left+a[0]),u=Math.round(r.top+a[1]);return[B,l,u,i,o]},Fe=function(A){return Z(A)&&A.value===Ee.AUTO},bt=function(A){return typeof A=="number"},Su=function(A,e,t){var r=e[0],n=e[1],s=e[2],i=A[0],o=A[1];if(!i)return[0,0];if(nA(i)&&o&&nA(o))return[z(i,t.width),z(o,t.height)];var a=bt(s);if(Z(i)&&(i.value===Ee.CONTAIN||i.value===Ee.COVER)){if(bt(s)){var B=t.width/t.height;return B<s!=(i.value===Ee.COVER)?[t.width,t.width/s]:[t.height*s,t.height]}return[t.width,t.height]}var l=bt(r),u=bt(n),f=l||u;if(Fe(i)&&(!o||Fe(o))){if(l&&u)return[r,n];if(!a&&!f)return[t.width,t.height];if(f&&a){var C=l?r:n*s,g=u?n:r/s;return[C,g]}var w=l?r:t.width,x=u?n:t.height;return[w,x]}if(a){var F=0,p=0;return nA(i)?F=z(i,t.width):nA(o)&&(p=z(o,t.height)),Fe(i)?F=p*s:(!o||Fe(o))&&(p=F/s),[F,p]}var L=null,m=null;if(nA(i)?L=z(i,t.width):o&&nA(o)&&(m=z(o,t.height)),L!==null&&(!o||Fe(o))&&(m=l&&u?L/r*n:t.height),m!==null&&Fe(i)&&(L=l&&u?m/n*r:t.width),L!==null&&m!==null)return[L,m];throw new Error("Unable to calculate background-size for element")},me=function(A,e){var t=A[e];return typeof t>"u"?A[0]:t},Ku=function(A,e,t,r,n){var s=e[0],i=e[1],o=t[0],a=t[1];switch(A){case 2:return[new v(Math.round(r.left),Math.round(r.top+i)),new v(Math.round(r.left+r.width),Math.round(r.top+i)),new v(Math.round(r.left+r.width),Math.round(a+r.top+i)),new v(Math.round(r.left),Math.round(a+r.top+i))];case 3:return[new v(Math.round(r.left+s),Math.round(r.top)),new v(Math.round(r.left+s+o),Math.round(r.top)),new v(Math.round(r.left+s+o),Math.round(r.height+r.top)),new v(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new v(Math.round(r.left+s),Math.round(r.top+i)),new v(Math.round(r.left+s+o),Math.round(r.top+i)),new v(Math.round(r.left+s+o),Math.round(r.top+i+a)),new v(Math.round(r.left+s),Math.round(r.top+i+a))];default:return[new v(Math.round(n.left),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.height+n.top)),new v(Math.round(n.left),Math.round(n.height+n.top))]}},Du="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ms="Hidden Text",_u=(function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",i.appendChild(r),n.src=Du,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=e,s.style.fontSize=t,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(Ms)),r.appendChild(s),r.appendChild(n);var o=n.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(Ms)),r.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-r.offsetTop+2;return i.removeChild(r),{baseline:o,middle:a}},A.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},A})(),Gi=(function(){function A(e,t){this.context=e,this.options=t}return A})(),Mu=1e4,Ru=(function(A){LA(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new _u(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),Eu(t)&&(this.ctx.globalAlpha=t.opacity),vu(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Di(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return wA(this,void 0,void 0,function(){var r;return cA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return wA(this,void 0,void 0,function(){return cA(this,function(r){switch(r.label){case 0:if(sA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,n){var s=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var i=fn(t.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,t.bounds.top+n),o+s.ctx.measureText(a).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Pu(t.fontFamily).join(", "),s=et(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,s,n].join(" "),n,s]},e.prototype.renderTextNode=function(t,r){return wA(this,void 0,void 0,function(){var n,s,i,o,a,B,l,u,f=this;return cA(this,function(C){return n=this.createFontStyle(r),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),B=a.baseline,l=a.middle,u=r.paintOrder,t.textBounds.forEach(function(g){u.forEach(function(w){switch(w){case 0:f.ctx.fillStyle=iA(r.color),f.renderTextWithLetterSpacing(g,r.letterSpacing,B);var x=r.textShadow;x.length&&g.text.trim().length&&(x.slice(0).reverse().forEach(function(F){f.ctx.shadowColor=iA(F.color),f.ctx.shadowOffsetX=F.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=F.offsetY.number*f.options.scale,f.ctx.shadowBlur=F.blur.number,f.renderTextWithLetterSpacing(g,r.letterSpacing,B)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),r.textDecorationLine.length&&(f.ctx.fillStyle=iA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(F){switch(F){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+l),g.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=iA(r.webkitTextStrokeColor),f.ctx.lineWidth=r.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var s=Pt(t),i=Vt(r);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a,p,p,B,l,u,f,m,C,g,I,w,x,F,p,L,m,I;return cA(this,function(h){switch(h.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,s=r.styles,i=0,o=r.textNodes,h.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:h.sent(),h.label=3;case 3:return i++,[3,1];case 4:if(!(r instanceof di))return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return p=h.sent(),this.renderReplacedElement(r,n,p),[3,8];case 7:return h.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof hi&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Ui))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return p=h.sent(),this.renderReplacedElement(r,n,p),[3,12];case 11:return h.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof vi&&r.tree?(B=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,B.render(r.tree)]):[3,14];case 13:l=h.sent(),r.width&&r.height&&this.ctx.drawImage(l,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),h.label=14;case 14:if(r instanceof gn&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===Mt?r.checked&&(this.ctx.save(),this.path([new v(r.bounds.left+u*.39363,r.bounds.top+u*.79),new v(r.bounds.left+u*.16,r.bounds.top+u*.5549),new v(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new v(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new v(r.bounds.left+u*.72983,r.bounds.top+u*.23),new v(r.bounds.left+u*.84,r.bounds.top+u*.34085),new v(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=iA(vs),this.ctx.fill(),this.ctx.restore()):r.type===Rt&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=iA(vs),this.ctx.fill(),this.ctx.restore())),Ou(r)&&r.value.length){switch(f=this.createFontStyle(s),m=f[0],C=f[1],g=this.fontMetrics.getMetrics(m,C).baseline,this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Nu(r.styles.textAlign),I=Pt(r),w=0,r.styles.textAlign){case 1:w+=I.width/2;break;case 2:w+=I.width;break}x=I.add(w,0,0,-I.height/2+1),this.ctx.save(),this.path([new v(I.left,I.top),new v(I.left+I.width,I.top),new v(I.left+I.width,I.top+I.height),new v(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ze(r.value,x),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!sA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(F=r.styles.listStyleImage,F.type!==0)return[3,18];p=void 0,L=F.url,h.label=15;case 15:return h.trys.push([15,17,,18]),[4,this.context.cache.match(L)];case 16:return p=h.sent(),this.ctx.drawImage(p,r.bounds.left-(p.width+10),r.bounds.top),[3,18];case 17:return h.sent(),this.context.logger.error("Error loading list-style-image "+L),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(m=this.createFontStyle(s)[0],this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new PA(r.bounds.left,r.bounds.top+z(r.styles.paddingTop,r.bounds.width),r.bounds.width,os(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ze(t.listValue,I),s.letterSpacing,os(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),h.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return wA(this,void 0,void 0,function(){var r,n,F,s,i,F,o,a,F,B,l,F,u,f,F,C,g,F,w,x,F;return cA(this,function(p){switch(p.label){case 0:if(sA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:p.sent(),r=0,n=t.negativeZIndex,p.label=2;case 2:return r<n.length?(F=n[r],[4,this.renderStack(F)]):[3,5];case 3:p.sent(),p.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:p.sent(),s=0,i=t.nonInlineLevel,p.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:p.sent(),p.label=9;case 9:return s++,[3,7];case 10:o=0,a=t.nonPositionedFloats,p.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:p.sent(),p.label=13;case 13:return o++,[3,11];case 14:B=0,l=t.nonPositionedInlineLevel,p.label=15;case 15:return B<l.length?(F=l[B],[4,this.renderStack(F)]):[3,18];case 16:p.sent(),p.label=17;case 17:return B++,[3,15];case 18:u=0,f=t.inlineLevel,p.label=19;case 19:return u<f.length?(F=f[u],[4,this.renderNode(F)]):[3,22];case 20:p.sent(),p.label=21;case 21:return u++,[3,19];case 22:C=0,g=t.zeroOrAutoZIndexOrTransformedOrOpacity,p.label=23;case 23:return C<g.length?(F=g[C],[4,this.renderStack(F)]):[3,26];case 24:p.sent(),p.label=25;case 25:return C++,[3,23];case 26:w=0,x=t.positiveZIndex,p.label=27;case 27:return w<x.length?(F=x[w],[4,this.renderStack(F)]):[3,30];case 28:p.sent(),p.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){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(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(n,s){var i=vA(n)?n.start:n;s===0?r.ctx.moveTo(i.x,i.y):r.ctx.lineTo(i.x,i.y),vA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,r,n,s){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},e.prototype.resizeImage=function(t,r,n){var s;if(t.width===r&&t.height===n)return t;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,n),o},e.prototype.renderBackgroundImage=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a;return cA(this,function(B){switch(B.label){case 0:r=t.styles.backgroundImage.length-1,n=function(l){var u,f,C,Y,k,P,_,O,M,g,Y,k,P,_,O,w,x,F,p,L,m,I,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA,FA;return cA(this,function(RA){switch(RA.label){case 0:if(l.type!==0)return[3,5];u=void 0,f=l.url,RA.label=1;case 1:return RA.trys.push([1,3,,4]),[4,s.context.cache.match(f)];case 2:return u=RA.sent(),[3,4];case 3:return RA.sent(),s.context.logger.error("Error loading background-image "+f),[3,4];case 4:return u&&(C=Rr(t,r,[u.width,u.height,u.width/u.height]),Y=C[0],k=C[1],P=C[2],_=C[3],O=C[4],M=s.ctx.createPattern(s.resizeImage(u,_,O),"repeat"),s.renderRepeat(Y,M,k,P)),[3,6];case 5:vB(l)?(g=Rr(t,r,[null,null,null]),Y=g[0],k=g[1],P=g[2],_=g[3],O=g[4],w=hB(l.angle,_,O),x=w[0],F=w[1],p=w[2],L=w[3],m=w[4],I=document.createElement("canvas"),I.width=_,I.height=O,h=I.getContext("2d"),y=h.createLinearGradient(F,L,p,m),ss(l.stops,x).forEach(function(ee){return y.addColorStop(ee.stop,iA(ee.color))}),h.fillStyle=y,h.fillRect(0,0,_,O),_>0&&O>0&&(M=s.ctx.createPattern(I,"repeat"),s.renderRepeat(Y,M,k,P))):EB(l)&&(S=Rr(t,r,[null,null,null]),Y=S[0],K=S[1],R=S[2],_=S[3],O=S[4],q=l.position.length===0?[cn]:l.position,k=z(q[0],_),P=z(q[q.length-1],O),uA=UB(l,k,P,_,O),$=uA[0],eA=uA[1],$>0&&eA>0&&(UA=s.ctx.createRadialGradient(K+k,R+P,0,K+k,R+P,$),ss(l.stops,$*2).forEach(function(ee){return UA.addColorStop(ee.stop,iA(ee.color))}),s.path(Y),s.ctx.fillStyle=UA,$!==eA?(MA=t.bounds.left+.5*t.bounds.width,QA=t.bounds.top+.5*t.bounds.height,yA=eA/$,FA=1/yA,s.ctx.save(),s.ctx.translate(MA,QA),s.ctx.transform(1,0,0,yA,0,0),s.ctx.translate(-MA,-QA),s.ctx.fillRect(K,FA*(R-QA)+QA,_,O*FA),s.ctx.restore()):s.ctx.fill())),RA.label=6;case 6:return r--,[2]}})},s=this,i=0,o=t.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:B.sent(),B.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,n){return wA(this,void 0,void 0,function(){return cA(this,function(s){return this.path(_s(n,r)),this.ctx.fillStyle=iA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,n,s){return wA(this,void 0,void 0,function(){var i,o;return cA(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Iu(s,n),this.path(i),this.ctx.fillStyle=iA(t),this.ctx.fill(),o=bu(s,n),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a,B,l,u=this;return cA(this,function(f){switch(f.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!$A(r.backgroundColor)||r.backgroundImage.length,s=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],i=Gu(me(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),$A(r.backgroundColor)||(this.ctx.fillStyle=iA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(C){u.ctx.save();var g=Nt(t.curves),w=C.inset?0:Mu,x=Hu(g,-w+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(u.path(g),u.ctx.clip(),u.mask(x)):(u.mask(g),u.ctx.clip(),u.path(x)),u.ctx.shadowOffsetX=C.offsetX.number+w,u.ctx.shadowOffsetY=C.offsetY.number,u.ctx.shadowColor=iA(C.color),u.ctx.shadowBlur=C.blur.number,u.ctx.fillStyle=C.inset?iA(C.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),f.label=2;case 2:o=0,a=0,B=s,f.label=3;case 3:return a<B.length?(l=B[a],l.style!==0&&!$A(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,o,t.curves,3)];case 6:return f.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,o,t.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,t.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,n,s,i){return wA(this,void 0,void 0,function(){var o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,h,I,h;return cA(this,function(y){return this.ctx.save(),o=xu(s,n),a=_s(s,n),i===2&&(this.path(a),this.ctx.clip()),vA(a[0])?(B=a[0].start.x,l=a[0].start.y):(B=a[0].x,l=a[0].y),vA(a[1])?(u=a[1].end.x,f=a[1].end.y):(u=a[1].x,f=a[1].y),n===0||n===2?C=Math.abs(B-u):C=Math.abs(l-f),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=r<3?r*3:r*2,w=r<3?r*2:r,i===3&&(g=r,w=r),x=!0,C<=g*2?x=!1:C<=g*2+w?(F=C/(2*g+w),g*=F,w*=F):(p=Math.floor((C+w)/(g+w)),L=(C-p*g)/(p-1),m=(C-(p+1)*g)/p,w=m<=0||Math.abs(w-L)<Math.abs(w-m)?L:m),x&&(i===3?this.ctx.setLineDash([0,g+w]):this.ctx.setLineDash([g,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=iA(t),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(vA(a[0])&&(I=a[3],h=a[0],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke()),vA(a[1])&&(I=a[1],h=a[2],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return wA(this,void 0,void 0,function(){var r;return cA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=yu(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Gi),Ou=function(A){return A instanceof mi||A instanceof pi?!0:A instanceof gn&&A.type!==Rt&&A.type!==Mt},Gu=function(A,e){switch(A){case 0:return Nt(e);case 2:return Fu(e);default:return Vt(e)}},Nu=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Vu=["-apple-system","system-ui"],Pu=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Vu.indexOf(e)===-1}):A},ku=(function(A){LA(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return e.prototype.render=function(t){return wA(this,void 0,void 0,function(){var r,n;return cA(this,function(s){switch(s.label){case 0:return r=en(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Xu(r)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Gi),Xu=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Wu=(function(){function A(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,ut([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A})(),Ju=(function(){function A(e,t){var r;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new Wu({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new fu(this,e)}return A.instanceCount=1,A})(),Yu=function(A,e){return e===void 0&&(e={}),Zu(A,e)};typeof window<"u"&&Ki.setContext(window);var Zu=function(A,e){return wA(void 0,void 0,void 0,function(){var t,r,n,s,i,o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,y,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA;return cA(this,function(FA){switch(FA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=A.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(S=e.imageTimeout)!==null&&S!==void 0?S:15e3,proxy:e.proxy,useCORS:(Y=e.useCORS)!==null&&Y!==void 0?Y:!1},s=Gr({logging:(K=e.logging)!==null&&K!==void 0?K:!0,cache:e.cache},n),i={windowWidth:(R=e.windowWidth)!==null&&R!==void 0?R:r.innerWidth,windowHeight:(_=e.windowHeight)!==null&&_!==void 0?_:r.innerHeight,scrollX:(O=e.scrollX)!==null&&O!==void 0?O:r.pageXOffset,scrollY:(q=e.scrollY)!==null&&q!==void 0?q:r.pageYOffset},o=new PA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Ju(s,o),B=(k=e.foreignObjectRendering)!==null&&k!==void 0?k:!1,l={allowTaint:(P=e.allowTaint)!==null&&P!==void 0?P:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:B,copyStyles:B},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new Ss(a,A,l),f=u.clonedReferenceElement,f?[4,u.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=FA.sent(),g=wn(f)||ql(f)?Ho(f.ownerDocument):kt(a,f),w=g.width,x=g.height,F=g.left,p=g.top,L=qu(a,f,e.backgroundColor),m={canvas:e.canvas,backgroundColor:L,scale:($=(uA=e.scale)!==null&&uA!==void 0?uA:r.devicePixelRatio)!==null&&$!==void 0?$:1,x:((eA=e.x)!==null&&eA!==void 0?eA:0)+F,y:((UA=e.y)!==null&&UA!==void 0?UA:0)+p,width:(MA=e.width)!==null&&MA!==void 0?MA:Math.ceil(w),height:(QA=e.height)!==null&&QA!==void 0?QA:Math.ceil(x)},B?(a.logger.debug("Document cloned, using foreign object rendering"),y=new ku(a,m),[4,y.render(f)]):[3,3];case 2:return I=FA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+p+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),h=Hi(a,f),L===h.styles.backgroundColor&&(h.styles.backgroundColor=VA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+m.x+","+m.y+" with size "+m.width+"x"+m.height),y=new Ru(a,m),[4,y.render(h)];case 4:I=FA.sent(),FA.label=5;case 5:return(!((yA=e.removeContainer)!==null&&yA!==void 0)||yA)&&(Ss.destroy(C)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,I]}})})},qu=function(A,e,t){var r=e.ownerDocument,n=r.documentElement?Je(A,getComputedStyle(r.documentElement).backgroundColor):VA.TRANSPARENT,s=r.body?Je(A,getComputedStyle(r.body).backgroundColor):VA.TRANSPARENT,i=typeof t=="string"?Je(A,t):t===null?VA.TRANSPARENT:4294967295;return e===r.documentElement?$A(n)?$A(s)?i:s:n:i},Ni=Yu;var Vi=!1,ju=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]);function zu(){if(Vi)return;Vi=!0;let A=CanvasRenderingContext2D.prototype.createPattern;CanvasRenderingContext2D.prototype.createPattern=function(e,t){return e&&"width"in e&&"height"in e&&(e.width===0||e.height===0)?null:A.call(this,e,t)}}function ki(){zu()}function $u(A,e){if(!A.id)return;let t=e.getElementById(A.id);t instanceof HTMLElement&&(t.style.opacity="1",t.style.visibility="visible",t.querySelectorAll("[data-start]").forEach(r=>{r.style.visibility="visible"}))}function Af(A){let e=A.ownerDocument.defaultView;e&&[A,...Array.from(A.querySelectorAll("*"))].forEach(t=>{if(ju.has(t.tagName))return;let r=e.getComputedStyle(t);if(r.boxShadow==="none"||r.transform==="none")return;let n=A.ownerDocument.createElement("div");n.setAttribute("data-hyper-shader-shadow-shim",""),n.style.cssText=["position:absolute","inset:0","border-radius:inherit",`box-shadow:${r.boxShadow}`,"background:transparent","pointer-events:none","z-index:0"].join(";"),r.position==="static"&&(t.style.position="relative"),t.style.boxShadow="none",t.insertBefore(n,t.firstChild)})}function tt(){if(typeof document>"u")return!1;let A=document.createElement("canvas");if(A.setAttribute("layoutsubtree",""),!("layoutSubtree"in A))return!1;let e=A.getContext("2d");return e!=null&&typeof e.drawElementImage=="function"}async function ef(A,e,t,r){let n=document.createElement("canvas");n.width=t,n.height=r,n.setAttribute("layoutsubtree",""),n.style.cssText=`position:fixed;top:0;left:0;width:${t}px;height:${r}px;z-index:-9999;pointer-events:none;opacity:0`,n.appendChild(A.cloneNode(!0)),document.body.appendChild(n);try{await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(()=>a())));let s=n.getContext("2d");s.fillStyle=e,s.fillRect(0,0,t,r);let i=n.firstElementChild;i&&s.drawElementImage(i,0,0,t,r);let o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(n,0,0),n.remove(),o}catch(s){throw n.remove(),s}}function Xi(A,e,t=fe,r=ge,n={}){return tt()&&!n.preferBrowserPaint?ef(A,e,t,r).catch(()=>Pi(A,e,t,r,n)):Pi(A,e,t,r,n)}function Pi(A,e,t,r,n={}){let s=i=>Ni(A,{width:t,height:r,scale:n.scale??1,backgroundColor:e,logging:!1,foreignObjectRendering:i,useCORS:!0,allowTaint:!0,onclone:o=>{if(!A.id)return;let a=o.getElementById(A.id);a instanceof HTMLElement&&Af(a),n.forceVisible&&$u(A,o)},ignoreElements:o=>o.tagName==="CANVAS"||o.hasAttribute("data-no-capture")});return n.preferBrowserPaint===!0?s(!0).catch(()=>s(!1)):s(!1)}var Ar="__hf-page-side-compositor",Qn="__hf_page_compositor_v1__";function Wi(A){return{left:`${A.left}px`,top:`${A.top}px`,width:`${A.width}px`,height:`${A.height}px`}}function Cn(){if(typeof window>"u"||typeof document>"u"||!tt())return!1;let A=document.createElement("canvas"),e=A.getContext("webgl")||A.getContext("experimental-webgl");return e?(e.getExtension("WEBGL_lose_context")?.loseContext(),!0):!1}function er(A){if(typeof window>"u")return!1;if(window.__HF_PAGE_COMPOSITOR_CANARY__=Qn,!Cn())return console.warn("[HyperShader] page-side compositing requested but drawElementImage/WebGL is not available; falling back to opacity-flip mode (Node-side layered pipeline will handle the blend)."),!1;if(document.getElementById(Ar))return!0;let{scenes:e,transitions:t,accentColors:r,width:n,height:s,defaultDuration:i}=A,o=document.createElement("canvas");o.id=Ar,o.width=n,o.height=s,o.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483646;pointer-events:none;display:none;",document.body.appendChild(o);let a=ot(o,n,s);if(!a)return console.warn("[HyperShader] page-side compositor: WebGL context unavailable."),o.remove(),!1;let B=at(a),l=new Map;for(let K of t)if(K.shader!==void 0&&!l.has(K.shader))try{l.set(K.shader,Bt(a,lt(K.shader)))}catch(R){console.warn(`[HyperShader] page-side compositor: failed to compile "${K.shader}":`,R)}let u=[];for(let K=0;K<t.length;K++){let R=t[K];if(!R||R.shader===void 0)continue;let _=e[K],O=e[K+1],q=l.get(R.shader);!_||!O||!q||u.push({time:R.time,duration:R.duration??i,shader:R.shader,fromSceneId:_,toSceneId:O,prog:q})}if(u.length===0)return o.remove(),!1;let f=ne(a),C=ne(a),g=document.createElement("canvas"),w=document.createElement("canvas");for(let K of[g,w])K.width=n,K.height=s,K.setAttribute("layoutsubtree",""),K.style.cssText="position:fixed;top:0;left:0;width:"+n+"px;height:"+s+"px;z-index:-9998;pointer-events:none;",document.body.appendChild(K);function x(K){for(let R of u)if(K>=R.time&&K<=R.time+R.duration)return R;return null}function F(K){let R=0;for(let _ of t)K>=_.time+(_.duration??i)&&(R+=1);return e[Math.min(R,e.length-1)]}let p=null,L=0,m=window;async function I(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=document.getElementById(K.fromSceneId),_=document.getElementById(K.toSceneId);if(!(R instanceof HTMLElement)||!(_ instanceof HTMLElement))return m.__hf_page_composite_pending=!1,!1;let O=Wi(R.getBoundingClientRect()),q=Wi(_.getBoundingClientRect());for(;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=R.cloneNode(!0),P=_.cloneNode(!0);g.appendChild(k),w.appendChild(P);for(let[$,eA]of[[k,O],[P,q]])$.style.opacity="1",$.style.visibility="visible",$.style.position="absolute",$.style.left=eA.left,$.style.top=eA.top,$.style.width=eA.width,$.style.height=eA.height,$.querySelectorAll("[data-start]").forEach(UA=>{UA.style.opacity="1",UA.style.visibility="visible"});let uA=[];for(let $ of[g,w])for(let eA of $.querySelectorAll("img"))eA.src&&eA.src.startsWith("data:")&&typeof eA.decode=="function"&&uA.push(eA.decode().catch(()=>{}));return uA.length>0&&await Promise.all(uA),!0}function h(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=g.firstElementChild,_=w.firstElementChild;if(!R||!_)return m.__hf_page_composite_pending=!1,!1;let O=g.getContext("2d"),q=w.getContext("2d");if(!O?.drawElementImage||!q?.drawElementImage)return m.__hf_page_composite_pending=!1,!1;try{O.fillStyle=A.bgColor,O.fillRect(0,0,n,s),O.drawElementImage(R,0,0,n,s),q.fillStyle=A.bgColor,q.fillRect(0,0,n,s),q.drawElementImage(_,0,0,n,s)}catch(k){return console.warn("[HyperShader] page-side compositor: drawElementImage failed:",k),m.__hf_page_composite_pending=!1,!1}we(a,f,g),we(a,C,w);try{ct(a,B,K.prog,f,C,L,r,n,s),o.style.display="block"}catch(k){console.warn("[HyperShader] page-side compositor: renderShader failed:",k),o.style.display="none"}return m.__hf_page_composite_pending=!1,!0}m.__hf_page_composite_resolve=h,m.__hf_page_composite_prepare=I;let y=window,M=()=>{if(!y.__hf)return;let K=y.__hf.seek;if(typeof K!="function")return;let R=_=>{let O=K.call(y.__hf,_),q=x(_);if(!q){for(o.style.display="none",m.__hf_page_composite_pending=!1;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=F(_),P=k?document.getElementById(k):null;return P instanceof HTMLElement&&P.style.visibility==="hidden"&&(P.style.visibility="visible"),O}return p=q,L=q.duration===0?1:Math.min(1,Math.max(0,(_-q.time)/q.duration)),m.__hf_page_composite_pending=!0,O};y.__hf.seek=R},S=0,Y=window.setInterval(()=>{S+=1,y.__hf?.seek?(M(),window.clearInterval(Y)):S>200&&(window.clearInterval(Y),console.warn("[HyperShader] page-side compositor: window.__hf.seek never appeared after 10s; the engine bridge did not initialize. Falling back to opacity-flip mode."))},50);return!0}var nr=.7,hn="power2.inOut",tf="attribute vec2 a_pos; varying vec2 v_uv; void main(){v_uv=a_pos*0.5+0.5; gl_Position=vec4(a_pos,0,1);}",tr=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"],rf="hyper-shader-preview-cache",_A="frames",nf=1,sf="v1",Ji=2,Yi=1.25,of=1200;function af(A){let e=A.replace("#","");if(e.length<6)return[.5,.5,.5];let t=parseInt(e.slice(0,2),16)/255,r=parseInt(e.slice(2,4),16)/255,n=parseInt(e.slice(4,6),16)/255;return Number.isNaN(t)||Number.isNaN(r)||Number.isNaN(n)?[.5,.5,.5]:[t,r,n]}function to(A){let[e,t,r]=af(A);return{accent:[e,t,r],dark:[e*.35,t*.35,r*.35],bright:[Math.min(1,e*1.5+.2),Math.min(1,t*1.5+.2),Math.min(1,r*1.5+.2)]}}function ce(A,e,t){return Math.min(t,Math.max(e,A))}function Bf(A,e){return A===void 0?e:Number.isFinite(A)&&A>0?A:e}var cf="__hf_shader_capture_scale",lf="__hf_shader_loading";function ro(A,e){let t=window[A];if(typeof t=="string")return t;if(typeof t=="number"&&Number.isFinite(t))return String(t);try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function uf(){let A=ro("__HF_SHADER_CAPTURE_SCALE",cf),e=A===null?NaN:Number(A);return ce(Number.isFinite(e)&&e>0?e:1,.25,1)}function ff(){let A=ro("__HF_SHADER_LOADING",lf)?.trim().toLowerCase();return A==="player"||A==="true"||A==="1"?"player":A==="none"||A==="false"||A==="0"||A==="off"?"none":"internal"}function ir(A){let e=2166136261;for(let t=0;t<A.length;t+=1)e^=A.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function gf(A){let e=Array.from(A.querySelectorAll("style")).map(r=>r.textContent||"").join(`
|
|
6
|
+
.`+on+cu+Ks)},uu=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},Ki=(function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A})(),fu=(function(){function A(e,t){this.context=e,this._options=t,this._cache={}}return A.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Mr(e)||Cu(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return wA(this,void 0,void 0,function(){var t,r,n,s,i=this;return cA(this,function(o){switch(o.label){case 0:return t=Ki.isSameOrigin(e),r=!_r(e)&&this._options.useCORS===!0&&aA.SUPPORT_CORS_IMAGES&&!t,n=!_r(e)&&!t&&!Mr(e)&&typeof this._options.proxy=="string"&&aA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!_r(e)&&!Mr(e)&&!n&&!r?[2]:(s=e,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(a,B){var l=new Image;l.onload=function(){return a(l)},l.onerror=B,(du(s)||r)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return a(l)},500),i._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(s,i){var o=aA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(f){return i(f)},!1),u.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var B=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+B+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+n)}}a.send()})},A})(),gu=/^data:image\/svg\+xml/i,wu=/^data:image\/.*;base64,/i,Qu=/^data:image\/.*/i,Cu=function(A){return aA.SUPPORT_SVG_DRAWING||!hu(A)},_r=function(A){return Qu.test(A)},du=function(A){return wu.test(A)},Mr=function(A){return A.substr(0,4)==="blob"},hu=function(A){return A.substr(-3).toLowerCase()==="svg"||gu.test(A)},v=(function(){function A(e,t){this.type=0,this.x=e,this.y=t}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A})(),Ue=function(A,e,t){return new v(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Ht=(function(){function A(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}return A.prototype.subdivide=function(e,t){var r=Ue(this.start,this.startControl,e),n=Ue(this.startControl,this.endControl,e),s=Ue(this.endControl,this.end,e),i=Ue(r,n,e),o=Ue(n,s,e),a=Ue(i,o,e);return t?new A(this.start,r,i,a):new A(a,o,s,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),vA=function(A){return A.type===1},Uu=(function(){function A(e){var t=e.styles,r=e.bounds,n=Pe(t.borderTopLeftRadius,r.width,r.height),s=n[0],i=n[1],o=Pe(t.borderTopRightRadius,r.width,r.height),a=o[0],B=o[1],l=Pe(t.borderBottomRightRadius,r.width,r.height),u=l[0],f=l[1],C=Pe(t.borderBottomLeftRadius,r.width,r.height),g=C[0],w=C[1],x=[];x.push((s+a)/r.width),x.push((g+u)/r.width),x.push((i+w)/r.height),x.push((B+f)/r.height);var F=Math.max.apply(Math,x);F>1&&(s/=F,i/=F,a/=F,B/=F,u/=F,f/=F,g/=F,w/=F);var p=r.width-a,L=r.height-f,m=r.width-u,I=r.height-w,h=t.borderTopWidth,y=t.borderRightWidth,M=t.borderBottomWidth,S=t.borderLeftWidth,Y=z(t.paddingTop,e.bounds.width),K=z(t.paddingRight,e.bounds.width),R=z(t.paddingBottom,e.bounds.width),_=z(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?AA(r.left+S/3,r.top+h/3,s-S/3,i-h/3,J.TOP_LEFT):new v(r.left+S/3,r.top+h/3),this.topRightBorderDoubleOuterBox=s>0||i>0?AA(r.left+p,r.top+h/3,a-y/3,B-h/3,J.TOP_RIGHT):new v(r.left+r.width-y/3,r.top+h/3),this.bottomRightBorderDoubleOuterBox=u>0||f>0?AA(r.left+m,r.top+L,u-y/3,f-M/3,J.BOTTOM_RIGHT):new v(r.left+r.width-y/3,r.top+r.height-M/3),this.bottomLeftBorderDoubleOuterBox=g>0||w>0?AA(r.left+S/3,r.top+I,g-S/3,w-M/3,J.BOTTOM_LEFT):new v(r.left+S/3,r.top+r.height-M/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?AA(r.left+S*2/3,r.top+h*2/3,s-S*2/3,i-h*2/3,J.TOP_LEFT):new v(r.left+S*2/3,r.top+h*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?AA(r.left+p,r.top+h*2/3,a-y*2/3,B-h*2/3,J.TOP_RIGHT):new v(r.left+r.width-y*2/3,r.top+h*2/3),this.bottomRightBorderDoubleInnerBox=u>0||f>0?AA(r.left+m,r.top+L,u-y*2/3,f-M*2/3,J.BOTTOM_RIGHT):new v(r.left+r.width-y*2/3,r.top+r.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||w>0?AA(r.left+S*2/3,r.top+I,g-S*2/3,w-M*2/3,J.BOTTOM_LEFT):new v(r.left+S*2/3,r.top+r.height-M*2/3),this.topLeftBorderStroke=s>0||i>0?AA(r.left+S/2,r.top+h/2,s-S/2,i-h/2,J.TOP_LEFT):new v(r.left+S/2,r.top+h/2),this.topRightBorderStroke=s>0||i>0?AA(r.left+p,r.top+h/2,a-y/2,B-h/2,J.TOP_RIGHT):new v(r.left+r.width-y/2,r.top+h/2),this.bottomRightBorderStroke=u>0||f>0?AA(r.left+m,r.top+L,u-y/2,f-M/2,J.BOTTOM_RIGHT):new v(r.left+r.width-y/2,r.top+r.height-M/2),this.bottomLeftBorderStroke=g>0||w>0?AA(r.left+S/2,r.top+I,g-S/2,w-M/2,J.BOTTOM_LEFT):new v(r.left+S/2,r.top+r.height-M/2),this.topLeftBorderBox=s>0||i>0?AA(r.left,r.top,s,i,J.TOP_LEFT):new v(r.left,r.top),this.topRightBorderBox=a>0||B>0?AA(r.left+p,r.top,a,B,J.TOP_RIGHT):new v(r.left+r.width,r.top),this.bottomRightBorderBox=u>0||f>0?AA(r.left+m,r.top+L,u,f,J.BOTTOM_RIGHT):new v(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=g>0||w>0?AA(r.left,r.top+I,g,w,J.BOTTOM_LEFT):new v(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||i>0?AA(r.left+S,r.top+h,Math.max(0,s-S),Math.max(0,i-h),J.TOP_LEFT):new v(r.left+S,r.top+h),this.topRightPaddingBox=a>0||B>0?AA(r.left+Math.min(p,r.width-y),r.top+h,p>r.width+y?0:Math.max(0,a-y),Math.max(0,B-h),J.TOP_RIGHT):new v(r.left+r.width-y,r.top+h),this.bottomRightPaddingBox=u>0||f>0?AA(r.left+Math.min(m,r.width-S),r.top+Math.min(L,r.height-M),Math.max(0,u-y),Math.max(0,f-M),J.BOTTOM_RIGHT):new v(r.left+r.width-y,r.top+r.height-M),this.bottomLeftPaddingBox=g>0||w>0?AA(r.left+S,r.top+Math.min(I,r.height-M),Math.max(0,g-S),Math.max(0,w-M),J.BOTTOM_LEFT):new v(r.left+S,r.top+r.height-M),this.topLeftContentBox=s>0||i>0?AA(r.left+S+_,r.top+h+Y,Math.max(0,s-(S+_)),Math.max(0,i-(h+Y)),J.TOP_LEFT):new v(r.left+S+_,r.top+h+Y),this.topRightContentBox=a>0||B>0?AA(r.left+Math.min(p,r.width+S+_),r.top+h+Y,p>r.width+S+_?0:a-S+_,B-(h+Y),J.TOP_RIGHT):new v(r.left+r.width-(y+K),r.top+h+Y),this.bottomRightContentBox=u>0||f>0?AA(r.left+Math.min(m,r.width-(S+_)),r.top+Math.min(L,r.height+h+Y),Math.max(0,u-(y+K)),f-(M+R),J.BOTTOM_RIGHT):new v(r.left+r.width-(y+K),r.top+r.height-(M+R)),this.bottomLeftContentBox=g>0||w>0?AA(r.left+S+_,r.top+I,Math.max(0,g-(S+_)),w-(M+R),J.BOTTOM_LEFT):new v(r.left+S+_,r.top+r.height-(M+R))}return A})(),J;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(J||(J={}));var AA=function(A,e,t,r,n){var s=4*((Math.sqrt(2)-1)/3),i=t*s,o=r*s,a=A+t,B=e+r;switch(n){case J.TOP_LEFT:return new Ht(new v(A,B),new v(A,B-o),new v(a-i,e),new v(a,e));case J.TOP_RIGHT:return new Ht(new v(A,e),new v(A+i,e),new v(a,B-o),new v(a,B));case J.BOTTOM_RIGHT:return new Ht(new v(a,e),new v(a,e+o),new v(A+i,B),new v(A,B));case J.BOTTOM_LEFT:default:return new Ht(new v(a,B),new v(a-i,B),new v(A,e+o),new v(A,e))}},Nt=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Fu=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Vt=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},pu=(function(){function A(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return A})(),yt=(function(){function A(e,t){this.path=e,this.target=t,this.type=1}return A})(),mu=(function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A})(),vu=function(A){return A.type===0},Di=function(A){return A.type===1},Eu=function(A){return A.type===2},Ds=function(A,e){return A.length===e.length?A.some(function(t,r){return t===e[r]}):!1},Hu=function(A,e,t,r,n){return A.map(function(s,i){switch(i){case 0:return s.add(e,t);case 1:return s.add(e+r,t);case 2:return s.add(e+r,t+n);case 3:return s.add(e,t+n)}return s})},_i=(function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),Mi=(function(){function A(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Uu(this.container),this.container.styles.opacity<1&&this.effects.push(new mu(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new pu(r,n,s))}if(this.container.styles.overflowX!==0){var i=Nt(this.curves),o=Vt(this.curves);Ds(i,o)?this.effects.push(new yt(i,6)):(this.effects.push(new yt(i,2)),this.effects.push(new yt(o,4)))}}return A.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var s=r.effects.filter(function(a){return!Di(a)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,s),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var i=Nt(r.curves),o=Vt(r.curves);Ds(i,o)||n.unshift(new yt(o,6))}}else n.unshift.apply(n,s);r=r.parent}return n.filter(function(a){return sA(a.target,e)})},A})(),an=function(A,e,t,r){A.container.elements.forEach(function(n){var s=sA(n.flags,4),i=sA(n.flags,2),o=new Mi(n,A);sA(n.styles.display,2048)&&r.push(o);var a=sA(n.flags,8)?[]:r;if(s||i){var B=s||n.styles.isPositioned()?t:e,l=new _i(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var f=0;B.negativeZIndex.some(function(g,w){return u>g.element.container.styles.zIndex.order?(f=w,!1):f>0}),B.negativeZIndex.splice(f,0,l)}else if(u>0){var C=0;B.positiveZIndex.some(function(g,w){return u>=g.element.container.styles.zIndex.order?(C=w+1,!1):C>0}),B.positiveZIndex.splice(C,0,l)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else n.styles.isFloating()?B.nonPositionedFloats.push(l):B.nonPositionedInlineLevel.push(l);an(o,l,s?l:t,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),an(o,e,t,a);sA(n.flags,8)&&Ri(n,a)})},Ri=function(A,e){for(var t=A instanceof tn?A.start:1,r=A instanceof tn?A.reversed:!1,n=0;n<e.length;n++){var s=e[n];s.container instanceof Fi&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=$e(t,s.container.styles.listStyleType,!0),t+=r?-1:1}},yu=function(A){var e=new Mi(A,null),t=new _i(e),r=[];return an(e,t,t,r),Ri(e.container,r),t},_s=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Iu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return HA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},bu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},xu=function(A,e){switch(e){case 0:return It(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return It(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return It(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return It(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},It=function(A,e){var t=[];return vA(A)?t.push(A.subdivide(.5,!1)):t.push(A),vA(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},HA=function(A,e,t,r){var n=[];return vA(A)?n.push(A.subdivide(.5,!1)):n.push(A),vA(t)?n.push(t.subdivide(.5,!0)):n.push(t),vA(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),vA(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},Oi=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Pt=function(A){var e=A.styles,t=A.bounds,r=z(e.paddingLeft,t.width),n=z(e.paddingRight,t.width),s=z(e.paddingTop,t.width),i=z(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},Tu=function(A,e){return A===0?e.bounds:A===2?Pt(e):Oi(e)},Lu=function(A,e){return A===0?e.bounds:A===2?Pt(e):Oi(e)},Rr=function(A,e,t){var r=Tu(me(A.styles.backgroundOrigin,e),A),n=Lu(me(A.styles.backgroundClip,e),A),s=Su(me(A.styles.backgroundSize,e),t,r),i=s[0],o=s[1],a=Pe(me(A.styles.backgroundPosition,e),r.width-i,r.height-o),B=Ku(me(A.styles.backgroundRepeat,e),a,s,r,n),l=Math.round(r.left+a[0]),u=Math.round(r.top+a[1]);return[B,l,u,i,o]},Fe=function(A){return Z(A)&&A.value===Ee.AUTO},bt=function(A){return typeof A=="number"},Su=function(A,e,t){var r=e[0],n=e[1],s=e[2],i=A[0],o=A[1];if(!i)return[0,0];if(nA(i)&&o&&nA(o))return[z(i,t.width),z(o,t.height)];var a=bt(s);if(Z(i)&&(i.value===Ee.CONTAIN||i.value===Ee.COVER)){if(bt(s)){var B=t.width/t.height;return B<s!=(i.value===Ee.COVER)?[t.width,t.width/s]:[t.height*s,t.height]}return[t.width,t.height]}var l=bt(r),u=bt(n),f=l||u;if(Fe(i)&&(!o||Fe(o))){if(l&&u)return[r,n];if(!a&&!f)return[t.width,t.height];if(f&&a){var C=l?r:n*s,g=u?n:r/s;return[C,g]}var w=l?r:t.width,x=u?n:t.height;return[w,x]}if(a){var F=0,p=0;return nA(i)?F=z(i,t.width):nA(o)&&(p=z(o,t.height)),Fe(i)?F=p*s:(!o||Fe(o))&&(p=F/s),[F,p]}var L=null,m=null;if(nA(i)?L=z(i,t.width):o&&nA(o)&&(m=z(o,t.height)),L!==null&&(!o||Fe(o))&&(m=l&&u?L/r*n:t.height),m!==null&&Fe(i)&&(L=l&&u?m/n*r:t.width),L!==null&&m!==null)return[L,m];throw new Error("Unable to calculate background-size for element")},me=function(A,e){var t=A[e];return typeof t>"u"?A[0]:t},Ku=function(A,e,t,r,n){var s=e[0],i=e[1],o=t[0],a=t[1];switch(A){case 2:return[new v(Math.round(r.left),Math.round(r.top+i)),new v(Math.round(r.left+r.width),Math.round(r.top+i)),new v(Math.round(r.left+r.width),Math.round(a+r.top+i)),new v(Math.round(r.left),Math.round(a+r.top+i))];case 3:return[new v(Math.round(r.left+s),Math.round(r.top)),new v(Math.round(r.left+s+o),Math.round(r.top)),new v(Math.round(r.left+s+o),Math.round(r.height+r.top)),new v(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new v(Math.round(r.left+s),Math.round(r.top+i)),new v(Math.round(r.left+s+o),Math.round(r.top+i)),new v(Math.round(r.left+s+o),Math.round(r.top+i+a)),new v(Math.round(r.left+s),Math.round(r.top+i+a))];default:return[new v(Math.round(n.left),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.height+n.top)),new v(Math.round(n.left),Math.round(n.height+n.top))]}},Du="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ms="Hidden Text",_u=(function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",i.appendChild(r),n.src=Du,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=e,s.style.fontSize=t,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(Ms)),r.appendChild(s),r.appendChild(n);var o=n.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(Ms)),r.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-r.offsetTop+2;return i.removeChild(r),{baseline:o,middle:a}},A.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},A})(),Gi=(function(){function A(e,t){this.context=e,this.options=t}return A})(),Mu=1e4,Ru=(function(A){LA(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new _u(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),Eu(t)&&(this.ctx.globalAlpha=t.opacity),vu(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Di(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return wA(this,void 0,void 0,function(){var r;return cA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return wA(this,void 0,void 0,function(){return cA(this,function(r){switch(r.label){case 0:if(sA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,n){var s=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var i=fn(t.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,t.bounds.top+n),o+s.ctx.measureText(a).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Pu(t.fontFamily).join(", "),s=et(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,s,n].join(" "),n,s]},e.prototype.renderTextNode=function(t,r){return wA(this,void 0,void 0,function(){var n,s,i,o,a,B,l,u,f=this;return cA(this,function(C){return n=this.createFontStyle(r),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),B=a.baseline,l=a.middle,u=r.paintOrder,t.textBounds.forEach(function(g){u.forEach(function(w){switch(w){case 0:f.ctx.fillStyle=iA(r.color),f.renderTextWithLetterSpacing(g,r.letterSpacing,B);var x=r.textShadow;x.length&&g.text.trim().length&&(x.slice(0).reverse().forEach(function(F){f.ctx.shadowColor=iA(F.color),f.ctx.shadowOffsetX=F.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=F.offsetY.number*f.options.scale,f.ctx.shadowBlur=F.blur.number,f.renderTextWithLetterSpacing(g,r.letterSpacing,B)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),r.textDecorationLine.length&&(f.ctx.fillStyle=iA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(F){switch(F){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+l),g.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=iA(r.webkitTextStrokeColor),f.ctx.lineWidth=r.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var s=Pt(t),i=Vt(r);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a,p,p,B,l,u,f,m,C,g,I,w,x,F,p,L,m,I;return cA(this,function(h){switch(h.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,s=r.styles,i=0,o=r.textNodes,h.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:h.sent(),h.label=3;case 3:return i++,[3,1];case 4:if(!(r instanceof di))return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return p=h.sent(),this.renderReplacedElement(r,n,p),[3,8];case 7:return h.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof hi&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof Ui))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return p=h.sent(),this.renderReplacedElement(r,n,p),[3,12];case 11:return h.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof vi&&r.tree?(B=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,B.render(r.tree)]):[3,14];case 13:l=h.sent(),r.width&&r.height&&this.ctx.drawImage(l,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),h.label=14;case 14:if(r instanceof gn&&(u=Math.min(r.bounds.width,r.bounds.height),r.type===Mt?r.checked&&(this.ctx.save(),this.path([new v(r.bounds.left+u*.39363,r.bounds.top+u*.79),new v(r.bounds.left+u*.16,r.bounds.top+u*.5549),new v(r.bounds.left+u*.27347,r.bounds.top+u*.44071),new v(r.bounds.left+u*.39694,r.bounds.top+u*.5649),new v(r.bounds.left+u*.72983,r.bounds.top+u*.23),new v(r.bounds.left+u*.84,r.bounds.top+u*.34085),new v(r.bounds.left+u*.39363,r.bounds.top+u*.79)]),this.ctx.fillStyle=iA(vs),this.ctx.fill(),this.ctx.restore()):r.type===Rt&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+u/2,r.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=iA(vs),this.ctx.fill(),this.ctx.restore())),Ou(r)&&r.value.length){switch(f=this.createFontStyle(s),m=f[0],C=f[1],g=this.fontMetrics.getMetrics(m,C).baseline,this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Nu(r.styles.textAlign),I=Pt(r),w=0,r.styles.textAlign){case 1:w+=I.width/2;break;case 2:w+=I.width;break}x=I.add(w,0,0,-I.height/2+1),this.ctx.save(),this.path([new v(I.left,I.top),new v(I.left+I.width,I.top),new v(I.left+I.width,I.top+I.height),new v(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ze(r.value,x),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!sA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(F=r.styles.listStyleImage,F.type!==0)return[3,18];p=void 0,L=F.url,h.label=15;case 15:return h.trys.push([15,17,,18]),[4,this.context.cache.match(L)];case 16:return p=h.sent(),this.ctx.drawImage(p,r.bounds.left-(p.width+10),r.bounds.top),[3,18];case 17:return h.sent(),this.context.logger.error("Error loading list-style-image "+L),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(m=this.createFontStyle(s)[0],this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new PA(r.bounds.left,r.bounds.top+z(r.styles.paddingTop,r.bounds.width),r.bounds.width,os(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ze(t.listValue,I),s.letterSpacing,os(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),h.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return wA(this,void 0,void 0,function(){var r,n,F,s,i,F,o,a,F,B,l,F,u,f,F,C,g,F,w,x,F;return cA(this,function(p){switch(p.label){case 0:if(sA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:p.sent(),r=0,n=t.negativeZIndex,p.label=2;case 2:return r<n.length?(F=n[r],[4,this.renderStack(F)]):[3,5];case 3:p.sent(),p.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:p.sent(),s=0,i=t.nonInlineLevel,p.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:p.sent(),p.label=9;case 9:return s++,[3,7];case 10:o=0,a=t.nonPositionedFloats,p.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:p.sent(),p.label=13;case 13:return o++,[3,11];case 14:B=0,l=t.nonPositionedInlineLevel,p.label=15;case 15:return B<l.length?(F=l[B],[4,this.renderStack(F)]):[3,18];case 16:p.sent(),p.label=17;case 17:return B++,[3,15];case 18:u=0,f=t.inlineLevel,p.label=19;case 19:return u<f.length?(F=f[u],[4,this.renderNode(F)]):[3,22];case 20:p.sent(),p.label=21;case 21:return u++,[3,19];case 22:C=0,g=t.zeroOrAutoZIndexOrTransformedOrOpacity,p.label=23;case 23:return C<g.length?(F=g[C],[4,this.renderStack(F)]):[3,26];case 24:p.sent(),p.label=25;case 25:return C++,[3,23];case 26:w=0,x=t.positiveZIndex,p.label=27;case 27:return w<x.length?(F=x[w],[4,this.renderStack(F)]):[3,30];case 28:p.sent(),p.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){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(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(n,s){var i=vA(n)?n.start:n;s===0?r.ctx.moveTo(i.x,i.y):r.ctx.lineTo(i.x,i.y),vA(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,r,n,s){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},e.prototype.resizeImage=function(t,r,n){var s;if(t.width===r&&t.height===n)return t;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,n),o},e.prototype.renderBackgroundImage=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a;return cA(this,function(B){switch(B.label){case 0:r=t.styles.backgroundImage.length-1,n=function(l){var u,f,C,Y,k,P,_,O,M,g,Y,k,P,_,O,w,x,F,p,L,m,I,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA,FA;return cA(this,function(RA){switch(RA.label){case 0:if(l.type!==0)return[3,5];u=void 0,f=l.url,RA.label=1;case 1:return RA.trys.push([1,3,,4]),[4,s.context.cache.match(f)];case 2:return u=RA.sent(),[3,4];case 3:return RA.sent(),s.context.logger.error("Error loading background-image "+f),[3,4];case 4:return u&&(C=Rr(t,r,[u.width,u.height,u.width/u.height]),Y=C[0],k=C[1],P=C[2],_=C[3],O=C[4],M=s.ctx.createPattern(s.resizeImage(u,_,O),"repeat"),s.renderRepeat(Y,M,k,P)),[3,6];case 5:vB(l)?(g=Rr(t,r,[null,null,null]),Y=g[0],k=g[1],P=g[2],_=g[3],O=g[4],w=hB(l.angle,_,O),x=w[0],F=w[1],p=w[2],L=w[3],m=w[4],I=document.createElement("canvas"),I.width=_,I.height=O,h=I.getContext("2d"),y=h.createLinearGradient(F,L,p,m),ss(l.stops,x).forEach(function(ee){return y.addColorStop(ee.stop,iA(ee.color))}),h.fillStyle=y,h.fillRect(0,0,_,O),_>0&&O>0&&(M=s.ctx.createPattern(I,"repeat"),s.renderRepeat(Y,M,k,P))):EB(l)&&(S=Rr(t,r,[null,null,null]),Y=S[0],K=S[1],R=S[2],_=S[3],O=S[4],q=l.position.length===0?[cn]:l.position,k=z(q[0],_),P=z(q[q.length-1],O),uA=UB(l,k,P,_,O),$=uA[0],eA=uA[1],$>0&&eA>0&&(UA=s.ctx.createRadialGradient(K+k,R+P,0,K+k,R+P,$),ss(l.stops,$*2).forEach(function(ee){return UA.addColorStop(ee.stop,iA(ee.color))}),s.path(Y),s.ctx.fillStyle=UA,$!==eA?(MA=t.bounds.left+.5*t.bounds.width,QA=t.bounds.top+.5*t.bounds.height,yA=eA/$,FA=1/yA,s.ctx.save(),s.ctx.translate(MA,QA),s.ctx.transform(1,0,0,yA,0,0),s.ctx.translate(-MA,-QA),s.ctx.fillRect(K,FA*(R-QA)+QA,_,O*FA),s.ctx.restore()):s.ctx.fill())),RA.label=6;case 6:return r--,[2]}})},s=this,i=0,o=t.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:B.sent(),B.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,n){return wA(this,void 0,void 0,function(){return cA(this,function(s){return this.path(_s(n,r)),this.ctx.fillStyle=iA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,n,s){return wA(this,void 0,void 0,function(){var i,o;return cA(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Iu(s,n),this.path(i),this.ctx.fillStyle=iA(t),this.ctx.fill(),o=bu(s,n),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return wA(this,void 0,void 0,function(){var r,n,s,i,o,a,B,l,u=this;return cA(this,function(f){switch(f.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!$A(r.backgroundColor)||r.backgroundImage.length,s=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],i=Gu(me(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),$A(r.backgroundColor)||(this.ctx.fillStyle=iA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(C){u.ctx.save();var g=Nt(t.curves),w=C.inset?0:Mu,x=Hu(g,-w+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(u.path(g),u.ctx.clip(),u.mask(x)):(u.mask(g),u.ctx.clip(),u.path(x)),u.ctx.shadowOffsetX=C.offsetX.number+w,u.ctx.shadowOffsetY=C.offsetY.number,u.ctx.shadowColor=iA(C.color),u.ctx.shadowBlur=C.blur.number,u.ctx.fillStyle=C.inset?iA(C.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),f.label=2;case 2:o=0,a=0,B=s,f.label=3;case 3:return a<B.length?(l=B[a],l.style!==0&&!$A(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,o,t.curves,3)];case 6:return f.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,o,t.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,t.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,n,s,i){return wA(this,void 0,void 0,function(){var o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,h,I,h;return cA(this,function(y){return this.ctx.save(),o=xu(s,n),a=_s(s,n),i===2&&(this.path(a),this.ctx.clip()),vA(a[0])?(B=a[0].start.x,l=a[0].start.y):(B=a[0].x,l=a[0].y),vA(a[1])?(u=a[1].end.x,f=a[1].end.y):(u=a[1].x,f=a[1].y),n===0||n===2?C=Math.abs(B-u):C=Math.abs(l-f),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=r<3?r*3:r*2,w=r<3?r*2:r,i===3&&(g=r,w=r),x=!0,C<=g*2?x=!1:C<=g*2+w?(F=C/(2*g+w),g*=F,w*=F):(p=Math.floor((C+w)/(g+w)),L=(C-p*g)/(p-1),m=(C-(p+1)*g)/p,w=m<=0||Math.abs(w-L)<Math.abs(w-m)?L:m),x&&(i===3?this.ctx.setLineDash([0,g+w]):this.ctx.setLineDash([g,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=iA(t),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(vA(a[0])&&(I=a[3],h=a[0],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke()),vA(a[1])&&(I=a[1],h=a[2],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return wA(this,void 0,void 0,function(){var r;return cA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=yu(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Gi),Ou=function(A){return A instanceof mi||A instanceof pi?!0:A instanceof gn&&A.type!==Rt&&A.type!==Mt},Gu=function(A,e){switch(A){case 0:return Nt(e);case 2:return Fu(e);default:return Vt(e)}},Nu=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Vu=["-apple-system","system-ui"],Pu=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Vu.indexOf(e)===-1}):A},ku=(function(A){LA(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return e.prototype.render=function(t){return wA(this,void 0,void 0,function(){var r,n;return cA(this,function(s){switch(s.label){case 0:return r=en(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Xu(r)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Gi),Xu=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Wu=(function(){function A(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,ut([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,ut([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A})(),Ju=(function(){function A(e,t){var r;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new Wu({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new fu(this,e)}return A.instanceCount=1,A})(),Yu=function(A,e){return e===void 0&&(e={}),Zu(A,e)};typeof window<"u"&&Ki.setContext(window);var Zu=function(A,e){return wA(void 0,void 0,void 0,function(){var t,r,n,s,i,o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,y,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA;return cA(this,function(FA){switch(FA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=A.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(S=e.imageTimeout)!==null&&S!==void 0?S:15e3,proxy:e.proxy,useCORS:(Y=e.useCORS)!==null&&Y!==void 0?Y:!1},s=Gr({logging:(K=e.logging)!==null&&K!==void 0?K:!0,cache:e.cache},n),i={windowWidth:(R=e.windowWidth)!==null&&R!==void 0?R:r.innerWidth,windowHeight:(_=e.windowHeight)!==null&&_!==void 0?_:r.innerHeight,scrollX:(O=e.scrollX)!==null&&O!==void 0?O:r.pageXOffset,scrollY:(q=e.scrollY)!==null&&q!==void 0?q:r.pageYOffset},o=new PA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Ju(s,o),B=(k=e.foreignObjectRendering)!==null&&k!==void 0?k:!1,l={allowTaint:(P=e.allowTaint)!==null&&P!==void 0?P:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:B,copyStyles:B},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new Ss(a,A,l),f=u.clonedReferenceElement,f?[4,u.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=FA.sent(),g=wn(f)||ql(f)?Ho(f.ownerDocument):kt(a,f),w=g.width,x=g.height,F=g.left,p=g.top,L=qu(a,f,e.backgroundColor),m={canvas:e.canvas,backgroundColor:L,scale:($=(uA=e.scale)!==null&&uA!==void 0?uA:r.devicePixelRatio)!==null&&$!==void 0?$:1,x:((eA=e.x)!==null&&eA!==void 0?eA:0)+F,y:((UA=e.y)!==null&&UA!==void 0?UA:0)+p,width:(MA=e.width)!==null&&MA!==void 0?MA:Math.ceil(w),height:(QA=e.height)!==null&&QA!==void 0?QA:Math.ceil(x)},B?(a.logger.debug("Document cloned, using foreign object rendering"),y=new ku(a,m),[4,y.render(f)]):[3,3];case 2:return I=FA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+p+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),h=Hi(a,f),L===h.styles.backgroundColor&&(h.styles.backgroundColor=VA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+m.x+","+m.y+" with size "+m.width+"x"+m.height),y=new Ru(a,m),[4,y.render(h)];case 4:I=FA.sent(),FA.label=5;case 5:return(!((yA=e.removeContainer)!==null&&yA!==void 0)||yA)&&(Ss.destroy(C)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,I]}})})},qu=function(A,e,t){var r=e.ownerDocument,n=r.documentElement?Je(A,getComputedStyle(r.documentElement).backgroundColor):VA.TRANSPARENT,s=r.body?Je(A,getComputedStyle(r.body).backgroundColor):VA.TRANSPARENT,i=typeof t=="string"?Je(A,t):t===null?VA.TRANSPARENT:4294967295;return e===r.documentElement?$A(n)?$A(s)?i:s:n:i},Ni=Yu;var Vi=!1,ju=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]);function zu(){if(Vi)return;Vi=!0;let A=CanvasRenderingContext2D.prototype.createPattern;CanvasRenderingContext2D.prototype.createPattern=function(e,t){return e&&"width"in e&&"height"in e&&(e.width===0||e.height===0)?null:A.call(this,e,t)}}function ki(){zu()}function $u(A,e){if(!A.id)return;let t=e.getElementById(A.id);t instanceof HTMLElement&&(t.style.opacity="1",t.style.setProperty("visibility","visible","important"),t.querySelectorAll("[data-start]").forEach(r=>{r.style.setProperty("visibility","visible","important")}))}function Af(A){let e=A.ownerDocument.defaultView;e&&[A,...Array.from(A.querySelectorAll("*"))].forEach(t=>{if(ju.has(t.tagName))return;let r=e.getComputedStyle(t);if(r.boxShadow==="none"||r.transform==="none")return;let n=A.ownerDocument.createElement("div");n.setAttribute("data-hyper-shader-shadow-shim",""),n.style.cssText=["position:absolute","inset:0","border-radius:inherit",`box-shadow:${r.boxShadow}`,"background:transparent","pointer-events:none","z-index:0"].join(";"),r.position==="static"&&(t.style.position="relative"),t.style.boxShadow="none",t.insertBefore(n,t.firstChild)})}function tt(){if(typeof document>"u")return!1;let A=document.createElement("canvas");if(A.setAttribute("layoutsubtree",""),!("layoutSubtree"in A))return!1;let e=A.getContext("2d");return e!=null&&typeof e.drawElementImage=="function"}async function ef(A,e,t,r){let n=document.createElement("canvas");n.width=t,n.height=r,n.setAttribute("layoutsubtree",""),n.style.cssText=`position:fixed;top:0;left:0;width:${t}px;height:${r}px;z-index:-9999;pointer-events:none;opacity:0`,n.appendChild(A.cloneNode(!0)),document.body.appendChild(n);try{await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(()=>a())));let s=n.getContext("2d");s.fillStyle=e,s.fillRect(0,0,t,r);let i=n.firstElementChild;i&&s.drawElementImage(i,0,0,t,r);let o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(n,0,0),n.remove(),o}catch(s){throw n.remove(),s}}function Xi(A,e,t=fe,r=ge,n={}){return tt()&&!n.preferBrowserPaint?ef(A,e,t,r).catch(()=>Pi(A,e,t,r,n)):Pi(A,e,t,r,n)}function Pi(A,e,t,r,n={}){let s=i=>Ni(A,{width:t,height:r,scale:n.scale??1,backgroundColor:e,logging:!1,foreignObjectRendering:i,useCORS:!0,allowTaint:!0,onclone:o=>{if(!A.id)return;let a=o.getElementById(A.id);a instanceof HTMLElement&&Af(a),n.forceVisible&&$u(A,o)},ignoreElements:o=>o.tagName==="CANVAS"||o.hasAttribute("data-no-capture")});return n.preferBrowserPaint===!0?s(!0).catch(()=>s(!1)):s(!1)}var Ar="__hf-page-side-compositor",Qn="__hf_page_compositor_v1__";function Wi(A){return{left:`${A.left}px`,top:`${A.top}px`,width:`${A.width}px`,height:`${A.height}px`}}function Cn(){if(typeof window>"u"||typeof document>"u"||!tt())return!1;let A=document.createElement("canvas"),e=A.getContext("webgl")||A.getContext("experimental-webgl");return e?(e.getExtension("WEBGL_lose_context")?.loseContext(),!0):!1}function er(A){if(typeof window>"u")return!1;if(window.__HF_PAGE_COMPOSITOR_CANARY__=Qn,!Cn())return console.warn("[HyperShader] page-side compositing requested but drawElementImage/WebGL is not available; falling back to opacity-flip mode (Node-side layered pipeline will handle the blend)."),!1;if(document.getElementById(Ar))return!0;let{scenes:e,transitions:t,accentColors:r,width:n,height:s,defaultDuration:i}=A,o=document.createElement("canvas");o.id=Ar,o.width=n,o.height=s,o.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483646;pointer-events:none;display:none;",document.body.appendChild(o);let a=ot(o,n,s);if(!a)return console.warn("[HyperShader] page-side compositor: WebGL context unavailable."),o.remove(),!1;let B=at(a),l=new Map;for(let K of t)if(K.shader!==void 0&&!l.has(K.shader))try{l.set(K.shader,Bt(a,lt(K.shader)))}catch(R){console.warn(`[HyperShader] page-side compositor: failed to compile "${K.shader}":`,R)}let u=[];for(let K=0;K<t.length;K++){let R=t[K];if(!R||R.shader===void 0)continue;let _=e[K],O=e[K+1],q=l.get(R.shader);!_||!O||!q||u.push({time:R.time,duration:R.duration??i,shader:R.shader,fromSceneId:_,toSceneId:O,prog:q})}if(u.length===0)return o.remove(),!1;let f=ne(a),C=ne(a),g=document.createElement("canvas"),w=document.createElement("canvas");for(let K of[g,w])K.width=n,K.height=s,K.setAttribute("layoutsubtree",""),K.style.cssText="position:fixed;top:0;left:0;width:"+n+"px;height:"+s+"px;z-index:-9998;pointer-events:none;",document.body.appendChild(K);function x(K){for(let R of u)if(K>=R.time&&K<=R.time+R.duration)return R;return null}function F(K){let R=0;for(let _ of t)K>=_.time+(_.duration??i)&&(R+=1);return e[Math.min(R,e.length-1)]}let p=null,L=0,m=window;async function I(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=document.getElementById(K.fromSceneId),_=document.getElementById(K.toSceneId);if(!(R instanceof HTMLElement)||!(_ instanceof HTMLElement))return m.__hf_page_composite_pending=!1,!1;let O=Wi(R.getBoundingClientRect()),q=Wi(_.getBoundingClientRect());for(;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=R.cloneNode(!0),P=_.cloneNode(!0);g.appendChild(k),w.appendChild(P);for(let[$,eA]of[[k,O],[P,q]])$.style.opacity="1",$.style.visibility="visible",$.style.position="absolute",$.style.left=eA.left,$.style.top=eA.top,$.style.width=eA.width,$.style.height=eA.height,$.querySelectorAll("[data-start]").forEach(UA=>{UA.style.opacity="1",UA.style.visibility="visible"});let uA=[];for(let $ of[g,w])for(let eA of $.querySelectorAll("img"))eA.src&&eA.src.startsWith("data:")&&typeof eA.decode=="function"&&uA.push(eA.decode().catch(()=>{}));return uA.length>0&&await Promise.all(uA),!0}function h(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=g.firstElementChild,_=w.firstElementChild;if(!R||!_)return m.__hf_page_composite_pending=!1,!1;let O=g.getContext("2d"),q=w.getContext("2d");if(!O?.drawElementImage||!q?.drawElementImage)return m.__hf_page_composite_pending=!1,!1;try{O.fillStyle=A.bgColor,O.fillRect(0,0,n,s),O.drawElementImage(R,0,0,n,s),q.fillStyle=A.bgColor,q.fillRect(0,0,n,s),q.drawElementImage(_,0,0,n,s)}catch(k){return console.warn("[HyperShader] page-side compositor: drawElementImage failed:",k),m.__hf_page_composite_pending=!1,!1}we(a,f,g),we(a,C,w);try{ct(a,B,K.prog,f,C,L,r,n,s),o.style.display="block"}catch(k){console.warn("[HyperShader] page-side compositor: renderShader failed:",k),o.style.display="none"}return m.__hf_page_composite_pending=!1,!0}m.__hf_page_composite_resolve=h,m.__hf_page_composite_prepare=I;let y=window,M=()=>{if(!y.__hf)return;let K=y.__hf.seek;if(typeof K!="function")return;let R=_=>{let O=K.call(y.__hf,_),q=x(_);if(!q){for(o.style.display="none",m.__hf_page_composite_pending=!1;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=F(_),P=k?document.getElementById(k):null;return P instanceof HTMLElement&&P.style.visibility==="hidden"&&(P.style.visibility="visible"),O}return p=q,L=q.duration===0?1:Math.min(1,Math.max(0,(_-q.time)/q.duration)),m.__hf_page_composite_pending=!0,O};y.__hf.seek=R},S=0,Y=window.setInterval(()=>{S+=1,y.__hf?.seek?(M(),window.clearInterval(Y)):S>200&&(window.clearInterval(Y),console.warn("[HyperShader] page-side compositor: window.__hf.seek never appeared after 10s; the engine bridge did not initialize. Falling back to opacity-flip mode."))},50);return!0}var nr=.7,hn="power2.inOut",tf="attribute vec2 a_pos; varying vec2 v_uv; void main(){v_uv=a_pos*0.5+0.5; gl_Position=vec4(a_pos,0,1);}",tr=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"],rf="hyper-shader-preview-cache",_A="frames",nf=1,sf="v1",Ji=2,Yi=1.25,of=1200;function af(A){let e=A.replace("#","");if(e.length<6)return[.5,.5,.5];let t=parseInt(e.slice(0,2),16)/255,r=parseInt(e.slice(2,4),16)/255,n=parseInt(e.slice(4,6),16)/255;return Number.isNaN(t)||Number.isNaN(r)||Number.isNaN(n)?[.5,.5,.5]:[t,r,n]}function to(A){let[e,t,r]=af(A);return{accent:[e,t,r],dark:[e*.35,t*.35,r*.35],bright:[Math.min(1,e*1.5+.2),Math.min(1,t*1.5+.2),Math.min(1,r*1.5+.2)]}}function ce(A,e,t){return Math.min(t,Math.max(e,A))}function Bf(A,e){return A===void 0?e:Number.isFinite(A)&&A>0?A:e}var cf="__hf_shader_capture_scale",lf="__hf_shader_loading";function ro(A,e){let t=window[A];if(typeof t=="string")return t;if(typeof t=="number"&&Number.isFinite(t))return String(t);try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function uf(){let A=ro("__HF_SHADER_CAPTURE_SCALE",cf),e=A===null?NaN:Number(A);return ce(Number.isFinite(e)&&e>0?e:1,.25,1)}function ff(){let A=ro("__HF_SHADER_LOADING",lf)?.trim().toLowerCase();return A==="player"||A==="true"||A==="1"?"player":A==="none"||A==="false"||A==="0"||A==="off"?"none":"internal"}function ir(A){let e=2166136261;for(let t=0;t<A.length;t+=1)e^=A.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function gf(A){let e=Array.from(A.querySelectorAll("style")).map(r=>r.textContent||"").join(`
|
|
7
7
|
`),t=Array.from(A.querySelectorAll('link[rel~="stylesheet"]')).map(r=>`${r.href}:${r.getAttribute("integrity")||""}`).join(`
|
|
8
8
|
`);return ir(`${e}
|
|
9
9
|
${t}`)}function wf(A){return A.includes("gsap.timeline")||A.includes("__timelines")||A.includes(".to(")||A.includes(".set(")?!A.includes("HyperShader")&&!A.includes("hyper-shader")&&!A.includes("hyperShader"):!1}function Qf(A){let e=Array.from(A.querySelectorAll('meta[name="hyperframes-project-signature"]')).map(r=>r.getAttribute("content")||"").join(`
|