@prefecthq/graphs 3.0.0 → 3.0.1

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.
@@ -1,4 +1,4 @@
1
- (function(rt,Pe){typeof exports=="object"&&typeof module<"u"?Pe(exports):typeof define=="function"&&define.amd?define(["exports"],Pe):(rt=typeof globalThis<"u"?globalThis:rt||self,Pe(rt["prefect-graphs"]={}))})(this,function(rt){"use strict";var oP=Object.defineProperty;var aP=(rt,Pe,Yr)=>Pe in rt?oP(rt,Pe,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):rt[Pe]=Yr;var kf=(rt,Pe,Yr)=>aP(rt,typeof Pe!="symbol"?Pe+"":Pe,Yr);const Pe=["result","markdown","table","progress","image","unknown"],Yr={markdown:"ArtifactMarkdown",table:"ArtifactTable",result:"ArtifactResult",image:"ArtifactImage",progress:"ArtifactProgress",unknown:"Artifact"},Tl=["flow-run","task-run"];function Gb(r){return Tl.includes(r)}function ua(r){return Tl.includes(r.kind)}function Vf(r){return r.kind==="artifact"}function Hf(r){return r.kind==="artifacts"}function Kf(r){return r.kind==="state"}function Yf(r){return r.kind==="event"}function zf(r){return r.kind==="events"}const Fb=["COMPLETED","RUNNING","SCHEDULED","PENDING","FAILED","CANCELLED","CANCELLING","CRASHED","PAUSED"];function Nb(r){return["waterfall","nearest-parent","duration-sorted"].includes(r)}function kb(r){return["temporal","dependency","left-aligned"].includes(r)}const Sl="nodes-container",jf="node-container",Jf="edge-container",$f=1,Cl=20,Qf=200,qf=.2,tp=.2,ep=.2,ip=.1,El=10,Il=4,Al=20,Ml=64,Db=.25,Ob=1,Rl=30,rp=260,Pl=250,sp=1,np=2,op=3,ap=4,Ll=0,Gl=2,hp=1,lp=2,cp=3,Fl=4,Kn=5;var zr=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(zr||{}),up=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(up||{}),Nl=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(Nl||{}),dt=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(dt||{}),xi=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(xi||{}),V=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(V||{}),Xs=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Xs||{}),ht=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(ht||{}),et=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(et||{}),Ki=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(Ki||{}),_i=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(_i||{}),vi=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(vi||{}),we=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(we||{}),wi=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(wi||{}),kl=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(kl||{}),Ze=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(Ze||{}),te=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(te||{}),zt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(zt||{}),Ti=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Ti||{});const it={ADAPTER:{createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Dl=/iPhone/i,dp=/iPod/i,fp=/iPad/i,pp=/\biOS-universal(?:.+)Mac\b/i,Ol=/\bAndroid(?:.+)Mobile\b/i,mp=/Android/i,Ws=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,da=/Silk/i,Yi=/Windows Phone/i,gp=/\bWindows(?:.+)ARM\b/i,yp=/BlackBerry/i,bp=/BB10/i,xp=/Opera Mini/i,_p=/\b(CriOS|Chrome)(?:.+)Mobile/i,vp=/Mobile(?:.+)Firefox\b/i,wp=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Bb(r){return function(t){return t.test(r)}}function Tp(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var s=Bb(e),n={apple:{phone:s(Dl)&&!s(Yi),ipod:s(dp),tablet:!s(Dl)&&(s(fp)||wp(t))&&!s(Yi),universal:s(pp),device:(s(Dl)||s(dp)||s(fp)||s(pp)||wp(t))&&!s(Yi)},amazon:{phone:s(Ws),tablet:!s(Ws)&&s(da),device:s(Ws)||s(da)},android:{phone:!s(Yi)&&s(Ws)||!s(Yi)&&s(Ol),tablet:!s(Yi)&&!s(Ws)&&!s(Ol)&&(s(da)||s(mp)),device:!s(Yi)&&(s(Ws)||s(da)||s(Ol)||s(mp))||s(/\bokhttp\b/i)},windows:{phone:s(Yi),tablet:s(gp),device:s(Yi)||s(gp)},other:{blackberry:s(yp),blackberry10:s(bp),opera:s(xp),firefox:s(vp),chrome:s(_p),device:s(yp)||s(bp)||s(xp)||s(vp)||s(_p)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const Ub=Tp.default??Tp,zi=Ub(globalThis.navigator);it.RETINA_PREFIX=/@([0-9\.]+)x/,it.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Xb(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),e}var Sp={exports:{}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function s(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new s(c,u||h,d),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d<f;d++)p[d]=u[d].fn;return p},a.prototype.listenerCount=function(l){var c=e?e+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,d,f,p){var m=e?e+l:l;if(!this._events[m])return!1;var g=this._events[m],b=arguments.length,_,x;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),b){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,u),!0;case 4:return g.fn.call(g.context,c,u,d),!0;case 5:return g.fn.call(g.context,c,u,d,f),!0;case 6:return g.fn.call(g.context,c,u,d,f,p),!0}for(x=1,_=new Array(b-1);x<b;x++)_[x-1]=arguments[x];g.fn.apply(g.context,_)}else{var v=g.length,T;for(x=0;x<v;x++)switch(g[x].once&&this.removeListener(l,g[x].fn,void 0,!0),b){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,c);break;case 3:g[x].fn.call(g[x].context,c,u);break;case 4:g[x].fn.call(g[x].context,c,u,d);break;default:if(!_)for(T=1,_=new Array(b-1);T<b;T++)_[T-1]=arguments[T];g[x].fn.apply(g[x].context,_)}}return!0},a.prototype.on=function(l,c,u){return n(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return n(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,d){var f=e?e+l:l;if(!this._events[f])return this;if(!c)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!d||p.once)&&(!u||p.context===u)&&o(this,f);else{for(var m=0,g=[],b=p.length;m<b;m++)(p[m].fn!==c||d&&!p[m].once||u&&p[m].context!==u)&&g.push(p[m]);g.length?this._events[f]=g.length===1?g[0]:g:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=e?e+l:l,this._events[c]&&o(this,c)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,r.exports=a})(Sp);var Wb=Sp.exports;const Yn=Zs(Wb);var Bl={exports:{}};Bl.exports=fa,Bl.exports.default=fa;function fa(r,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:r.length,n=Cp(r,0,s,e,!0),o=[];if(!n||n.next===n.prev)return o;var a,h,l,c,u,d,f;if(i&&(n=Yb(r,t,n,e)),r.length>80*e){a=l=r[0],h=c=r[1];for(var p=e;p<s;p+=e)u=r[p],d=r[p+1],u<a&&(a=u),d<h&&(h=d),u>l&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return zn(n,o,e,a,h,f,0),o}function Cp(r,t,e,i,s){var n,o;if(s===Wl(r,t,e,i)>0)for(n=t;n<e;n+=i)o=Ap(n,r[n],r[n+1],o);else for(n=e-i;n>=t;n-=i)o=Ap(n,r[n],r[n+1],o);return o&&pa(o,o.next)&&(Jn(o),o=o.next),o}function jr(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(pa(e,e.next)||Ot(e.prev,e,e.next)===0)){if(Jn(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function zn(r,t,e,i,s,n,o){if(r){!o&&n&&Qb(r,i,s,n);for(var a=r,h,l;r.prev!==r.next;){if(h=r.prev,l=r.next,n?Vb(r,i,s,n):Zb(r)){t.push(h.i/e|0),t.push(r.i/e|0),t.push(l.i/e|0),Jn(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=Hb(jr(r),t,e),zn(r,t,e,i,s,n,2)):o===2&&Kb(r,t,e,i,s,n):zn(jr(r),t,e,i,s,n,1);break}}}}function Zb(r){var t=r.prev,e=r,i=r.next;if(Ot(t,e,i)>=0)return!1;for(var s=t.x,n=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=s<n?s<o?s:o:n<o?n:o,u=a<h?a<l?a:l:h<l?h:l,d=s>n?s>o?s:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&Vs(s,a,n,h,o,l,p.x,p.y)&&Ot(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Vb(r,t,e,i){var s=r.prev,n=r,o=r.next;if(Ot(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,c=s.y,u=n.y,d=o.y,f=a<h?a<l?a:l:h<l?h:l,p=c<u?c<d?c:d:u<d?u:d,m=a>h?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,b=Ul(f,p,t,e,i),_=Ul(m,g,t,e,i),x=r.prevZ,v=r.nextZ;x&&x.z>=b&&v&&v.z<=_;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Vs(a,c,h,u,l,d,x.x,x.y)&&Ot(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Vs(a,c,h,u,l,d,v.x,v.y)&&Ot(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=b;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Vs(a,c,h,u,l,d,x.x,x.y)&&Ot(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Vs(a,c,h,u,l,d,v.x,v.y)&&Ot(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Hb(r,t,e){var i=r;do{var s=i.prev,n=i.next.next;!pa(s,n)&&Ep(s,i,i.next,n)&&jn(s,n)&&jn(n,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),Jn(i),Jn(i.next),i=r=n),i=i.next}while(i!==r);return jr(i)}function Kb(r,t,e,i,s,n){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ex(o,a)){var h=Ip(o,a);o=jr(o,o.next),h=jr(h,h.next),zn(o,t,e,i,s,n,0),zn(h,t,e,i,s,n,0);return}a=a.next}o=o.next}while(o!==r)}function Yb(r,t,e,i){var s=[],n,o,a,h,l;for(n=0,o=t.length;n<o;n++)a=t[n]*i,h=n<o-1?t[n+1]*i:r.length,l=Cp(r,a,h,i,!1),l===l.next&&(l.steiner=!0),s.push(tx(l));for(s.sort(zb),n=0;n<s.length;n++)e=jb(s[n],e);return e}function zb(r,t){return r.x-t.x}function jb(r,t){var e=Jb(r,t);if(!e)return t;var i=Ip(e,r);return jr(i,i.next),jr(e,e.next)}function Jb(r,t){var e=t,i=r.x,s=r.y,n=-1/0,o;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var a=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=i&&a>n&&(n=a,o=e.x<e.next.x?e:e.next,a===i))return o}e=e.next}while(e!==t);if(!o)return null;var h=o,l=o.x,c=o.y,u=1/0,d;e=o;do i>=e.x&&e.x>=l&&i!==e.x&&Vs(s<c?i:n,s,l,c,s<c?n:i,s,e.x,e.y)&&(d=Math.abs(s-e.y)/(i-e.x),jn(e,r)&&(d<u||d===u&&(e.x>o.x||e.x===o.x&&$b(o,e)))&&(o=e,u=d)),e=e.next;while(e!==h);return o}function $b(r,t){return Ot(r.prev,r,t.prev)<0&&Ot(t.next,r,r.next)<0}function Qb(r,t,e,i){var s=r;do s.z===0&&(s.z=Ul(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,qb(s)}function qb(r){var t,e,i,s,n,o,a,h,l=1;do{for(e=r,r=null,n=null,o=0;e;){for(o++,i=e,a=0,t=0;t<l&&(a++,i=i.nextZ,!!i);t++);for(h=l;a>0||h>0&&i;)a!==0&&(h===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,a--):(s=i,i=i.nextZ,h--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;e=i}n.nextZ=null,l*=2}while(o>1);return r}function Ul(r,t,e,i,s){return r=(r-e)*s|0,t=(t-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function tx(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Vs(r,t,e,i,s,n,o,a){return(s-o)*(t-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(s-o)*(i-a)}function ex(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!ix(r,t)&&(jn(r,t)&&jn(t,r)&&rx(r,t)&&(Ot(r.prev,r,t.prev)||Ot(r,t.prev,t))||pa(r,t)&&Ot(r.prev,r,r.next)>0&&Ot(t.prev,t,t.next)>0)}function Ot(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function pa(r,t){return r.x===t.x&&r.y===t.y}function Ep(r,t,e,i){var s=ga(Ot(r,t,e)),n=ga(Ot(r,t,i)),o=ga(Ot(e,i,r)),a=ga(Ot(e,i,t));return!!(s!==n&&o!==a||s===0&&ma(r,e,t)||n===0&&ma(r,i,t)||o===0&&ma(e,r,i)||a===0&&ma(e,t,i))}function ma(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ga(r){return r>0?1:r<0?-1:0}function ix(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ep(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function jn(r,t){return Ot(r.prev,r,r.next)<0?Ot(r,t,r.next)>=0&&Ot(r,r.prev,t)>=0:Ot(r,t,r.prev)<0||Ot(r,r.next,t)<0}function rx(r,t){var e=r,i=!1,s=(r.x+t.x)/2,n=(r.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&s<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function Ip(r,t){var e=new Xl(r.i,r.x,r.y),i=new Xl(t.i,t.x,t.y),s=r.next,n=t.prev;return r.next=t,t.prev=r,e.next=s,s.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Ap(r,t,e,i){var s=new Xl(r,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Jn(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Xl(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}fa.deviation=function(r,t,e,i){var s=t&&t.length,n=s?t[0]*e:r.length,o=Math.abs(Wl(r,0,n,e));if(s)for(var a=0,h=t.length;a<h;a++){var l=t[a]*e,c=a<h-1?t[a+1]*e:r.length;o-=Math.abs(Wl(r,l,c,e))}var u=0;for(a=0;a<i.length;a+=3){var d=i[a]*e,f=i[a+1]*e,p=i[a+2]*e;u+=Math.abs((r[d]-r[p])*(r[f+1]-r[d+1])-(r[d]-r[f])*(r[p+1]-r[d+1]))}return o===0&&u===0?0:Math.abs((u-o)/o)};function Wl(r,t,e,i){for(var s=0,n=t,o=e-i;n<e;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}fa.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<r.length;s++){for(var n=0;n<r[s].length;n++)for(var o=0;o<t;o++)e.vertices.push(r[s][n][o]);s>0&&(i+=r[s-1].length,e.holes.push(i))}return e};var sx=Bl.exports;const nx=Zs(sx);var ya={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ya.exports,function(r,t){(function(e){var i=t&&!t.nodeType&&t,s=r&&!r.nodeType&&r,n=typeof be=="object"&&be;(n.global===n||n.window===n||n.self===n)&&(e=n);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=h-l,T=Math.floor,C=String.fromCharCode,E;function I(W){throw new RangeError(x[W])}function R(W,L){for(var O=W.length,U=[];O--;)U[O]=L(W[O]);return U}function N(W,L){var O=W.split("@"),U="";O.length>1&&(U=O[0]+"@",W=O[1]),W=W.replace(_,".");var tt=W.split("."),Q=R(tt,L).join(".");return U+Q}function F(W){for(var L=[],O=0,U=W.length,tt,Q;O<U;)tt=W.charCodeAt(O++),tt>=55296&&tt<=56319&&O<U?(Q=W.charCodeAt(O++),(Q&64512)==56320?L.push(((tt&1023)<<10)+(Q&1023)+65536):(L.push(tt),O--)):L.push(tt);return L}function P(W){return R(W,function(L){var O="";return L>65535&&(L-=65536,O+=C(L>>>10&1023|55296),L=56320|L&1023),O+=C(L),O}).join("")}function A(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:h}function G(W,L){return W+22+75*(W<26)-((L!=0)<<5)}function D(W,L,O){var U=0;for(W=O?T(W/d):W>>1,W+=T(W/L);W>v*c>>1;U+=h)W=T(W/v);return T(U+(v+1)*W/(W+u))}function X(W){var L=[],O=W.length,U,tt=0,Q=p,xt=f,Ct,q,Z,Y,z,k,ut,gt,At;for(Ct=W.lastIndexOf(m),Ct<0&&(Ct=0),q=0;q<Ct;++q)W.charCodeAt(q)>=128&&I("not-basic"),L.push(W.charCodeAt(q));for(Z=Ct>0?Ct+1:0;Z<O;){for(Y=tt,z=1,k=h;Z>=O&&I("invalid-input"),ut=A(W.charCodeAt(Z++)),(ut>=h||ut>T((a-tt)/z))&&I("overflow"),tt+=ut*z,gt=k<=xt?l:k>=xt+c?c:k-xt,!(ut<gt);k+=h)At=h-gt,z>T(a/At)&&I("overflow"),z*=At;U=L.length+1,xt=D(tt-Y,U,Y==0),T(tt/U)>a-Q&&I("overflow"),Q+=T(tt/U),tt%=U,L.splice(tt++,0,Q)}return P(L)}function B(W){var L,O,U,tt,Q,xt,Ct,q,Z,Y,z,k=[],ut,gt,At,Ft;for(W=F(W),ut=W.length,L=p,O=0,Q=f,xt=0;xt<ut;++xt)z=W[xt],z<128&&k.push(C(z));for(U=tt=k.length,tt&&k.push(m);U<ut;){for(Ct=a,xt=0;xt<ut;++xt)z=W[xt],z>=L&&z<Ct&&(Ct=z);for(gt=U+1,Ct-L>T((a-O)/gt)&&I("overflow"),O+=(Ct-L)*gt,L=Ct,xt=0;xt<ut;++xt)if(z=W[xt],z<L&&++O>a&&I("overflow"),z==L){for(q=O,Z=h;Y=Z<=Q?l:Z>=Q+c?c:Z-Q,!(q<Y);Z+=h)Ft=q-Y,At=h-Y,k.push(C(G(Y+Ft%At,0))),q=T(Ft/At);k.push(C(G(q,0))),Q=D(O,gt,U==tt),O=0,++U}++O,++L}return k.join("")}function H(W){return N(W,function(L){return g.test(L)?X(L.slice(4).toLowerCase()):L})}function lt(W){return N(W,function(L){return b.test(L)?"xn--"+B(L):L})}if(o={version:"1.4.1",ucs2:{decode:F,encode:P},decode:X,encode:B,toASCII:lt,toUnicode:H},i&&s)if(r.exports==i)s.exports=o;else for(E in o)o.hasOwnProperty(E)&&(i[E]=o[E]);else e.punycode=o})(be)}(ya,ya.exports);var ox=ya.exports,ax=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,e);if(o.value!==s||o.enumerable!==!0)return!1}return!0},Mp=typeof Symbol<"u"&&Symbol,hx=ax,lx=function(){return typeof Mp!="function"||typeof Symbol!="function"||typeof Mp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hx()},Rp={foo:{}},cx=Object,ux=function(){return{__proto__:Rp}.foo===Rp.foo&&!({__proto__:null}instanceof cx)},dx="Function.prototype.bind called on incompatible ",Zl=Array.prototype.slice,fx=Object.prototype.toString,px="[object Function]",mx=function(t){var e=this;if(typeof e!="function"||fx.call(e)!==px)throw new TypeError(dx+e);for(var i=Zl.call(arguments,1),s,n=function(){if(this instanceof s){var c=e.apply(this,i.concat(Zl.call(arguments)));return Object(c)===c?c:this}else return e.apply(t,i.concat(Zl.call(arguments)))},o=Math.max(0,e.length-i.length),a=[],h=0;h<o;h++)a.push("$"+h);if(s=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var l=function(){};l.prototype=e.prototype,s.prototype=new l,l.prototype=null}return s},gx=mx,Vl=Function.prototype.bind||gx,yx=Vl,bx=yx.call(Function.call,Object.prototype.hasOwnProperty),wt,Hs=SyntaxError,Pp=Function,Ks=TypeError,Hl=function(r){try{return Pp('"use strict"; return ('+r+").constructor;")()}catch{}},Jr=Object.getOwnPropertyDescriptor;if(Jr)try{Jr({},"")}catch{Jr=null}var Kl=function(){throw new Ks},xx=Jr?function(){try{return arguments.callee,Kl}catch{try{return Jr(arguments,"callee").get}catch{return Kl}}}():Kl,Ys=lx(),_x=ux(),se=Object.getPrototypeOf||(_x?function(r){return r.__proto__}:null),zs={},vx=typeof Uint8Array>"u"||!se?wt:se(Uint8Array),$r={"%AggregateError%":typeof AggregateError>"u"?wt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?wt:ArrayBuffer,"%ArrayIteratorPrototype%":Ys&&se?se([][Symbol.iterator]()):wt,"%AsyncFromSyncIteratorPrototype%":wt,"%AsyncFunction%":zs,"%AsyncGenerator%":zs,"%AsyncGeneratorFunction%":zs,"%AsyncIteratorPrototype%":zs,"%Atomics%":typeof Atomics>"u"?wt:Atomics,"%BigInt%":typeof BigInt>"u"?wt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?wt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?wt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?wt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?wt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?wt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?wt:FinalizationRegistry,"%Function%":Pp,"%GeneratorFunction%":zs,"%Int8Array%":typeof Int8Array>"u"?wt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?wt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?wt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ys&&se?se(se([][Symbol.iterator]())):wt,"%JSON%":typeof JSON=="object"?JSON:wt,"%Map%":typeof Map>"u"?wt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ys||!se?wt:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?wt:Promise,"%Proxy%":typeof Proxy>"u"?wt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?wt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?wt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ys||!se?wt:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?wt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ys&&se?se(""[Symbol.iterator]()):wt,"%Symbol%":Ys?Symbol:wt,"%SyntaxError%":Hs,"%ThrowTypeError%":xx,"%TypedArray%":vx,"%TypeError%":Ks,"%Uint8Array%":typeof Uint8Array>"u"?wt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?wt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?wt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?wt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?wt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?wt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?wt:WeakSet};if(se)try{null.error}catch(r){var wx=se(se(r));$r["%Error.prototype%"]=wx}var Tx=function r(t){var e;if(t==="%AsyncFunction%")e=Hl("async function () {}");else if(t==="%GeneratorFunction%")e=Hl("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Hl("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=r("%AsyncGenerator%");s&&se&&(e=se(s.prototype))}return $r[t]=e,e},Lp={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$n=Vl,ba=bx,Sx=$n.call(Function.call,Array.prototype.concat),Cx=$n.call(Function.apply,Array.prototype.splice),Gp=$n.call(Function.call,String.prototype.replace),xa=$n.call(Function.call,String.prototype.slice),Ex=$n.call(Function.call,RegExp.prototype.exec),Ix=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ax=/\\(\\)?/g,Mx=function(t){var e=xa(t,0,1),i=xa(t,-1);if(e==="%"&&i!=="%")throw new Hs("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Hs("invalid intrinsic syntax, expected opening `%`");var s=[];return Gp(t,Ix,function(n,o,a,h){s[s.length]=a?Gp(h,Ax,"$1"):o||n}),s},Rx=function(t,e){var i=t,s;if(ba(Lp,i)&&(s=Lp[i],i="%"+s[0]+"%"),ba($r,i)){var n=$r[i];if(n===zs&&(n=Tx(i)),typeof n>"u"&&!e)throw new Ks("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:n}}throw new Hs("intrinsic "+t+" does not exist!")},Yl=function(t,e){if(typeof t!="string"||t.length===0)throw new Ks("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ks('"allowMissing" argument must be a boolean');if(Ex(/^%?[^%]*%?$/,t)===null)throw new Hs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Mx(t),s=i.length>0?i[0]:"",n=Rx("%"+s+"%",e),o=n.name,a=n.value,h=!1,l=n.alias;l&&(s=l[0],Cx(i,Sx([0,1],l)));for(var c=1,u=!0;c<i.length;c+=1){var d=i[c],f=xa(d,0,1),p=xa(d,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new Hs("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(h=!0),s+="."+d,o="%"+s+"%",ba($r,o))a=$r[o];else if(a!=null){if(!(d in a)){if(!e)throw new Ks("base intrinsic for "+t+" exists, but the property is not available.");return}if(Jr&&c+1>=i.length){var m=Jr(a,d);u=!!m,u&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[d]}else u=ba(a,d),a=a[d];u&&!h&&($r[o]=a)}}return a},Fp={exports:{}};(function(r){var t=Vl,e=Yl,i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),n=e("%Reflect.apply%",!0)||t.call(s,i),o=e("%Object.getOwnPropertyDescriptor%",!0),a=e("%Object.defineProperty%",!0),h=e("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}r.exports=function(u){var d=n(t,s,arguments);if(o&&a){var f=o(d,"length");f.configurable&&a(d,"length",{value:1+h(0,u.length-(arguments.length-1))})}return d};var l=function(){return n(t,i,arguments)};a?a(r.exports,"apply",{value:l}):r.exports.apply=l})(Fp);var Px=Fp.exports,Np=Yl,kp=Px,Lx=kp(Np("String.prototype.indexOf")),Gx=function(t,e){var i=Np(t,!!e);return typeof i=="function"&&Lx(t,".prototype.")>-1?kp(i):i};const Fx=Xb(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zl=typeof Map=="function"&&Map.prototype,jl=Object.getOwnPropertyDescriptor&&zl?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,_a=zl&&jl&&typeof jl.get=="function"?jl.get:null,Dp=zl&&Map.prototype.forEach,Jl=typeof Set=="function"&&Set.prototype,$l=Object.getOwnPropertyDescriptor&&Jl?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,va=Jl&&$l&&typeof $l.get=="function"?$l.get:null,Op=Jl&&Set.prototype.forEach,Nx=typeof WeakMap=="function"&&WeakMap.prototype,Qn=Nx?WeakMap.prototype.has:null,kx=typeof WeakSet=="function"&&WeakSet.prototype,qn=kx?WeakSet.prototype.has:null,Dx=typeof WeakRef=="function"&&WeakRef.prototype,Bp=Dx?WeakRef.prototype.deref:null,Ox=Boolean.prototype.valueOf,Bx=Object.prototype.toString,Ux=Function.prototype.toString,Xx=String.prototype.match,Ql=String.prototype.slice,yr=String.prototype.replace,Wx=String.prototype.toUpperCase,Up=String.prototype.toLowerCase,Xp=RegExp.prototype.test,Wp=Array.prototype.concat,Si=Array.prototype.join,Zx=Array.prototype.slice,Zp=Math.floor,ql=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tc=Object.getOwnPropertySymbols,ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,js=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ue=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===js||!0)?Symbol.toStringTag:null,Vp=Object.prototype.propertyIsEnumerable,Hp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Kp(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Xp.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Zp(-r):Zp(r);if(i!==r){var s=String(i),n=Ql.call(t,s.length+1);return yr.call(s,e,"$&_")+"."+yr.call(yr.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(t,e,"$&_")}var ic=Fx,Yp=ic.custom,zp=$p(Yp)?Yp:null,Vx=function r(t,e,i,s){var n=e||{};if(br(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(br(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=br(n,"customInspect")?n.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(br(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(br(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return qp(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return a?Kp(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return a?Kp(t,l):l}var c=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return rc(t)?"[Array]":"[Object]";var u=h_(n,i);if(typeof s>"u")s=[];else if(Qp(s,t)>=0)return"[Circular]";function d(A,G,D){if(G&&(s=Zx.call(s),s.push(G)),D){var X={depth:n.depth};return br(n,"quoteStyle")&&(X.quoteStyle=n.quoteStyle),r(A,X,i+1,s)}return r(A,n,i+1,s)}if(typeof t=="function"&&!Jp(t)){var f=qx(t),p=wa(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+Si.call(p,", ")+" }":"")}if($p(t)){var m=js?yr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ec.call(t);return typeof t=="object"&&!js?to(m):m}if(n_(t)){for(var g="<"+Up.call(String(t.nodeName)),b=t.attributes||[],_=0;_<b.length;_++)g+=" "+b[_].name+"="+jp(Hx(b[_].value),"double",n);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+Up.call(String(t.nodeName))+">",g}if(rc(t)){if(t.length===0)return"[]";var x=wa(t,d);return u&&!a_(x)?"["+nc(x,u)+"]":"[ "+Si.call(x,", ")+" ]"}if(Yx(t)){var v=wa(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!Vp.call(t,"cause")?"{ ["+String(t)+"] "+Si.call(Wp.call("[cause]: "+d(t.cause),v),", ")+" }":v.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Si.call(v,", ")+" }"}if(typeof t=="object"&&o){if(zp&&typeof t[zp]=="function"&&ic)return ic(t,{depth:c-i});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(t_(t)){var T=[];return Dp&&Dp.call(t,function(A,G){T.push(d(G,t,!0)+" => "+d(A,t))}),t0("Map",_a.call(t),T,u)}if(r_(t)){var C=[];return Op&&Op.call(t,function(A){C.push(d(A,t))}),t0("Set",va.call(t),C,u)}if(e_(t))return sc("WeakMap");if(s_(t))return sc("WeakSet");if(i_(t))return sc("WeakRef");if(jx(t))return to(d(Number(t)));if($x(t))return to(d(ql.call(t)));if(Jx(t))return to(Ox.call(t));if(zx(t))return to(d(String(t)));if(!Kx(t)&&!Jp(t)){var E=wa(t,d),I=Hp?Hp(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",N=!I&&ue&&Object(t)===t&&ue in t?Ql.call(xr(t),8,-1):R?"Object":"",F=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",P=F+(N||R?"["+Si.call(Wp.call([],N||[],R||[]),": ")+"] ":"");return E.length===0?P+"{}":u?P+"{"+nc(E,u)+"}":P+"{ "+Si.call(E,", ")+" }"}return String(t)};function jp(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function Hx(r){return yr.call(String(r),/"/g,"&quot;")}function rc(r){return xr(r)==="[object Array]"&&(!ue||!(typeof r=="object"&&ue in r))}function Kx(r){return xr(r)==="[object Date]"&&(!ue||!(typeof r=="object"&&ue in r))}function Jp(r){return xr(r)==="[object RegExp]"&&(!ue||!(typeof r=="object"&&ue in r))}function Yx(r){return xr(r)==="[object Error]"&&(!ue||!(typeof r=="object"&&ue in r))}function zx(r){return xr(r)==="[object String]"&&(!ue||!(typeof r=="object"&&ue in r))}function jx(r){return xr(r)==="[object Number]"&&(!ue||!(typeof r=="object"&&ue in r))}function Jx(r){return xr(r)==="[object Boolean]"&&(!ue||!(typeof r=="object"&&ue in r))}function $p(r){if(js)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!ec)return!1;try{return ec.call(r),!0}catch{}return!1}function $x(r){if(!r||typeof r!="object"||!ql)return!1;try{return ql.call(r),!0}catch{}return!1}var Qx=Object.prototype.hasOwnProperty||function(r){return r in this};function br(r,t){return Qx.call(r,t)}function xr(r){return Bx.call(r)}function qx(r){if(r.name)return r.name;var t=Xx.call(Ux.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function Qp(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}function t_(r){if(!_a||!r||typeof r!="object")return!1;try{_a.call(r);try{va.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function e_(r){if(!Qn||!r||typeof r!="object")return!1;try{Qn.call(r,Qn);try{qn.call(r,qn)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function i_(r){if(!Bp||!r||typeof r!="object")return!1;try{return Bp.call(r),!0}catch{}return!1}function r_(r){if(!va||!r||typeof r!="object")return!1;try{va.call(r);try{_a.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function s_(r){if(!qn||!r||typeof r!="object")return!1;try{qn.call(r,qn);try{Qn.call(r,Qn)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function n_(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function qp(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return qp(Ql.call(r,0,t.maxStringLength),t)+i}var s=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,o_);return jp(s,"single",t)}function o_(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Wx.call(t.toString(16))}function to(r){return"Object("+r+")"}function sc(r){return r+" { ? }"}function t0(r,t,e,i){var s=i?nc(e,i):Si.call(e,", ");return r+" ("+t+") {"+s+"}"}function a_(r){for(var t=0;t<r.length;t++)if(Qp(r[t],`
1
+ (function(rt,Le){typeof exports=="object"&&typeof module<"u"?Le(exports):typeof define=="function"&&define.amd?define(["exports"],Le):(rt=typeof globalThis<"u"?globalThis:rt||self,Le(rt["prefect-graphs"]={}))})(this,function(rt){"use strict";var oP=Object.defineProperty;var aP=(rt,Le,Yr)=>Le in rt?oP(rt,Le,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):rt[Le]=Yr;var kf=(rt,Le,Yr)=>aP(rt,typeof Le!="symbol"?Le+"":Le,Yr);const Le=["result","markdown","table","progress","image","unknown"],Yr={markdown:"ArtifactMarkdown",table:"ArtifactTable",result:"ArtifactResult",image:"ArtifactImage",progress:"ArtifactProgress",unknown:"Artifact"},Tl=["flow-run","task-run"];function Gb(r){return Tl.includes(r)}function ua(r){return Tl.includes(r.kind)}function Vf(r){return r.kind==="artifact"}function Hf(r){return r.kind==="artifacts"}function Kf(r){return r.kind==="state"}function Yf(r){return r.kind==="event"}function zf(r){return r.kind==="events"}const Fb=["COMPLETED","RUNNING","SCHEDULED","PENDING","FAILED","CANCELLED","CANCELLING","CRASHED","PAUSED"];function Nb(r){return["waterfall","nearest-parent","duration-sorted"].includes(r)}function kb(r){return["temporal","dependency","left-aligned"].includes(r)}const Sl="nodes-container",jf="node-container",Jf="edge-container",$f=1,Cl=20,Qf=200,qf=.2,tp=.2,ep=.2,ip=.1,El=10,Il=4,Al=20,Ml=64,Db=.25,Ob=1,Rl=30,rp=260,Pl=250,sp=1,np=2,op=3,ap=4,Ll=0,Gl=2,hp=1,lp=2,cp=3,Fl=4,Kn=5;var zr=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(zr||{}),up=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(up||{}),Nl=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(Nl||{}),dt=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(dt||{}),xi=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(xi||{}),V=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(V||{}),Xs=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Xs||{}),ht=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(ht||{}),et=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(et||{}),Ki=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(Ki||{}),_i=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(_i||{}),vi=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(vi||{}),we=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(we||{}),wi=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(wi||{}),kl=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(kl||{}),Ze=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(Ze||{}),te=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(te||{}),zt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(zt||{}),Ti=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Ti||{});const it={ADAPTER:{createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Dl=/iPhone/i,dp=/iPod/i,fp=/iPad/i,pp=/\biOS-universal(?:.+)Mac\b/i,Ol=/\bAndroid(?:.+)Mobile\b/i,mp=/Android/i,Ws=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,da=/Silk/i,Yi=/Windows Phone/i,gp=/\bWindows(?:.+)ARM\b/i,yp=/BlackBerry/i,bp=/BB10/i,xp=/Opera Mini/i,_p=/\b(CriOS|Chrome)(?:.+)Mobile/i,vp=/Mobile(?:.+)Firefox\b/i,wp=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Bb(r){return function(t){return t.test(r)}}function Tp(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var s=Bb(e),n={apple:{phone:s(Dl)&&!s(Yi),ipod:s(dp),tablet:!s(Dl)&&(s(fp)||wp(t))&&!s(Yi),universal:s(pp),device:(s(Dl)||s(dp)||s(fp)||s(pp)||wp(t))&&!s(Yi)},amazon:{phone:s(Ws),tablet:!s(Ws)&&s(da),device:s(Ws)||s(da)},android:{phone:!s(Yi)&&s(Ws)||!s(Yi)&&s(Ol),tablet:!s(Yi)&&!s(Ws)&&!s(Ol)&&(s(da)||s(mp)),device:!s(Yi)&&(s(Ws)||s(da)||s(Ol)||s(mp))||s(/\bokhttp\b/i)},windows:{phone:s(Yi),tablet:s(gp),device:s(Yi)||s(gp)},other:{blackberry:s(yp),blackberry10:s(bp),opera:s(xp),firefox:s(vp),chrome:s(_p),device:s(yp)||s(bp)||s(xp)||s(vp)||s(_p)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const Ub=Tp.default??Tp,zi=Ub(globalThis.navigator);it.RETINA_PREFIX=/@([0-9\.]+)x/,it.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Xb(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),e}var Sp={exports:{}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function s(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new s(c,u||h,d),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d<f;d++)p[d]=u[d].fn;return p},a.prototype.listenerCount=function(l){var c=e?e+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,d,f,p){var m=e?e+l:l;if(!this._events[m])return!1;var g=this._events[m],b=arguments.length,_,x;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),b){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,u),!0;case 4:return g.fn.call(g.context,c,u,d),!0;case 5:return g.fn.call(g.context,c,u,d,f),!0;case 6:return g.fn.call(g.context,c,u,d,f,p),!0}for(x=1,_=new Array(b-1);x<b;x++)_[x-1]=arguments[x];g.fn.apply(g.context,_)}else{var v=g.length,T;for(x=0;x<v;x++)switch(g[x].once&&this.removeListener(l,g[x].fn,void 0,!0),b){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,c);break;case 3:g[x].fn.call(g[x].context,c,u);break;case 4:g[x].fn.call(g[x].context,c,u,d);break;default:if(!_)for(T=1,_=new Array(b-1);T<b;T++)_[T-1]=arguments[T];g[x].fn.apply(g[x].context,_)}}return!0},a.prototype.on=function(l,c,u){return n(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return n(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,d){var f=e?e+l:l;if(!this._events[f])return this;if(!c)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!d||p.once)&&(!u||p.context===u)&&o(this,f);else{for(var m=0,g=[],b=p.length;m<b;m++)(p[m].fn!==c||d&&!p[m].once||u&&p[m].context!==u)&&g.push(p[m]);g.length?this._events[f]=g.length===1?g[0]:g:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=e?e+l:l,this._events[c]&&o(this,c)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,r.exports=a})(Sp);var Wb=Sp.exports;const Yn=Zs(Wb);var Bl={exports:{}};Bl.exports=fa,Bl.exports.default=fa;function fa(r,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:r.length,n=Cp(r,0,s,e,!0),o=[];if(!n||n.next===n.prev)return o;var a,h,l,c,u,d,f;if(i&&(n=Yb(r,t,n,e)),r.length>80*e){a=l=r[0],h=c=r[1];for(var p=e;p<s;p+=e)u=r[p],d=r[p+1],u<a&&(a=u),d<h&&(h=d),u>l&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return zn(n,o,e,a,h,f,0),o}function Cp(r,t,e,i,s){var n,o;if(s===Wl(r,t,e,i)>0)for(n=t;n<e;n+=i)o=Ap(n,r[n],r[n+1],o);else for(n=e-i;n>=t;n-=i)o=Ap(n,r[n],r[n+1],o);return o&&pa(o,o.next)&&(Jn(o),o=o.next),o}function jr(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(pa(e,e.next)||Ot(e.prev,e,e.next)===0)){if(Jn(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function zn(r,t,e,i,s,n,o){if(r){!o&&n&&Qb(r,i,s,n);for(var a=r,h,l;r.prev!==r.next;){if(h=r.prev,l=r.next,n?Vb(r,i,s,n):Zb(r)){t.push(h.i/e|0),t.push(r.i/e|0),t.push(l.i/e|0),Jn(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=Hb(jr(r),t,e),zn(r,t,e,i,s,n,2)):o===2&&Kb(r,t,e,i,s,n):zn(jr(r),t,e,i,s,n,1);break}}}}function Zb(r){var t=r.prev,e=r,i=r.next;if(Ot(t,e,i)>=0)return!1;for(var s=t.x,n=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=s<n?s<o?s:o:n<o?n:o,u=a<h?a<l?a:l:h<l?h:l,d=s>n?s>o?s:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&Vs(s,a,n,h,o,l,p.x,p.y)&&Ot(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Vb(r,t,e,i){var s=r.prev,n=r,o=r.next;if(Ot(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,c=s.y,u=n.y,d=o.y,f=a<h?a<l?a:l:h<l?h:l,p=c<u?c<d?c:d:u<d?u:d,m=a>h?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,b=Ul(f,p,t,e,i),_=Ul(m,g,t,e,i),x=r.prevZ,v=r.nextZ;x&&x.z>=b&&v&&v.z<=_;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Vs(a,c,h,u,l,d,x.x,x.y)&&Ot(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Vs(a,c,h,u,l,d,v.x,v.y)&&Ot(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=b;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==s&&x!==o&&Vs(a,c,h,u,l,d,x.x,x.y)&&Ot(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&Vs(a,c,h,u,l,d,v.x,v.y)&&Ot(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Hb(r,t,e){var i=r;do{var s=i.prev,n=i.next.next;!pa(s,n)&&Ep(s,i,i.next,n)&&jn(s,n)&&jn(n,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),Jn(i),Jn(i.next),i=r=n),i=i.next}while(i!==r);return jr(i)}function Kb(r,t,e,i,s,n){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ex(o,a)){var h=Ip(o,a);o=jr(o,o.next),h=jr(h,h.next),zn(o,t,e,i,s,n,0),zn(h,t,e,i,s,n,0);return}a=a.next}o=o.next}while(o!==r)}function Yb(r,t,e,i){var s=[],n,o,a,h,l;for(n=0,o=t.length;n<o;n++)a=t[n]*i,h=n<o-1?t[n+1]*i:r.length,l=Cp(r,a,h,i,!1),l===l.next&&(l.steiner=!0),s.push(tx(l));for(s.sort(zb),n=0;n<s.length;n++)e=jb(s[n],e);return e}function zb(r,t){return r.x-t.x}function jb(r,t){var e=Jb(r,t);if(!e)return t;var i=Ip(e,r);return jr(i,i.next),jr(e,e.next)}function Jb(r,t){var e=t,i=r.x,s=r.y,n=-1/0,o;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var a=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=i&&a>n&&(n=a,o=e.x<e.next.x?e:e.next,a===i))return o}e=e.next}while(e!==t);if(!o)return null;var h=o,l=o.x,c=o.y,u=1/0,d;e=o;do i>=e.x&&e.x>=l&&i!==e.x&&Vs(s<c?i:n,s,l,c,s<c?n:i,s,e.x,e.y)&&(d=Math.abs(s-e.y)/(i-e.x),jn(e,r)&&(d<u||d===u&&(e.x>o.x||e.x===o.x&&$b(o,e)))&&(o=e,u=d)),e=e.next;while(e!==h);return o}function $b(r,t){return Ot(r.prev,r,t.prev)<0&&Ot(t.next,r,r.next)<0}function Qb(r,t,e,i){var s=r;do s.z===0&&(s.z=Ul(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,qb(s)}function qb(r){var t,e,i,s,n,o,a,h,l=1;do{for(e=r,r=null,n=null,o=0;e;){for(o++,i=e,a=0,t=0;t<l&&(a++,i=i.nextZ,!!i);t++);for(h=l;a>0||h>0&&i;)a!==0&&(h===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,a--):(s=i,i=i.nextZ,h--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;e=i}n.nextZ=null,l*=2}while(o>1);return r}function Ul(r,t,e,i,s){return r=(r-e)*s|0,t=(t-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function tx(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Vs(r,t,e,i,s,n,o,a){return(s-o)*(t-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(s-o)*(i-a)}function ex(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!ix(r,t)&&(jn(r,t)&&jn(t,r)&&rx(r,t)&&(Ot(r.prev,r,t.prev)||Ot(r,t.prev,t))||pa(r,t)&&Ot(r.prev,r,r.next)>0&&Ot(t.prev,t,t.next)>0)}function Ot(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function pa(r,t){return r.x===t.x&&r.y===t.y}function Ep(r,t,e,i){var s=ga(Ot(r,t,e)),n=ga(Ot(r,t,i)),o=ga(Ot(e,i,r)),a=ga(Ot(e,i,t));return!!(s!==n&&o!==a||s===0&&ma(r,e,t)||n===0&&ma(r,i,t)||o===0&&ma(e,r,i)||a===0&&ma(e,t,i))}function ma(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ga(r){return r>0?1:r<0?-1:0}function ix(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ep(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function jn(r,t){return Ot(r.prev,r,r.next)<0?Ot(r,t,r.next)>=0&&Ot(r,r.prev,t)>=0:Ot(r,t,r.prev)<0||Ot(r,r.next,t)<0}function rx(r,t){var e=r,i=!1,s=(r.x+t.x)/2,n=(r.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&s<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function Ip(r,t){var e=new Xl(r.i,r.x,r.y),i=new Xl(t.i,t.x,t.y),s=r.next,n=t.prev;return r.next=t,t.prev=r,e.next=s,s.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function Ap(r,t,e,i){var s=new Xl(r,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Jn(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Xl(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}fa.deviation=function(r,t,e,i){var s=t&&t.length,n=s?t[0]*e:r.length,o=Math.abs(Wl(r,0,n,e));if(s)for(var a=0,h=t.length;a<h;a++){var l=t[a]*e,c=a<h-1?t[a+1]*e:r.length;o-=Math.abs(Wl(r,l,c,e))}var u=0;for(a=0;a<i.length;a+=3){var d=i[a]*e,f=i[a+1]*e,p=i[a+2]*e;u+=Math.abs((r[d]-r[p])*(r[f+1]-r[d+1])-(r[d]-r[f])*(r[p+1]-r[d+1]))}return o===0&&u===0?0:Math.abs((u-o)/o)};function Wl(r,t,e,i){for(var s=0,n=t,o=e-i;n<e;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}fa.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<r.length;s++){for(var n=0;n<r[s].length;n++)for(var o=0;o<t;o++)e.vertices.push(r[s][n][o]);s>0&&(i+=r[s-1].length,e.holes.push(i))}return e};var sx=Bl.exports;const nx=Zs(sx);var ya={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ya.exports,function(r,t){(function(e){var i=t&&!t.nodeType&&t,s=r&&!r.nodeType&&r,n=typeof be=="object"&&be;(n.global===n||n.window===n||n.self===n)&&(e=n);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=h-l,T=Math.floor,C=String.fromCharCode,E;function I(W){throw new RangeError(x[W])}function R(W,L){for(var O=W.length,U=[];O--;)U[O]=L(W[O]);return U}function N(W,L){var O=W.split("@"),U="";O.length>1&&(U=O[0]+"@",W=O[1]),W=W.replace(_,".");var tt=W.split("."),Q=R(tt,L).join(".");return U+Q}function F(W){for(var L=[],O=0,U=W.length,tt,Q;O<U;)tt=W.charCodeAt(O++),tt>=55296&&tt<=56319&&O<U?(Q=W.charCodeAt(O++),(Q&64512)==56320?L.push(((tt&1023)<<10)+(Q&1023)+65536):(L.push(tt),O--)):L.push(tt);return L}function P(W){return R(W,function(L){var O="";return L>65535&&(L-=65536,O+=C(L>>>10&1023|55296),L=56320|L&1023),O+=C(L),O}).join("")}function A(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:h}function G(W,L){return W+22+75*(W<26)-((L!=0)<<5)}function D(W,L,O){var U=0;for(W=O?T(W/d):W>>1,W+=T(W/L);W>v*c>>1;U+=h)W=T(W/v);return T(U+(v+1)*W/(W+u))}function X(W){var L=[],O=W.length,U,tt=0,Q=p,xt=f,Ct,q,Z,Y,z,k,ut,gt,At;for(Ct=W.lastIndexOf(m),Ct<0&&(Ct=0),q=0;q<Ct;++q)W.charCodeAt(q)>=128&&I("not-basic"),L.push(W.charCodeAt(q));for(Z=Ct>0?Ct+1:0;Z<O;){for(Y=tt,z=1,k=h;Z>=O&&I("invalid-input"),ut=A(W.charCodeAt(Z++)),(ut>=h||ut>T((a-tt)/z))&&I("overflow"),tt+=ut*z,gt=k<=xt?l:k>=xt+c?c:k-xt,!(ut<gt);k+=h)At=h-gt,z>T(a/At)&&I("overflow"),z*=At;U=L.length+1,xt=D(tt-Y,U,Y==0),T(tt/U)>a-Q&&I("overflow"),Q+=T(tt/U),tt%=U,L.splice(tt++,0,Q)}return P(L)}function B(W){var L,O,U,tt,Q,xt,Ct,q,Z,Y,z,k=[],ut,gt,At,Ft;for(W=F(W),ut=W.length,L=p,O=0,Q=f,xt=0;xt<ut;++xt)z=W[xt],z<128&&k.push(C(z));for(U=tt=k.length,tt&&k.push(m);U<ut;){for(Ct=a,xt=0;xt<ut;++xt)z=W[xt],z>=L&&z<Ct&&(Ct=z);for(gt=U+1,Ct-L>T((a-O)/gt)&&I("overflow"),O+=(Ct-L)*gt,L=Ct,xt=0;xt<ut;++xt)if(z=W[xt],z<L&&++O>a&&I("overflow"),z==L){for(q=O,Z=h;Y=Z<=Q?l:Z>=Q+c?c:Z-Q,!(q<Y);Z+=h)Ft=q-Y,At=h-Y,k.push(C(G(Y+Ft%At,0))),q=T(Ft/At);k.push(C(G(q,0))),Q=D(O,gt,U==tt),O=0,++U}++O,++L}return k.join("")}function H(W){return N(W,function(L){return g.test(L)?X(L.slice(4).toLowerCase()):L})}function lt(W){return N(W,function(L){return b.test(L)?"xn--"+B(L):L})}if(o={version:"1.4.1",ucs2:{decode:F,encode:P},decode:X,encode:B,toASCII:lt,toUnicode:H},i&&s)if(r.exports==i)s.exports=o;else for(E in o)o.hasOwnProperty(E)&&(i[E]=o[E]);else e.punycode=o})(be)}(ya,ya.exports);var ox=ya.exports,ax=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,e);if(o.value!==s||o.enumerable!==!0)return!1}return!0},Mp=typeof Symbol<"u"&&Symbol,hx=ax,lx=function(){return typeof Mp!="function"||typeof Symbol!="function"||typeof Mp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hx()},Rp={foo:{}},cx=Object,ux=function(){return{__proto__:Rp}.foo===Rp.foo&&!({__proto__:null}instanceof cx)},dx="Function.prototype.bind called on incompatible ",Zl=Array.prototype.slice,fx=Object.prototype.toString,px="[object Function]",mx=function(t){var e=this;if(typeof e!="function"||fx.call(e)!==px)throw new TypeError(dx+e);for(var i=Zl.call(arguments,1),s,n=function(){if(this instanceof s){var c=e.apply(this,i.concat(Zl.call(arguments)));return Object(c)===c?c:this}else return e.apply(t,i.concat(Zl.call(arguments)))},o=Math.max(0,e.length-i.length),a=[],h=0;h<o;h++)a.push("$"+h);if(s=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var l=function(){};l.prototype=e.prototype,s.prototype=new l,l.prototype=null}return s},gx=mx,Vl=Function.prototype.bind||gx,yx=Vl,bx=yx.call(Function.call,Object.prototype.hasOwnProperty),wt,Hs=SyntaxError,Pp=Function,Ks=TypeError,Hl=function(r){try{return Pp('"use strict"; return ('+r+").constructor;")()}catch{}},Jr=Object.getOwnPropertyDescriptor;if(Jr)try{Jr({},"")}catch{Jr=null}var Kl=function(){throw new Ks},xx=Jr?function(){try{return arguments.callee,Kl}catch{try{return Jr(arguments,"callee").get}catch{return Kl}}}():Kl,Ys=lx(),_x=ux(),se=Object.getPrototypeOf||(_x?function(r){return r.__proto__}:null),zs={},vx=typeof Uint8Array>"u"||!se?wt:se(Uint8Array),$r={"%AggregateError%":typeof AggregateError>"u"?wt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?wt:ArrayBuffer,"%ArrayIteratorPrototype%":Ys&&se?se([][Symbol.iterator]()):wt,"%AsyncFromSyncIteratorPrototype%":wt,"%AsyncFunction%":zs,"%AsyncGenerator%":zs,"%AsyncGeneratorFunction%":zs,"%AsyncIteratorPrototype%":zs,"%Atomics%":typeof Atomics>"u"?wt:Atomics,"%BigInt%":typeof BigInt>"u"?wt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?wt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?wt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?wt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?wt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?wt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?wt:FinalizationRegistry,"%Function%":Pp,"%GeneratorFunction%":zs,"%Int8Array%":typeof Int8Array>"u"?wt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?wt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?wt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ys&&se?se(se([][Symbol.iterator]())):wt,"%JSON%":typeof JSON=="object"?JSON:wt,"%Map%":typeof Map>"u"?wt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ys||!se?wt:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?wt:Promise,"%Proxy%":typeof Proxy>"u"?wt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?wt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?wt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ys||!se?wt:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?wt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ys&&se?se(""[Symbol.iterator]()):wt,"%Symbol%":Ys?Symbol:wt,"%SyntaxError%":Hs,"%ThrowTypeError%":xx,"%TypedArray%":vx,"%TypeError%":Ks,"%Uint8Array%":typeof Uint8Array>"u"?wt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?wt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?wt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?wt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?wt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?wt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?wt:WeakSet};if(se)try{null.error}catch(r){var wx=se(se(r));$r["%Error.prototype%"]=wx}var Tx=function r(t){var e;if(t==="%AsyncFunction%")e=Hl("async function () {}");else if(t==="%GeneratorFunction%")e=Hl("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Hl("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=r("%AsyncGenerator%");s&&se&&(e=se(s.prototype))}return $r[t]=e,e},Lp={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$n=Vl,ba=bx,Sx=$n.call(Function.call,Array.prototype.concat),Cx=$n.call(Function.apply,Array.prototype.splice),Gp=$n.call(Function.call,String.prototype.replace),xa=$n.call(Function.call,String.prototype.slice),Ex=$n.call(Function.call,RegExp.prototype.exec),Ix=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ax=/\\(\\)?/g,Mx=function(t){var e=xa(t,0,1),i=xa(t,-1);if(e==="%"&&i!=="%")throw new Hs("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Hs("invalid intrinsic syntax, expected opening `%`");var s=[];return Gp(t,Ix,function(n,o,a,h){s[s.length]=a?Gp(h,Ax,"$1"):o||n}),s},Rx=function(t,e){var i=t,s;if(ba(Lp,i)&&(s=Lp[i],i="%"+s[0]+"%"),ba($r,i)){var n=$r[i];if(n===zs&&(n=Tx(i)),typeof n>"u"&&!e)throw new Ks("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:n}}throw new Hs("intrinsic "+t+" does not exist!")},Yl=function(t,e){if(typeof t!="string"||t.length===0)throw new Ks("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ks('"allowMissing" argument must be a boolean');if(Ex(/^%?[^%]*%?$/,t)===null)throw new Hs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Mx(t),s=i.length>0?i[0]:"",n=Rx("%"+s+"%",e),o=n.name,a=n.value,h=!1,l=n.alias;l&&(s=l[0],Cx(i,Sx([0,1],l)));for(var c=1,u=!0;c<i.length;c+=1){var d=i[c],f=xa(d,0,1),p=xa(d,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new Hs("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(h=!0),s+="."+d,o="%"+s+"%",ba($r,o))a=$r[o];else if(a!=null){if(!(d in a)){if(!e)throw new Ks("base intrinsic for "+t+" exists, but the property is not available.");return}if(Jr&&c+1>=i.length){var m=Jr(a,d);u=!!m,u&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[d]}else u=ba(a,d),a=a[d];u&&!h&&($r[o]=a)}}return a},Fp={exports:{}};(function(r){var t=Vl,e=Yl,i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),n=e("%Reflect.apply%",!0)||t.call(s,i),o=e("%Object.getOwnPropertyDescriptor%",!0),a=e("%Object.defineProperty%",!0),h=e("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}r.exports=function(u){var d=n(t,s,arguments);if(o&&a){var f=o(d,"length");f.configurable&&a(d,"length",{value:1+h(0,u.length-(arguments.length-1))})}return d};var l=function(){return n(t,i,arguments)};a?a(r.exports,"apply",{value:l}):r.exports.apply=l})(Fp);var Px=Fp.exports,Np=Yl,kp=Px,Lx=kp(Np("String.prototype.indexOf")),Gx=function(t,e){var i=Np(t,!!e);return typeof i=="function"&&Lx(t,".prototype.")>-1?kp(i):i};const Fx=Xb(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zl=typeof Map=="function"&&Map.prototype,jl=Object.getOwnPropertyDescriptor&&zl?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,_a=zl&&jl&&typeof jl.get=="function"?jl.get:null,Dp=zl&&Map.prototype.forEach,Jl=typeof Set=="function"&&Set.prototype,$l=Object.getOwnPropertyDescriptor&&Jl?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,va=Jl&&$l&&typeof $l.get=="function"?$l.get:null,Op=Jl&&Set.prototype.forEach,Nx=typeof WeakMap=="function"&&WeakMap.prototype,Qn=Nx?WeakMap.prototype.has:null,kx=typeof WeakSet=="function"&&WeakSet.prototype,qn=kx?WeakSet.prototype.has:null,Dx=typeof WeakRef=="function"&&WeakRef.prototype,Bp=Dx?WeakRef.prototype.deref:null,Ox=Boolean.prototype.valueOf,Bx=Object.prototype.toString,Ux=Function.prototype.toString,Xx=String.prototype.match,Ql=String.prototype.slice,yr=String.prototype.replace,Wx=String.prototype.toUpperCase,Up=String.prototype.toLowerCase,Xp=RegExp.prototype.test,Wp=Array.prototype.concat,Si=Array.prototype.join,Zx=Array.prototype.slice,Zp=Math.floor,ql=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tc=Object.getOwnPropertySymbols,ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,js=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ue=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===js||!0)?Symbol.toStringTag:null,Vp=Object.prototype.propertyIsEnumerable,Hp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Kp(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Xp.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Zp(-r):Zp(r);if(i!==r){var s=String(i),n=Ql.call(t,s.length+1);return yr.call(s,e,"$&_")+"."+yr.call(yr.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(t,e,"$&_")}var ic=Fx,Yp=ic.custom,zp=$p(Yp)?Yp:null,Vx=function r(t,e,i,s){var n=e||{};if(br(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(br(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=br(n,"customInspect")?n.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(br(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(br(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return qp(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return a?Kp(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return a?Kp(t,l):l}var c=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return rc(t)?"[Array]":"[Object]";var u=h_(n,i);if(typeof s>"u")s=[];else if(Qp(s,t)>=0)return"[Circular]";function d(A,G,D){if(G&&(s=Zx.call(s),s.push(G)),D){var X={depth:n.depth};return br(n,"quoteStyle")&&(X.quoteStyle=n.quoteStyle),r(A,X,i+1,s)}return r(A,n,i+1,s)}if(typeof t=="function"&&!Jp(t)){var f=qx(t),p=wa(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+Si.call(p,", ")+" }":"")}if($p(t)){var m=js?yr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ec.call(t);return typeof t=="object"&&!js?to(m):m}if(n_(t)){for(var g="<"+Up.call(String(t.nodeName)),b=t.attributes||[],_=0;_<b.length;_++)g+=" "+b[_].name+"="+jp(Hx(b[_].value),"double",n);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+Up.call(String(t.nodeName))+">",g}if(rc(t)){if(t.length===0)return"[]";var x=wa(t,d);return u&&!a_(x)?"["+nc(x,u)+"]":"[ "+Si.call(x,", ")+" ]"}if(Yx(t)){var v=wa(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!Vp.call(t,"cause")?"{ ["+String(t)+"] "+Si.call(Wp.call("[cause]: "+d(t.cause),v),", ")+" }":v.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Si.call(v,", ")+" }"}if(typeof t=="object"&&o){if(zp&&typeof t[zp]=="function"&&ic)return ic(t,{depth:c-i});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(t_(t)){var T=[];return Dp&&Dp.call(t,function(A,G){T.push(d(G,t,!0)+" => "+d(A,t))}),t0("Map",_a.call(t),T,u)}if(r_(t)){var C=[];return Op&&Op.call(t,function(A){C.push(d(A,t))}),t0("Set",va.call(t),C,u)}if(e_(t))return sc("WeakMap");if(s_(t))return sc("WeakSet");if(i_(t))return sc("WeakRef");if(jx(t))return to(d(Number(t)));if($x(t))return to(d(ql.call(t)));if(Jx(t))return to(Ox.call(t));if(zx(t))return to(d(String(t)));if(!Kx(t)&&!Jp(t)){var E=wa(t,d),I=Hp?Hp(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",N=!I&&ue&&Object(t)===t&&ue in t?Ql.call(xr(t),8,-1):R?"Object":"",F=I||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",P=F+(N||R?"["+Si.call(Wp.call([],N||[],R||[]),": ")+"] ":"");return E.length===0?P+"{}":u?P+"{"+nc(E,u)+"}":P+"{ "+Si.call(E,", ")+" }"}return String(t)};function jp(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function Hx(r){return yr.call(String(r),/"/g,"&quot;")}function rc(r){return xr(r)==="[object Array]"&&(!ue||!(typeof r=="object"&&ue in r))}function Kx(r){return xr(r)==="[object Date]"&&(!ue||!(typeof r=="object"&&ue in r))}function Jp(r){return xr(r)==="[object RegExp]"&&(!ue||!(typeof r=="object"&&ue in r))}function Yx(r){return xr(r)==="[object Error]"&&(!ue||!(typeof r=="object"&&ue in r))}function zx(r){return xr(r)==="[object String]"&&(!ue||!(typeof r=="object"&&ue in r))}function jx(r){return xr(r)==="[object Number]"&&(!ue||!(typeof r=="object"&&ue in r))}function Jx(r){return xr(r)==="[object Boolean]"&&(!ue||!(typeof r=="object"&&ue in r))}function $p(r){if(js)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!ec)return!1;try{return ec.call(r),!0}catch{}return!1}function $x(r){if(!r||typeof r!="object"||!ql)return!1;try{return ql.call(r),!0}catch{}return!1}var Qx=Object.prototype.hasOwnProperty||function(r){return r in this};function br(r,t){return Qx.call(r,t)}function xr(r){return Bx.call(r)}function qx(r){if(r.name)return r.name;var t=Xx.call(Ux.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function Qp(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}function t_(r){if(!_a||!r||typeof r!="object")return!1;try{_a.call(r);try{va.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function e_(r){if(!Qn||!r||typeof r!="object")return!1;try{Qn.call(r,Qn);try{qn.call(r,qn)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function i_(r){if(!Bp||!r||typeof r!="object")return!1;try{return Bp.call(r),!0}catch{}return!1}function r_(r){if(!va||!r||typeof r!="object")return!1;try{va.call(r);try{_a.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function s_(r){if(!qn||!r||typeof r!="object")return!1;try{qn.call(r,qn);try{Qn.call(r,Qn)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function n_(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function qp(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return qp(Ql.call(r,0,t.maxStringLength),t)+i}var s=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,o_);return jp(s,"single",t)}function o_(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Wx.call(t.toString(16))}function to(r){return"Object("+r+")"}function sc(r){return r+" { ? }"}function t0(r,t,e,i){var s=i?nc(e,i):Si.call(e,", ");return r+" ("+t+") {"+s+"}"}function a_(r){for(var t=0;t<r.length;t++)if(Qp(r[t],`
2
2
  `)>=0)return!1;return!0}function h_(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Si.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Si.call(Array(t+1),e)}}function nc(r,t){if(r.length===0)return"";var e=`
3
3
  `+t.prev+t.base;return e+Si.call(r,","+e)+`
4
4
  `+t.prev}function wa(r,t){var e=rc(r),i=[];if(e){i.length=r.length;for(var s=0;s<r.length;s++)i[s]=br(r,s)?t(r[s],r):""}var n=typeof tc=="function"?tc(r):[],o;if(js){o={};for(var a=0;a<n.length;a++)o["$"+n[a]]=n[a]}for(var h in r)br(r,h)&&(e&&String(Number(h))===h&&h<r.length||js&&o["$"+h]instanceof Symbol||(Xp.call(/[^\w$]/,h)?i.push(t(h,r)+": "+t(r[h],r)):i.push(h+": "+t(r[h],r))));if(typeof tc=="function")for(var l=0;l<n.length;l++)Vp.call(r,n[l])&&i.push("["+t(n[l])+"]: "+t(r[n[l]],r));return i}var oc=Yl,Js=Gx,l_=Vx,c_=oc("%TypeError%"),Ta=oc("%WeakMap%",!0),Sa=oc("%Map%",!0),u_=Js("WeakMap.prototype.get",!0),d_=Js("WeakMap.prototype.set",!0),f_=Js("WeakMap.prototype.has",!0),p_=Js("Map.prototype.get",!0),m_=Js("Map.prototype.set",!0),g_=Js("Map.prototype.has",!0),ac=function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},y_=function(r,t){var e=ac(r,t);return e&&e.value},b_=function(r,t,e){var i=ac(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},x_=function(r,t){return!!ac(r,t)},__=function(){var t,e,i,s={assert:function(n){if(!s.has(n))throw new c_("Side channel does not contain "+l_(n))},get:function(n){if(Ta&&n&&(typeof n=="object"||typeof n=="function")){if(t)return u_(t,n)}else if(Sa){if(e)return p_(e,n)}else if(i)return y_(i,n)},has:function(n){if(Ta&&n&&(typeof n=="object"||typeof n=="function")){if(t)return f_(t,n)}else if(Sa){if(e)return g_(e,n)}else if(i)return x_(i,n);return!1},set:function(n,o){Ta&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new Ta),d_(t,n,o)):Sa?(e||(e=new Sa),m_(e,n,o)):(i||(i={key:{},next:null}),b_(i,n,o))}};return s},v_=String.prototype.replace,w_=/%20/g,hc={RFC1738:"RFC1738",RFC3986:"RFC3986"},lc={default:hc.RFC3986,formatters:{RFC1738:function(r){return v_.call(r,w_,"+")},RFC3986:function(r){return String(r)}},RFC1738:hc.RFC1738,RFC3986:hc.RFC3986},T_=lc,cc=Object.prototype.hasOwnProperty,Qr=Array.isArray,Ci=function(){for(var r=[],t=0;t<256;++t)r.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return r}(),S_=function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(Qr(i)){for(var s=[],n=0;n<i.length;++n)typeof i[n]<"u"&&s.push(i[n]);e.obj[e.prop]=s}}},e0=function(t,e){for(var i=e&&e.plainObjects?Object.create(null):{},s=0;s<t.length;++s)typeof t[s]<"u"&&(i[s]=t[s]);return i},C_=function r(t,e,i){if(!e)return t;if(typeof e!="object"){if(Qr(t))t.push(e);else if(t&&typeof t=="object")(i&&(i.plainObjects||i.allowPrototypes)||!cc.call(Object.prototype,e))&&(t[e]=!0);else return[t,e];return t}if(!t||typeof t!="object")return[t].concat(e);var s=t;return Qr(t)&&!Qr(e)&&(s=e0(t,i)),Qr(t)&&Qr(e)?(e.forEach(function(n,o){if(cc.call(t,o)){var a=t[o];a&&typeof a=="object"&&n&&typeof n=="object"?t[o]=r(a,n,i):t.push(n)}else t[o]=n}),t):Object.keys(e).reduce(function(n,o){var a=e[o];return cc.call(n,o)?n[o]=r(n[o],a,i):n[o]=a,n},s)},E_=function(t,e){return Object.keys(e).reduce(function(i,s){return i[s]=e[s],i},t)},I_=function(r,t,e){var i=r.replace(/\+/g," ");if(e==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},A_=function(t,e,i,s,n){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),i==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var a="",h=0;h<o.length;++h){var l=o.charCodeAt(h);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||n===T_.RFC1738&&(l===40||l===41)){a+=o.charAt(h);continue}if(l<128){a=a+Ci[l];continue}if(l<2048){a=a+(Ci[192|l>>6]+Ci[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Ci[224|l>>12]+Ci[128|l>>6&63]+Ci[128|l&63]);continue}h+=1,l=65536+((l&1023)<<10|o.charCodeAt(h)&1023),a+=Ci[240|l>>18]+Ci[128|l>>12&63]+Ci[128|l>>6&63]+Ci[128|l&63]}return a},M_=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],s=0;s<e.length;++s)for(var n=e[s],o=n.obj[n.prop],a=Object.keys(o),h=0;h<a.length;++h){var l=a[h],c=o[l];typeof c=="object"&&c!==null&&i.indexOf(c)===-1&&(e.push({obj:o,prop:l}),i.push(c))}return S_(e),t},R_=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},P_=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},L_=function(t,e){return[].concat(t,e)},G_=function(t,e){if(Qr(t)){for(var i=[],s=0;s<t.length;s+=1)i.push(e(t[s]));return i}return e(t)},i0={arrayToObject:e0,assign:E_,combine:L_,compact:M_,decode:I_,encode:A_,isBuffer:P_,isRegExp:R_,maybeMap:G_,merge:C_},r0=__,Ca=i0,eo=lc,F_=Object.prototype.hasOwnProperty,s0={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ji=Array.isArray,N_=Array.prototype.push,n0=function(r,t){N_.apply(r,ji(t)?t:[t])},k_=Date.prototype.toISOString,o0=eo.default,de={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ca.encode,encodeValuesOnly:!1,format:o0,formatter:eo.formatters[o0],indices:!1,serializeDate:function(t){return k_.call(t)},skipNulls:!1,strictNullHandling:!1},D_=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},uc={},O_=function r(t,e,i,s,n,o,a,h,l,c,u,d,f,p,m,g){for(var b=t,_=g,x=0,v=!1;(_=_.get(uc))!==void 0&&!v;){var T=_.get(t);if(x+=1,typeof T<"u"){if(T===x)throw new RangeError("Cyclic object value");v=!0}typeof _.get(uc)>"u"&&(x=0)}if(typeof h=="function"?b=h(e,b):b instanceof Date?b=u(b):i==="comma"&&ji(b)&&(b=Ca.maybeMap(b,function(X){return X instanceof Date?u(X):X})),b===null){if(n)return a&&!p?a(e,de.encoder,m,"key",d):e;b=""}if(D_(b)||Ca.isBuffer(b)){if(a){var C=p?e:a(e,de.encoder,m,"key",d);return[f(C)+"="+f(a(b,de.encoder,m,"value",d))]}return[f(e)+"="+f(String(b))]}var E=[];if(typeof b>"u")return E;var I;if(i==="comma"&&ji(b))p&&a&&(b=Ca.maybeMap(b,a)),I=[{value:b.length>0?b.join(",")||null:void 0}];else if(ji(h))I=h;else{var R=Object.keys(b);I=l?R.sort(l):R}for(var N=s&&ji(b)&&b.length===1?e+"[]":e,F=0;F<I.length;++F){var P=I[F],A=typeof P=="object"&&typeof P.value<"u"?P.value:b[P];if(!(o&&A===null)){var G=ji(b)?typeof i=="function"?i(N,P):N:N+(c?"."+P:"["+P+"]");g.set(t,x);var D=r0();D.set(uc,g),n0(E,r(A,G,i,s,n,o,i==="comma"&&p&&ji(b)?null:a,h,l,c,u,d,f,p,m,D))}}return E},B_=function(t){if(!t)return de;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var e=t.charset||de.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=eo.default;if(typeof t.format<"u"){if(!F_.call(eo.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var s=eo.formatters[i],n=de.filter;return(typeof t.filter=="function"||ji(t.filter))&&(n=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:de.addQueryPrefix,allowDots:typeof t.allowDots>"u"?de.allowDots:!!t.allowDots,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:de.charsetSentinel,delimiter:typeof t.delimiter>"u"?de.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:de.encode,encoder:typeof t.encoder=="function"?t.encoder:de.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:de.encodeValuesOnly,filter:n,format:i,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:de.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:de.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:de.strictNullHandling}},U_=function(r,t){var e=r,i=B_(t),s,n;typeof i.filter=="function"?(n=i.filter,e=n("",e)):ji(i.filter)&&(n=i.filter,s=n);var o=[];if(typeof e!="object"||e===null)return"";var a;t&&t.arrayFormat in s0?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var h=s0[a];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=h==="comma"&&t&&t.commaRoundTrip;s||(s=Object.keys(e)),i.sort&&s.sort(i.sort);for(var c=r0(),u=0;u<s.length;++u){var d=s[u];i.skipNulls&&e[d]===null||n0(o,O_(e[d],d,h,l,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var f=o.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},$s=i0,dc=Object.prototype.hasOwnProperty,X_=Array.isArray,ne={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:$s.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},W_=function(r){return r.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},a0=function(r,t){return r&&typeof r=="string"&&t.comma&&r.indexOf(",")>-1?r.split(","):r},Z_="utf8=%26%2310003%3B",V_="utf8=%E2%9C%93",H_=function(t,e){var i={__proto__:null},s=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,n=e.parameterLimit===1/0?void 0:e.parameterLimit,o=s.split(e.delimiter,n),a=-1,h,l=e.charset;if(e.charsetSentinel)for(h=0;h<o.length;++h)o[h].indexOf("utf8=")===0&&(o[h]===V_?l="utf-8":o[h]===Z_&&(l="iso-8859-1"),a=h,h=o.length);for(h=0;h<o.length;++h)if(h!==a){var c=o[h],u=c.indexOf("]="),d=u===-1?c.indexOf("="):u+1,f,p;d===-1?(f=e.decoder(c,ne.decoder,l,"key"),p=e.strictNullHandling?null:""):(f=e.decoder(c.slice(0,d),ne.decoder,l,"key"),p=$s.maybeMap(a0(c.slice(d+1),e),function(m){return e.decoder(m,ne.decoder,l,"value")})),p&&e.interpretNumericEntities&&l==="iso-8859-1"&&(p=W_(p)),c.indexOf("[]=")>-1&&(p=X_(p)?[p]:p),dc.call(i,f)?i[f]=$s.combine(i[f],p):i[f]=p}return i},K_=function(r,t,e,i){for(var s=i?t:a0(t,e),n=r.length-1;n>=0;--n){var o,a=r[n];if(a==="[]"&&e.parseArrays)o=[].concat(s);else{o=e.plainObjects?Object.create(null):{};var h=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(h,10);!e.parseArrays&&h===""?o={0:s}:!isNaN(l)&&a!==h&&String(l)===h&&l>=0&&e.parseArrays&&l<=e.arrayLimit?(o=[],o[l]=s):h!=="__proto__"&&(o[h]=s)}s=o}return s},Y_=function(t,e,i,s){if(t){var n=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,h=i.depth>0&&o.exec(n),l=h?n.slice(0,h.index):n,c=[];if(l){if(!i.plainObjects&&dc.call(Object.prototype,l)&&!i.allowPrototypes)return;c.push(l)}for(var u=0;i.depth>0&&(h=a.exec(n))!==null&&u<i.depth;){if(u+=1,!i.plainObjects&&dc.call(Object.prototype,h[1].slice(1,-1))&&!i.allowPrototypes)return;c.push(h[1])}return h&&c.push("["+n.slice(h.index)+"]"),K_(c,e,i,s)}},z_=function(t){if(!t)return ne;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=typeof t.charset>"u"?ne.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?ne.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:ne.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:ne.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:ne.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ne.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:ne.comma,decoder:typeof t.decoder=="function"?t.decoder:ne.decoder,delimiter:typeof t.delimiter=="string"||$s.isRegExp(t.delimiter)?t.delimiter:ne.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:ne.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:ne.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:ne.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:ne.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ne.strictNullHandling}},j_=function(r,t){var e=z_(t);if(r===""||r===null||typeof r>"u")return e.plainObjects?Object.create(null):{};for(var i=typeof r=="string"?H_(r,e):r,s=e.plainObjects?Object.create(null):{},n=Object.keys(i),o=0;o<n.length;++o){var a=n[o],h=Y_(a,i[a],e,typeof r=="string");s=$s.merge(s,h,e)}return e.allowSparse===!0?s:$s.compact(s)},J_=U_,$_=j_,Q_=lc,q_={formats:Q_,parse:$_,stringify:J_},tv=ox;function Ji(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var ev=/^([a-z0-9.+-]+:)/i,iv=/:[0-9]*$/,rv=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,sv=["<",">",'"',"`"," ","\r",`
@@ -920,7 +920,7 @@ ${u}`)}});return await Promise.all(h),n?s[o[0].src]:s}async unload(t){const e=oi
920
920
  });
921
921
  }
922
922
  };`};let ou;class $2{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const e=URL.createObjectURL(new Blob([j2.code],{type:"application/javascript"})),i=new Worker(e);i.addEventListener("message",s=>{i.terminate(),URL.revokeObjectURL(e),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){nu===void 0&&(nu=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<nu&&(ou||(ou=URL.createObjectURL(new Blob([J2.code],{type:"application/javascript"}))),this._createdWorkers++,t=new Worker(ou),t.addEventListener("message",e=>{this.complete(e.data),this.returnWorker(e.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const i=new Promise((s,n)=>{this.queue.push({id:t,arguments:e,resolve:s,reject:n})});return this.next(),i}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[Um]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Um++,id:i})}}const Xm=new $2;function uo(r,t,e){r.resource.internal=!0;const i=new ot(r),s=()=>{delete t.promiseCache[e],cs.has(e)&&cs.remove(e)};return i.baseTexture.once("destroyed",()=>{e in t.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),s())}),i.once("destroyed",()=>{r.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s())}),i}const Q2=[".jpeg",".jpg",".png",".webp",".avif"],q2=["image/jpeg","image/png","image/webp","image/avif"];async function tT(r){const t=await it.ADAPTER.fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const Qa={name:"loadTextures",extension:{type:J.LoadParser,priority:ai.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return on(r,q2)||Cr(r,Q2)},async load(r,t,e){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let s;i?this.config.preferWorkers&&await Xm.isImageBitmapSupported()?s=await Xm.loadImageBitmap(r):s=await tT(r):s=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=r,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const n={...t.data};n.resolution??(n.resolution=Qi(r)),i&&((a=n.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const o=new bt(s,n);return o.resource.src=r,uo(o,e,r)},unload(r){r.destroy(!0)}};nt.add(Qa);const eT=".svg",iT="image/svg+xml",rT={extension:{type:J.LoadParser,priority:ai.High},name:"loadSVG",test(r){return on(r,iT)||Cr(r,eT)},async testParse(r){return $c.test(r)},async parse(r,t,e){var n;const i=new $c(r,(n=t==null?void 0:t.data)==null?void 0:n.resourceOptions);await i.load();const s=new bt(i,{resolution:Qi(r),...t==null?void 0:t.data});return s.resource.src=t.src,uo(s,e,t.src)},async load(r,t){return(await it.ADAPTER.fetch(r)).text()},unload:Qa.unload};nt.add(rT);const sT=[".mp4",".m4v",".webm",".ogv"],nT=["video/mp4","video/webm","video/ogg"],oT={name:"loadVideo",extension:{type:J.LoadParser,priority:ai.High},config:{defaultAutoPlay:!0},test(r){return on(r,nT)||Cr(r,sT)},async load(r,t,e){var o;let i;const s=await(await it.ADAPTER.fetch(r)).blob(),n=URL.createObjectURL(s);try{const a={autoPlay:this.config.defaultAutoPlay,...(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions},h=new Im(n,a);await h.load();const l=new bt(h,{alphaMode:await fv(),resolution:Qi(r),...t==null?void 0:t.data});l.resource.src=r,i=uo(l,e,r),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(n)})}catch(a){throw URL.revokeObjectURL(n),a}return i},unload(r){r.destroy(!0)}};nt.add(oT);class aT{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,name:i,src:s,srcs:n}=t;return oi(e||i||s||n,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];Array.isArray(e)?e.forEach(s=>{const n=s.src??s.srcs,o=s.alias??s.name;let a;if(typeof o=="string"){const h=this._createBundleAssetId(t,o);i.push(h),a=[o,h]}else{const h=o.map(l=>this._createBundleAssetId(t,l));i.push(...h),a=[...o,...h]}this.add({...s,alias:a,src:n})}):Object.keys(e).forEach(s=>{const n=[s,this._createBundleAssetId(t,s)];if(typeof e[s]=="string")this.add({alias:n,src:e[s]});else if(Array.isArray(e[s]))this.add({alias:n,src:e[s]});else{const o=e[s],a=o.src??o.srcs;this.add({...o,alias:n,src:Array.isArray(a)?a:[a]})}i.push(...n)}),this._bundles[t]=i}add(t,e,i,s,n){const o=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(vt("7.2.0",`Assets.add now uses an object instead of individual parameters.
923
- Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:t,src:e,data:i,format:s,loadParser:n})):Array.isArray(t)?o.push(...t):o.push(t);let a;a=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},oi(o).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=oi(l||c).map(b=>typeof b=="string"?P2(b):Array.isArray(b)?b:[b]),m=this.getAlias(h);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(b=>{b.forEach(_=>{let x={};if(typeof _!="object"){x.src=_;for(let v=0;v<this._parsers.length;v++){const T=this._parsers[v];if(T.test(_)){x=T.parse(_);break}}}else u=_.data??u,d=_.format??d,f=_.loadParser??f,x={...x,..._};if(!m)throw new Error(`[Resolver] alias is undefined for this asset: ${x.src}`);x=this.buildResolvedAsset(x,{aliases:m,data:u,format:d,loadParser:f}),g.push(x)})}),m.forEach(b=>{this._assetMap[b]=g})})}resolveBundle(t){const e=$a(t);t=oi(t);const i={};return t.forEach(s=>{const n=this._bundles[s];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(s,h)]=l}i[s]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const s in e)i[s]=e[s].src;return i}return e.src}resolve(t){const e=$a(t);t=oi(t);const i={};return t.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s];const o=n[0],a=this._getPreferredOrder(n);a==null||a.priority.forEach(h=>{a.params[h].forEach(l=>{const c=n.filter(u=>u[h]?u[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[s]=n[0]??o}else this._resolverHash[s]=this.buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const i=t[0],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:i,data:s,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=ee.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??ee.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class hT{constructor(){this._detections=[],this._initialized=!1,this.resolver=new aT,this.loader=new G2,this.cache=cs,this._backgroundLoader=new R2(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let a=t.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const e=((n=t.texturePreference)==null?void 0:n.resolution)??1,i=typeof e=="number"?[e]:e,s=await this._detectFormats({preferredFormats:(o=t.texturePreference)==null?void 0:o.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,s,n){this.resolver.add(t,e,i,s,n)}async load(t,e){this._initialized||await this.init();const i=$a(t),s=oi(t).map(a=>{if(typeof a!="string"){const h=this.resolver.getAlias(a);return h.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,e);return i?o[s[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);const s=this.resolver.resolveBundle(t),n={},o=Object.keys(s);let a=0,h=0;const l=()=>{e==null||e(++a/h)},c=o.map(u=>{const d=s[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),i?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return cs.get(t);const e={};for(let i=0;i<t.length;i++)e[i]=cs.get(t[i]);return e}async _mapLoadToResolve(t,e){const i=Object.values(t),s=Object.keys(t);this._backgroundLoader.active=!1;const n=await this.loader.load(i,e);this._backgroundLoader.active=!0;const o={};return i.forEach((a,h)=>{const l=n[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[s[h]]=l,cs.set(c,l)}),o}async unload(t){this._initialized||await this.init();const e=oi(t).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=oi(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(s=>this._unloadFromResolved(e[s]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{cs.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,s)=>e.indexOf(i)===s),e}get detections(){return this._detections}get preferWorkers(){return Qa.config.preferWorkers}set preferWorkers(t){vt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const qa=new hT;nt.handleByList(J.LoadParser,qa.loader.parsers).handleByList(J.ResolveParser,qa.resolver.parsers).handleByList(J.CacheParser,qa.cache.parsers).handleByList(J.DetectionParser,qa.detections);const lT={extension:J.CacheParser,test:r=>Array.isArray(r)&&r.every(t=>t instanceof ot),getCacheableAssets:(r,t)=>{const e={};return r.forEach(i=>{t.forEach((s,n)=>{e[i+(n===0?"":n+1)]=s})}),e}};nt.add(lT);async function Wm(r){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(r)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const cT={extension:{type:J.DetectionParser,priority:1},test:async()=>Wm("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};nt.add(cT);const uT={extension:{type:J.DetectionParser,priority:0},test:async()=>Wm("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};nt.add(uT);const Zm=["png","jpg","jpeg"],dT={extension:{type:J.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...Zm],remove:async r=>r.filter(t=>!Zm.includes(t))};nt.add(dT);const fT="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function au(r){return fT?!1:document.createElement("video").canPlayType(r)!==""}const pT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};nt.add(pT);const mT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};nt.add(mT);const gT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};nt.add(gT);const yT={extension:J.ResolveParser,test:Qa.test,parse:r=>{var t;return{resolution:parseFloat(((t=it.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:ee.extname(r).slice(1),src:r}}};nt.add(yT);var Le=(r=>(r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r))(Le||{});const th={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let er,an;function Vm(){an={s3tc:er.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:er.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:er.getExtension("WEBGL_compressed_texture_etc"),etc1:er.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:er.getExtension("WEBGL_compressed_texture_pvrtc")||er.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:er.getExtension("WEBGL_compressed_texture_atc"),astc:er.getExtension("WEBGL_compressed_texture_astc")}}const bT={extension:{type:J.DetectionParser,priority:2},test:async()=>{const r=it.ADAPTER.createCanvas().getContext("webgl");return r?(er=r,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async r=>{an||Vm();const t=[];for(const e in an)an[e]&&t.push(e);return[...t,...r]},remove:async r=>(an||Vm(),r.filter(t=>!(t in an)))};nt.add(bT);class xT extends Aa{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,s;typeof t=="string"?(i=t,s=new Uint8Array):(i=null,s=t),super(s,e),this.origin=i,this.buffer=s?new Cc(s):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new Cc(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class us extends xT{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=us._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||us._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){const s=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;s.pixelStorei(s.UNPACK_ALIGNMENT,4);for(let n=0,o=this.levels;n<o;n++){const{levelID:a,levelWidth:h,levelHeight:l,levelBuffer:c}=this._levelBuffers[n];s.compressedTexImage2D(s.TEXTURE_2D,a,this.format,h,l,0,c)}return!0}onBlobLoaded(){this._levelBuffers=us._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,e,i,s,n,o,a){const h=new Array(i);let l=t.byteOffset,c=o,u=a,d=c+s-1&~(s-1),f=u+n-1&~(n-1),p=d*f*th[e];for(let m=0;m<i;m++)h[m]={levelID:m,levelWidth:i>1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+s-1&~(s-1),f=u+n-1&~(n-1),p=d*f*th[e];return h}}const hu=4,eh=124,_T=32,Hm=20,vT=542327876,ih={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},wT={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},rh={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},TT=1,ST=2,CT=4,ET=64,IT=512,AT=131072,MT=827611204,RT=861165636,PT=894720068,LT=808540228,GT=4,FT={[MT]:Le.COMPRESSED_RGBA_S3TC_DXT1_EXT,[RT]:Le.COMPRESSED_RGBA_S3TC_DXT3_EXT,[PT]:Le.COMPRESSED_RGBA_S3TC_DXT5_EXT},NT={70:Le.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Le.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Le.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Le.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Le.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Le.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Le.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Le.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Le.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function kT(r){const t=new Uint32Array(r);if(t[0]!==vT)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(r,0,eh/Uint32Array.BYTES_PER_ELEMENT),i=e[ih.HEIGHT],s=e[ih.WIDTH],n=e[ih.MIPMAP_COUNT],o=new Uint32Array(r,ih.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,_T/Uint32Array.BYTES_PER_ELEMENT),a=o[TT];if(a&CT){const h=o[wT.FOURCC];if(h!==LT){const _=FT[h],x=hu+eh,v=new Uint8Array(r,x);return[new us(v,{format:_,width:s,height:i,levels:n})]}const l=hu+eh,c=new Uint32Array(t.buffer,l,Hm/Uint32Array.BYTES_PER_ELEMENT),u=c[rh.DXGI_FORMAT],d=c[rh.RESOURCE_DIMENSION],f=c[rh.MISC_FLAG],p=c[rh.ARRAY_SIZE],m=NT[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===GT)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,b=hu+eh+Hm;if(p===1)g.push(new Uint8Array(r,b));else{const _=th[m];let x=0,v=s,T=i;for(let E=0;E<n;E++){const I=Math.max(1,v+3&-4),R=Math.max(1,T+3&-4),N=I*R*_;x+=N,v=v>>>1,T=T>>>1}let C=b;for(let E=0;E<p;E++)g.push(new Uint8Array(r,C,x)),C+=x}return g.map(_=>new us(_,{format:m,width:s,height:i,levels:n}))}throw a&ET?new Error("DDSParser does not support uncompressed texture data."):a&IT?new Error("DDSParser does not supported YUV uncompressed texture data."):a&AT?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&ST?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Km=[171,75,84,88,32,49,49,187,13,10,26,10],DT=67305985,hi={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},lu=64,Ym={[ht.UNSIGNED_BYTE]:1,[ht.UNSIGNED_SHORT]:2,[ht.INT]:4,[ht.UNSIGNED_INT]:4,[ht.FLOAT]:4,[ht.HALF_FLOAT]:8},OT={[V.RGBA]:4,[V.RGB]:3,[V.RG]:2,[V.RED]:1,[V.LUMINANCE]:1,[V.LUMINANCE_ALPHA]:2,[V.ALPHA]:1},BT={[ht.UNSIGNED_SHORT_4_4_4_4]:2,[ht.UNSIGNED_SHORT_5_5_5_1]:2,[ht.UNSIGNED_SHORT_5_6_5]:2};function UT(r,t,e=!1){const i=new DataView(t);if(!XT(r,i))return null;const s=i.getUint32(hi.ENDIANNESS,!0)===DT,n=i.getUint32(hi.GL_TYPE,s),o=i.getUint32(hi.GL_FORMAT,s),a=i.getUint32(hi.GL_INTERNAL_FORMAT,s),h=i.getUint32(hi.PIXEL_WIDTH,s),l=i.getUint32(hi.PIXEL_HEIGHT,s)||1,c=i.getUint32(hi.PIXEL_DEPTH,s)||1,u=i.getUint32(hi.NUMBER_OF_ARRAY_ELEMENTS,s)||1,d=i.getUint32(hi.NUMBER_OF_FACES,s),f=i.getUint32(hi.NUMBER_OF_MIPMAP_LEVELS,s),p=i.getUint32(hi.BYTES_OF_KEY_VALUE_DATA,s);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,b=h+3&-4,_=l+3&-4,x=new Array(u);let v=h*l;n===0&&(v=b*_);let T;if(n!==0?Ym[n]?T=Ym[n]*OT[o]:T=BT[n]:T=th[a],T===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const C=e?ZT(i,p,s):null;let E=v*T,I=h,R=l,N=b,F=_,P=lu+p;for(let A=0;A<f;A++){const G=i.getUint32(P,s);let D=P+4;for(let X=0;X<u;X++){let B=x[X];B||(B=x[X]=new Array(f)),B[A]={levelID:A,levelWidth:f>1||n!==0?I:N,levelHeight:f>1||n!==0?R:F,levelBuffer:new Uint8Array(t,D,E)},D+=E}P+=G+4,P=P%4!==0?P+4-P%4:P,I=I>>1||1,R=R>>1||1,N=I+m-1&~(m-1),F=R+g-1&~(g-1),E=N*F*T}return n!==0?{uncompressed:x.map(A=>{let G=A[0].levelBuffer,D=!1;return n===ht.FLOAT?G=new Float32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4):n===ht.UNSIGNED_INT?(D=!0,G=new Uint32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4)):n===ht.INT&&(D=!0,G=new Int32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4)),{resource:new Aa(G,{width:A[0].levelWidth,height:A[0].levelHeight}),type:n,format:D?WT(o):o}}),kvData:C}:{compressed:x.map(A=>new us(null,{format:a,width:h,height:l,levels:f,levelBuffers:A})),kvData:C}}function XT(r,t){for(let e=0;e<Km.length;e++)if(t.getUint8(e)!==Km[e])return console.error(`${r} is not a valid *.ktx file!`),!1;return!0}function WT(r){switch(r){case V.RGBA:return V.RGBA_INTEGER;case V.RGB:return V.RGB_INTEGER;case V.RG:return V.RG_INTEGER;case V.RED:return V.RED_INTEGER;default:return r}}function ZT(r,t,e){const i=new Map;let s=0;for(;s<t;){const n=r.getUint32(lu+s,e),o=lu+s+4,a=3-(n+3)%4;if(n===0||n>t-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&r.getUint8(o+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=new TextDecoder().decode(new Uint8Array(r.buffer,o,h)),c=new DataView(r.buffer,o+h+1,n-h-1);i.set(l,c),s+=4+n+a}return i}const VT={extension:{type:J.LoadParser,priority:ai.High},name:"loadDDS",test(r){return Cr(r,".dds")},async load(r,t,e){const i=await(await it.ADAPTER.fetch(r)).arrayBuffer(),s=kT(i).map(n=>{const o=new bt(n,{mipmap:vi.OFF,alphaMode:we.NO_PREMULTIPLIED_ALPHA,resolution:Qi(r),...t.data});return uo(o,e,r)});return s.length===1?s[0]:s},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};nt.add(VT);const HT={extension:{type:J.LoadParser,priority:ai.High},name:"loadKTX",test(r){return Cr(r,".ktx")},async load(r,t,e){const i=await(await it.ADAPTER.fetch(r)).arrayBuffer(),{compressed:s,uncompressed:n,kvData:o}=UT(r,i),a=s??n,h={mipmap:vi.OFF,alphaMode:we.NO_PREMULTIPLIED_ALPHA,resolution:Qi(r),...t.data},l=a.map(c=>{a===n&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new bt(u,h);return d.ktxKeyValueData=o,uo(d,e,r)});return l.length===1?l[0]:l},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};nt.add(HT);const KT={extension:J.ResolveParser,test:r=>{const t=ee.extname(r).slice(1);return["basis","ktx","dds"].includes(t)},parse:r=>{var e,i;const t=ee.extname(r).slice(1);if(t==="ktx"){const s=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(s.some(n=>r.endsWith(n)))return{resolution:parseFloat(((e=it.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:s.find(n=>r.endsWith(n)),src:r}}return{resolution:parseFloat(((i=it.RETINA_PREFIX.exec(r))==null?void 0:i[1])??"1"),format:t,src:r}}};nt.add(KT);const sh=new pt,YT=4,zm=class ha{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,i,s){const n=new Image;return n.src=await this.base64(t,e,i,s),n}async base64(t,e,i,s){const n=this.canvas(t,s);if(n.toBlob!==void 0)return new Promise((o,a)=>{n.toBlob(h=>{if(!h){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(h)},e,i)});if(n.toDataURL!==void 0)return n.toDataURL(e,i);if(n.convertToBlob!==void 0){const o=await n.convertToBlob({type:e,quality:i});return new Promise((a,h)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=h,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);o&&ha._flipY(i,s,n),a&&ha._unpremultiplyAlpha(i);const h=new Mv(s,n,1),l=new ImageData(new Uint8ClampedArray(i.buffer),s,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);return o&&ha._flipY(i,s,n),a&&ha._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,n=!1,o=!1,a,h=!1;t&&(t instanceof os?a=t:(a=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(sh.width=e.width,sh.height=e.height,e=sh)));const l=i.gl;if(a){if(s=a.baseTexture.resolution,e=e??a.frame,n=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===V.RGBA,!h){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else s=i.resolution,e||(e=sh,e.width=i.width/s,e.height=i.height/s),n=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*s),1),u=Math.max(Math.round(e.height*s),1),d=new Uint8Array(YT*c*u);return l.readPixels(Math.round(e.x*s),Math.round(e.y*s),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(a==null||a.destroy(!0)),{pixels:d,width:c,height:u,flipY:n,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(t,e,i){const s=e<<2,n=i>>1,o=new Uint8Array(s);for(let a=0;a<n;a++){const h=a*s,l=(i-a-1)*s;o.set(t.subarray(h,h+s)),t.copyWithin(h,l,l+s),t.set(o,l)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let i=0;i<e;i+=4){const s=t[i+3];if(s!==0){const n=255.001/s;t[i]=t[i]*n+.5,t[i+1]=t[i+1]*n+.5,t[i+2]=t[i+2]*n+.5}}}};zm.extension={name:"extract",type:J.RendererSystem};let zT=zm;nt.add(zT);const nh={build(r){const t=r.points;let e,i,s,n,o,a;if(r.type===ce.CIRC){const p=r.shape;e=p.x,i=p.y,o=a=p.radius,s=n=0}else if(r.type===ce.ELIP){const p=r.shape;e=p.x,i=p.y,o=p.width,a=p.height,s=n=0}else{const p=r.shape,m=p.width/2,g=p.height/2;e=p.x+m,i=p.y+g,o=a=Math.max(0,Math.min(p.radius,Math.min(m,g))),s=m-o,n=g-a}if(!(o>=0&&a>=0&&s>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(s?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+s,t[1]=t[3]=i+n,t[2]=t[4]=e-s,t[5]=t[7]=i-n;return}let c=0,u=h*4+(s?2:0)+2,d=u,f=l;{const p=s+o,m=n,g=e+p,b=e-p,_=i+m;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=b,n){const x=i-m;t[d++]=b,t[d++]=x,t[--f]=x,t[--f]=g}}for(let p=1;p<h;p++){const m=Math.PI/2*(p/h),g=s+Math.cos(m)*o,b=n+Math.sin(m)*a,_=e+g,x=e-g,v=i+b,T=i-b;t[c++]=_,t[c++]=v,t[--u]=v,t[--u]=x,t[d++]=x,t[d++]=T,t[--f]=T,t[--f]=_}{const p=s,m=n+a,g=e+p,b=e-p,_=i+m,x=i-m;t[c++]=g,t[c++]=_,t[--f]=x,t[--f]=g,s&&(t[c++]=b,t[c++]=_,t[--f]=x,t[--f]=b)}},triangulate(r,t){const e=r.points,i=t.points,s=t.indices;if(e.length===0)return;let n=i.length/2;const o=n;let a,h;if(r.type!==ce.RREC){const c=r.shape;a=c.x,h=c.y}else{const c=r.shape;a=c.x+c.width/2,h=c.y+c.height/2}const l=r.matrix;i.push(r.matrix?l.a*a+l.c*h+l.tx:a,r.matrix?l.b*a+l.d*h+l.ty:h),n++,i.push(e[0],e[1]);for(let c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),s.push(n++,o,n);s.push(o+1,o,n)}};function jm(r,t=!1){const e=r.length;if(e<6)return;let i=0;for(let s=0,n=r[e-2],o=r[e-1];s<e;s+=2){const a=r[s],h=r[s+1];i+=(a-n)*(h+o),n=a,o=h}if(!t&&i>0||t&&i<=0){const s=e/2;for(let n=s+s%2;n<e;n+=2){const o=e-n-2,a=e-n-1,h=n,l=n+1;[r[o],r[h]]=[r[h],r[o]],[r[a],r[l]]=[r[l],r[a]]}}}const Jm={build(r){r.points=r.shape.points.slice()},triangulate(r,t){let e=r.points;const i=r.holes,s=t.points,n=t.indices;if(e.length>=6){jm(e,!1);const o=[];for(let l=0;l<i.length;l++){const c=i[l];jm(c.points,!0),o.push(e.length/2),e=e.concat(c.points)}const a=nx(e,o,2);if(!a)return;const h=s.length/2;for(let l=0;l<a.length;l+=3)n.push(a[l]+h),n.push(a[l+1]+h),n.push(a[l+2]+h);for(let l=0;l<e.length;l++)s.push(e[l])}}},jT={build(r){const t=r.shape,e=t.x,i=t.y,s=t.width,n=t.height,o=r.points;o.length=0,s>=0&&n>=0&&o.push(e,i,e+s,i,e+s,i+n,e,i+n)},triangulate(r,t){const e=r.points,i=t.points;if(e.length===0)return;const s=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},JT={build(r){nh.build(r)},triangulate(r,t){nh.triangulate(r,t)}};var He=(r=>(r.MITER="miter",r.BEVEL="bevel",r.ROUND="round",r))(He||{}),Er=(r=>(r.BUTT="butt",r.ROUND="round",r.SQUARE="square",r))(Er||{});const hn={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,t=20){if(!this.adaptive||!r||isNaN(r))return t;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class $m{static curveTo(t,e,i,s,n,o){const a=o[o.length-2],h=o[o.length-1]-e,l=a-t,c=s-e,u=i-t,d=Math.abs(h*u-l*c);if(d<1e-8||n===0)return(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=n*Math.sqrt(f)/d,b=n*Math.sqrt(p)/d,_=g*m/f,x=b*m/p,v=g*u+b*l,T=g*c+b*h,C=l*(b+_),E=h*(b+_),I=u*(g+x),R=c*(g+x),N=Math.atan2(E-T,C-v),F=Math.atan2(R-T,I-v);return{cx:v+t,cy:T+e,radius:n,startAngle:N,endAngle:F,anticlockwise:l*c>u*h}}static arc(t,e,i,s,n,o,a,h,l){const c=a-o,u=hn._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/Ra)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,b=g%1/g;for(let _=0;_<=g;++_){const x=_+b*_,v=d+o+f*x,T=Math.cos(v),C=-Math.sin(v);l.push((p*T+m*C)*n+i,(p*-C+m*T)*n+s)}}}class $T{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class cu{static curveLength(t,e,i,s,n,o,a,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,b=0,_=0,x=0,v=t,T=e;for(let C=1;C<=10;++C)c=C/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*t+3*p*c*i+3*f*u*n+d*a,b=m*e+3*p*c*s+3*f*u*o+d*h,_=v-g,x=T-b,v=g,T=b,l+=Math.sqrt(_*_+x*x);return l}static curveTo(t,e,i,s,n,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=hn._segmentsCount(cu.curveLength(h,l,t,e,i,s,n,o));let u=0,d=0,f=0,p=0,m=0;a.push(h,l);for(let g=1,b=0;g<=c;++g)b=g/c,u=1-b,d=u*u,f=d*u,p=b*b,m=p*b,a.push(f*h+3*d*b*t+3*u*p*i+m*n,f*l+3*d*b*e+3*u*p*s+m*o)}}function Qm(r,t,e,i,s,n,o,a){const h=r-e*s,l=t-i*s,c=r+e*n,u=t+i*n;let d,f;o?(d=i,f=-e):(d=-i,f=e);const p=h+d,m=l+f,g=c+d,b=u+f;return a.push(p,m,g,b),2}function ds(r,t,e,i,s,n,o,a){const h=e-r,l=i-t;let c=Math.atan2(h,l),u=Math.atan2(s-r,n-t);a&&c<u?c+=Math.PI*2:!a&&c>u&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,b=f/g;if(d+=b,a){o.push(r,t,e,i);for(let _=1,x=d;_<g;_++,x+=b)o.push(r,t,r+Math.sin(x)*m,t+Math.cos(x)*m);o.push(r,t,s,n)}else{o.push(e,i,r,t);for(let _=1,x=d;_<g;_++,x+=b)o.push(r+Math.sin(x)*m,t+Math.cos(x)*m,r,t);o.push(s,n,r,t)}return g*2}function QT(r,t){const e=r.shape;let i=r.points||e.points.slice();const s=t.closePointEps;if(i.length===0)return;const n=r.lineStyle,o=new ct(i[0],i[1]),a=new ct(i[i.length-2],i[i.length-1]),h=e.type!==ce.POLY||e.closeStroke,l=Math.abs(o.x-a.x)<s&&Math.abs(o.y-a.y)<s;if(h){i=i.slice(),l&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));const B=(o.x+a.x)*.5,H=(a.y+o.y)*.5;i.unshift(B,H),i.push(B,H)}const c=t.points,u=i.length/2;let d=i.length;const f=c.length/2,p=n.width/2,m=p*p,g=n.miterLimit*n.miterLimit;let b=i[0],_=i[1],x=i[2],v=i[3],T=0,C=0,E=-(_-v),I=b-x,R=0,N=0,F=Math.sqrt(E*E+I*I);E/=F,I/=F,E*=p,I*=p;const P=n.alignment,A=(1-P)*2,G=P*2;h||(n.cap===Er.ROUND?d+=ds(b-E*(A-G)*.5,_-I*(A-G)*.5,b-E*A,_-I*A,b+E*G,_+I*G,c,!0)+2:n.cap===Er.SQUARE&&(d+=Qm(b,_,E,I,A,G,!0,c))),c.push(b-E*A,_-I*A,b+E*G,_+I*G);for(let B=1;B<u-1;++B){b=i[(B-1)*2],_=i[(B-1)*2+1],x=i[B*2],v=i[B*2+1],T=i[(B+1)*2],C=i[(B+1)*2+1],E=-(_-v),I=b-x,F=Math.sqrt(E*E+I*I),E/=F,I/=F,E*=p,I*=p,R=-(v-C),N=x-T,F=Math.sqrt(R*R+N*N),R/=F,N/=F,R*=p,N*=p;const H=x-b,lt=_-v,W=x-T,L=C-v,O=H*W+lt*L,U=lt*W-L*H,tt=U<0;if(Math.abs(U)<.001*Math.abs(O)){c.push(x-E*A,v-I*A,x+E*G,v+I*G),O>=0&&(n.join===He.ROUND?d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+4:d+=2,c.push(x-R*G,v-N*G,x+R*A,v+N*A));continue}const Q=(-E+b)*(-I+v)-(-E+x)*(-I+_),xt=(-R+T)*(-N+v)-(-R+x)*(-N+C),Ct=(H*xt-W*Q)/U,q=(L*Q-lt*xt)/U,Z=(Ct-x)*(Ct-x)+(q-v)*(q-v),Y=x+(Ct-x)*A,z=v+(q-v)*A,k=x-(Ct-x)*G,ut=v-(q-v)*G,gt=Math.min(H*H+lt*lt,W*W+L*L),At=tt?A:G,Ft=gt+At*At*m,Re=Z<=Ft;let Ue=n.join;if(Ue===He.MITER&&Z/m>g&&(Ue=He.BEVEL),Re)switch(Ue){case He.MITER:{c.push(Y,z,k,ut);break}case He.BEVEL:{tt?c.push(Y,z,x+E*G,v+I*G,Y,z,x+R*G,v+N*G):c.push(x-E*A,v-I*A,k,ut,x-R*A,v-N*A,k,ut),d+=2;break}case He.ROUND:{tt?(c.push(Y,z,x+E*G,v+I*G),d+=ds(x,v,x+E*G,v+I*G,x+R*G,v+N*G,c,!0)+4,c.push(Y,z,x+R*G,v+N*G)):(c.push(x-E*A,v-I*A,k,ut),d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+4,c.push(x-R*A,v-N*A,k,ut));break}}else{switch(c.push(x-E*A,v-I*A,x+E*G,v+I*G),Ue){case He.MITER:{tt?c.push(k,ut,k,ut):c.push(Y,z,Y,z),d+=2;break}case He.ROUND:{tt?d+=ds(x,v,x+E*G,v+I*G,x+R*G,v+N*G,c,!0)+2:d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+2;break}}c.push(x-R*A,v-N*A,x+R*G,v+N*G),d+=2}}b=i[(u-2)*2],_=i[(u-2)*2+1],x=i[(u-1)*2],v=i[(u-1)*2+1],E=-(_-v),I=b-x,F=Math.sqrt(E*E+I*I),E/=F,I/=F,E*=p,I*=p,c.push(x-E*A,v-I*A,x+E*G,v+I*G),h||(n.cap===Er.ROUND?d+=ds(x-E*(A-G)*.5,v-I*(A-G)*.5,x-E*A,v-I*A,x+E*G,v+I*G,c,!1)+2:n.cap===Er.SQUARE&&(d+=Qm(x,v,E,I,A,G,!1,c)));const D=t.indices,X=hn.epsilon*hn.epsilon;for(let B=f;B<d+f-2;++B)b=c[B*2],_=c[B*2+1],x=c[(B+1)*2],v=c[(B+1)*2+1],T=c[(B+2)*2],C=c[(B+2)*2+1],!(Math.abs(b*(v-C)+x*(C-_)+T*(_-v))<X)&&D.push(B,B+1,B+2)}function qT(r,t){let e=0;const i=r.shape,s=r.points||i.points,n=i.type!==ce.POLY||i.closeStroke;if(s.length===0)return;const o=t.points,a=t.indices,h=s.length/2,l=o.length/2;let c=l;for(o.push(s[0],s[1]),e=1;e<h;e++)o.push(s[e*2],s[e*2+1]),a.push(c,c+1),c++;n&&a.push(c,l)}function qm(r,t){r.lineStyle.native?qT(r,t):QT(r,t)}class uu{static curveLength(t,e,i,s,n,o){const a=t-2*i+n,h=e-2*s+o,l=2*i-2*t,c=2*s-2*e,u=4*(a*a+h*h),d=4*(a*l+h*c),f=l*l+c*c,p=2*Math.sqrt(u+d+f),m=Math.sqrt(u),g=2*u*m,b=2*Math.sqrt(f),_=d/m;return(g*p+m*d*(p-b)+(4*f*u-d*d)*Math.log((2*m+_+p)/(_+b)))/(4*g)}static curveTo(t,e,i,s,n){const o=n[n.length-2],a=n[n.length-1],h=hn._segmentsCount(uu.curveLength(o,a,t,e,i,s));let l=0,c=0;for(let u=1;u<=h;++u){const d=u/h;l=o+(t-o)*d,c=a+(e-a)*d,n.push(l+(t+(i-t)*d-l)*d,c+(e+(s-e)*d-c)*d)}}}const du={[ce.POLY]:Jm,[ce.CIRC]:nh,[ce.ELIP]:nh,[ce.RECT]:jT,[ce.RREC]:JT},tg=[],oh=[];class ah{constructor(t,e=null,i=null,s=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=s,this.type=t.type}clone(){return new ah(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const ln=new ct,eg=class Mb extends F0{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new za,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),oh.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),tg.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,s=null){const n=new ah(t,e,i,s);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new ah(t,null,null,e),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let i=0;i<e.length;++i){const s=e[i];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,ln):ln.copyFrom(t),s.shape.contains(ln.x,ln.y))){let n=!1;if(s.holes){for(let o=0;o<s.holes.length;o++)if(s.holes[o].shape.contains(ln.x,ln.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let i=null,s=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],s=i.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const l=e[h],c=l.fillStyle,u=l.lineStyle;du[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(c.visible||u.visible)&&this.processHoles(l.holes);for(let d=0;d<2;d++){const f=d===0?c:u;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,g=this.points.length/2;p.wrapMode=_i.REPEAT,d===0?this.processFill(l):this.processLine(l);const b=this.points.length/2-g;b!==0&&(i&&!this._compareStyles(s,f)&&(i.end(m,g),i=null),i||(i=tg.pop()||new $T,i.begin(f,m,g),this.batches.push(i),s=f),this.addUvs(this.points,t,f.texture,g,b,f.matrix))}}const n=this.indices.length,o=this.points.length/2;if(i&&i.end(n,o),this.batches.length===0){this.batchable=!0;return}const a=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const i=this.graphicsData[t],s=i.fillStyle,n=i.lineStyle;if(s&&!s.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,i=t.length;e<i;e++){const s=t[e];for(let n=0;n<s.size;n++){const o=s.start+n;this.indicesUint16[o]=this.indicesUint16[o]-s.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<Mb.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++bt._globalBatch;for(let u=0;u<this.drawCalls.length;u++)this.drawCalls[u].texArray.clear(),oh.push(this.drawCalls[u]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let s=oh.pop();s||(s=new Fc,s.texArray=new Xc),s.texArray.count=0,s.start=0,s.size=0,s.type=xi.TRIANGLES;let n=0,o=null,a=0,h=!1,l=xi.TRIANGLES,c=0;this.drawCalls.push(s);for(let u=0;u<this.batches.length;u++){const d=this.batches[u],f=8,p=d.style,m=p.texture.baseTexture;h!==!!p.native&&(h=!!p.native,l=h?xi.LINES:xi.TRIANGLES,o=null,n=f,t++),o!==m&&(o=m,m._batchEnabled!==t&&(n===f&&(t++,n=0,s.size>0&&(s=oh.pop(),s||(s=new Fc,s.texArray=new Xc),this.drawCalls.push(s)),s.start=c,s.size=0,s.texArray.count=0,s.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=_i.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=d.size,c+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}bt._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,s=this.textureIds,n=new ArrayBuffer(t.length*3*4),o=new Float32Array(n),a=new Uint32Array(n);let h=0;for(let l=0;l<t.length/2;l++)o[h++]=t[l*2],o[h++]=t[l*2+1],o[h++]=e[l*2],o[h++]=e[l*2+1],a[h++]=i[l],o[h++]=s[l];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Jm.triangulate(t,this):du[t.type].triangulate(t,this)}processLine(t){qm(t,this);for(let e=0;e<t.holes.length;e++)qm(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];du[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let i=0;i<t.length/2;i++){const s=t[i*2],n=t[i*2+1];t[i*2]=e.a*s+e.c*n+e.tx,t[i*2+1]=e.b*s+e.d*n+e.ty}}addColors(t,e,i,s,n=0){const o=Lt.shared.setValue(e).toLittleEndianNumber(),a=Lt.shared.setValue(o).toPremultiplied(i);t.length=Math.max(t.length,n+s);for(let h=0;h<s;h++)t[n+h]=a}addTextureIds(t,e,i,s=0){t.length=Math.max(t.length,s+i);for(let n=0;n<i;n++)t[s+n]=e}addUvs(t,e,i,s,n,o=null){let a=0;const h=e.length,l=i.frame;for(;a<n;){let u=t[(s+a)*2],d=t[(s+a)*2+1];if(o){const f=o.a*u+o.c*d+o.tx;d=o.b*u+o.d*d+o.ty,u=f}a++,e.push(u/l.width,d/l.height)}const c=i.baseTexture;(l.width<c.width||l.height<c.height)&&this.adjustUvs(e,i,h,n)}adjustUvs(t,e,i,s){const n=e.baseTexture,o=1e-6,a=i+s*2,h=e.frame,l=h.width/n.width,c=h.height/n.height;let u=h.x/h.width,d=h.y/h.height,f=Math.floor(t[i]+o),p=Math.floor(t[i+1]+o);for(let m=i+2;m<a;m+=2)f=Math.min(f,Math.floor(t[m]+o)),p=Math.min(p,Math.floor(t[m+1]+o));u-=f,d-=p;for(let m=i;m<a;m+=2)t[m]=(t[m]+u)*l,t[m+1]=(t[m+1]+d)*c}};eg.BATCHABLE_SIZE=100;let tS=eg;class hh{constructor(){this.color=16777215,this.alpha=1,this.texture=ot.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new hh;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=ot.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class fu extends hh{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Er.BUTT,this.join=He.MITER,this.miterLimit=10}clone(){const t=new fu;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Er.BUTT,this.join=He.MITER,this.miterLimit=10}}const pu={},mu=class wl extends Tt{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new hh,this._lineStyle=new fu,this._matrix=null,this._holeMode=!1,this.state=Ai.for2d(),this._geometry=t||new tS,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Lt(16777215),this.blendMode=dt.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new wl(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,i,s=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:i,alignment:s,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:ot.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Er.BUTT,join:He.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new ts,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ts,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],n=i[i.length-1];return(s!==t||n!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),uu.curveTo(t,e,i,s,n),this}bezierCurveTo(t,e,i,s,n,o){return this._initCurve(),cu.curveTo(t,e,i,s,n,o,this.currentPath.points),this}arcTo(t,e,i,s,n){this._initCurve(t,e);const o=this.currentPath.points,a=$m.curveTo(t,e,i,s,n,o);if(a){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(h,l,c,u,d,f)}return this}arc(t,e,i,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=Ra:o&&s<=n&&(s+=Ra),n-s===0)return this;const a=t+Math.cos(s)*i,h=e+Math.sin(s)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u<l&&d<l||c.push(a,h)}else this.moveTo(a,h),c=this.currentPath.points;return $m.arc(a,h,t,e,i,s,n,o,c),this}beginFill(t=0,e){return this.beginTextureFill({texture:ot.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Lt.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:ot.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,s){return this.drawShape(new pt(t,e,i,s))}drawRoundedRect(t,e,i,s,n){return this.drawShape(new Fa(t,e,i,s,n))}drawCircle(t,e,i){return this.drawShape(new La(t,e,i))}drawEllipse(t,e,i,s){return this.drawShape(new Ga(t,e,i,s))}drawPolygon(...t){let e,i=!0;const s=t[0];s.points?(i=s.closeStroke,e=s.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new ts(e);return n.closeStroke=i,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===ce.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let s=0;s<i;s++){const n=t.batches[s],o=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),h=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),c={vertexData:a,blendMode:e,indices:l,uvs:h,_batchRGB:Lt.shared.setValue(o).toRgbArray(),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[s]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,i=this.batches.length;e<i;e++){const s=this.batches[e];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}}_renderDirect(t){const e=this._resolveDirectShader(t),i=this._geometry,s=this.worldAlpha,n=e.uniforms,o=i.drawCalls;n.translationMatrix=this.transform.worldTransform,Lt.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let a=0,h=o.length;a<h;a++)this._renderDrawCallDirect(t,i.drawCalls[a])}_renderDrawCallDirect(t,e){const{texArray:i,type:s,size:n,start:o}=e,a=i.count;for(let h=0;h<a;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(s,n,o)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!pu[i]){const{maxTextures:s}=t.plugins[i],n=new Int32Array(s);for(let h=0;h<s;h++)n[h]=h;const o={tint:new Float32Array([1,1,1,1]),translationMatrix:new Gt,default:si.from({uSamplers:n},!0)},a=t.plugins[i]._shader.program;pu[i]=new Mi(a,o)}e=pu[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:s,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,i,s,n)}containsPoint(t){return this.worldTransform.applyInverse(t,wl._TEMP_POINT),this._geometry.containsPoint(wl._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Lt.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this._geometry.points,c=this.vertexData;let u=0;for(let d=0;d<l.length;d+=2){const f=l[d],p=l[d+1];c[u++]=i*f+n*p+a,c[u++]=o*p+s*f+h}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};mu.curves=hn,mu._TEMP_POINT=new ct;let Ir=mu;class eS{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const gu=new ct,ig=new ts,rg=class Rb extends Tt{constructor(t,e,i,s=xi.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=i||Ai.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=it.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(t){const e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===xi.TRIANGLES&&e.length<Rb.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(t){const e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;const s=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[s]),t.plugins[s].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,i=t._updateID;if(i===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,c=s.ty,u=this.vertexData;for(let d=0;d<u.length/2;d++){const f=e[d*2],p=e[d*2+1];u[d*2]=n*f+a*p+l,u[d*2+1]=o*f+h*p+c}if(this._roundPixels){const d=it.RESOLUTION;for(let f=0;f<u.length;++f)u[f]=Math.round(u[f]*d)/d}this.vertexDirty=i}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new eS(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,gu);const e=this.geometry.getBuffer("aVertexPosition").data,i=ig.points,s=this.geometry.getIndex().data,n=s.length,o=this.drawMode===4?3:1;for(let a=0;a+2<n;a+=o){const h=s[a]*2,l=s[a+1]*2,c=s[a+2]*2;if(i[0]=e[h],i[1]=e[h+1],i[2]=e[l],i[3]=e[l+1],i[4]=e[c],i[5]=e[c+1],ig.contains(gu.x,gu.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};rg.BATCHABLE_SIZE=100;let yu=rg;class sg extends wr{constructor(t,e,i){super();const s=new Kt(t),n=new Kt(e,!0),o=new Kt(i,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,ht.FLOAT).addAttribute("aTextureCoord",n,2,!1,ht.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var iS=`varying vec2 vTextureCoord;
923
+ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:t,src:e,data:i,format:s,loadParser:n})):Array.isArray(t)?o.push(...t):o.push(t);let a;a=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},oi(o).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=oi(l||c).map(b=>typeof b=="string"?P2(b):Array.isArray(b)?b:[b]),m=this.getAlias(h);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(b=>{b.forEach(_=>{let x={};if(typeof _!="object"){x.src=_;for(let v=0;v<this._parsers.length;v++){const T=this._parsers[v];if(T.test(_)){x=T.parse(_);break}}}else u=_.data??u,d=_.format??d,f=_.loadParser??f,x={...x,..._};if(!m)throw new Error(`[Resolver] alias is undefined for this asset: ${x.src}`);x=this.buildResolvedAsset(x,{aliases:m,data:u,format:d,loadParser:f}),g.push(x)})}),m.forEach(b=>{this._assetMap[b]=g})})}resolveBundle(t){const e=$a(t);t=oi(t);const i={};return t.forEach(s=>{const n=this._bundles[s];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(s,h)]=l}i[s]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const s in e)i[s]=e[s].src;return i}return e.src}resolve(t){const e=$a(t);t=oi(t);const i={};return t.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s];const o=n[0],a=this._getPreferredOrder(n);a==null||a.priority.forEach(h=>{a.params[h].forEach(l=>{const c=n.filter(u=>u[h]?u[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[s]=n[0]??o}else this._resolverHash[s]=this.buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const i=t[0],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:i,data:s,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=ee.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??ee.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class hT{constructor(){this._detections=[],this._initialized=!1,this.resolver=new aT,this.loader=new G2,this.cache=cs,this._backgroundLoader=new R2(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let a=t.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const e=((n=t.texturePreference)==null?void 0:n.resolution)??1,i=typeof e=="number"?[e]:e,s=await this._detectFormats({preferredFormats:(o=t.texturePreference)==null?void 0:o.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,s,n){this.resolver.add(t,e,i,s,n)}async load(t,e){this._initialized||await this.init();const i=$a(t),s=oi(t).map(a=>{if(typeof a!="string"){const h=this.resolver.getAlias(a);return h.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,e);return i?o[s[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);const s=this.resolver.resolveBundle(t),n={},o=Object.keys(s);let a=0,h=0;const l=()=>{e==null||e(++a/h)},c=o.map(u=>{const d=s[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),i?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return cs.get(t);const e={};for(let i=0;i<t.length;i++)e[i]=cs.get(t[i]);return e}async _mapLoadToResolve(t,e){const i=Object.values(t),s=Object.keys(t);this._backgroundLoader.active=!1;const n=await this.loader.load(i,e);this._backgroundLoader.active=!0;const o={};return i.forEach((a,h)=>{const l=n[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[s[h]]=l,cs.set(c,l)}),o}async unload(t){this._initialized||await this.init();const e=oi(t).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=oi(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(s=>this._unloadFromResolved(e[s]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{cs.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,s)=>e.indexOf(i)===s),e}get detections(){return this._detections}get preferWorkers(){return Qa.config.preferWorkers}set preferWorkers(t){vt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const qa=new hT;nt.handleByList(J.LoadParser,qa.loader.parsers).handleByList(J.ResolveParser,qa.resolver.parsers).handleByList(J.CacheParser,qa.cache.parsers).handleByList(J.DetectionParser,qa.detections);const lT={extension:J.CacheParser,test:r=>Array.isArray(r)&&r.every(t=>t instanceof ot),getCacheableAssets:(r,t)=>{const e={};return r.forEach(i=>{t.forEach((s,n)=>{e[i+(n===0?"":n+1)]=s})}),e}};nt.add(lT);async function Wm(r){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(r)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const cT={extension:{type:J.DetectionParser,priority:1},test:async()=>Wm("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};nt.add(cT);const uT={extension:{type:J.DetectionParser,priority:0},test:async()=>Wm("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};nt.add(uT);const Zm=["png","jpg","jpeg"],dT={extension:{type:J.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...Zm],remove:async r=>r.filter(t=>!Zm.includes(t))};nt.add(dT);const fT="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function au(r){return fT?!1:document.createElement("video").canPlayType(r)!==""}const pT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};nt.add(pT);const mT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};nt.add(mT);const gT={extension:{type:J.DetectionParser,priority:0},test:async()=>au("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};nt.add(gT);const yT={extension:J.ResolveParser,test:Qa.test,parse:r=>{var t;return{resolution:parseFloat(((t=it.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:ee.extname(r).slice(1),src:r}}};nt.add(yT);var Ge=(r=>(r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r))(Ge||{});const th={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let er,an;function Vm(){an={s3tc:er.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:er.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:er.getExtension("WEBGL_compressed_texture_etc"),etc1:er.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:er.getExtension("WEBGL_compressed_texture_pvrtc")||er.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:er.getExtension("WEBGL_compressed_texture_atc"),astc:er.getExtension("WEBGL_compressed_texture_astc")}}const bT={extension:{type:J.DetectionParser,priority:2},test:async()=>{const r=it.ADAPTER.createCanvas().getContext("webgl");return r?(er=r,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async r=>{an||Vm();const t=[];for(const e in an)an[e]&&t.push(e);return[...t,...r]},remove:async r=>(an||Vm(),r.filter(t=>!(t in an)))};nt.add(bT);class xT extends Aa{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,s;typeof t=="string"?(i=t,s=new Uint8Array):(i=null,s=t),super(s,e),this.origin=i,this.buffer=s?new Cc(s):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new Cc(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class us extends xT{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=us._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||us._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){const s=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;s.pixelStorei(s.UNPACK_ALIGNMENT,4);for(let n=0,o=this.levels;n<o;n++){const{levelID:a,levelWidth:h,levelHeight:l,levelBuffer:c}=this._levelBuffers[n];s.compressedTexImage2D(s.TEXTURE_2D,a,this.format,h,l,0,c)}return!0}onBlobLoaded(){this._levelBuffers=us._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,e,i,s,n,o,a){const h=new Array(i);let l=t.byteOffset,c=o,u=a,d=c+s-1&~(s-1),f=u+n-1&~(n-1),p=d*f*th[e];for(let m=0;m<i;m++)h[m]={levelID:m,levelWidth:i>1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+s-1&~(s-1),f=u+n-1&~(n-1),p=d*f*th[e];return h}}const hu=4,eh=124,_T=32,Hm=20,vT=542327876,ih={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},wT={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},rh={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},TT=1,ST=2,CT=4,ET=64,IT=512,AT=131072,MT=827611204,RT=861165636,PT=894720068,LT=808540228,GT=4,FT={[MT]:Ge.COMPRESSED_RGBA_S3TC_DXT1_EXT,[RT]:Ge.COMPRESSED_RGBA_S3TC_DXT3_EXT,[PT]:Ge.COMPRESSED_RGBA_S3TC_DXT5_EXT},NT={70:Ge.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Ge.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Ge.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Ge.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Ge.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Ge.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Ge.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Ge.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Ge.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function kT(r){const t=new Uint32Array(r);if(t[0]!==vT)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(r,0,eh/Uint32Array.BYTES_PER_ELEMENT),i=e[ih.HEIGHT],s=e[ih.WIDTH],n=e[ih.MIPMAP_COUNT],o=new Uint32Array(r,ih.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,_T/Uint32Array.BYTES_PER_ELEMENT),a=o[TT];if(a&CT){const h=o[wT.FOURCC];if(h!==LT){const _=FT[h],x=hu+eh,v=new Uint8Array(r,x);return[new us(v,{format:_,width:s,height:i,levels:n})]}const l=hu+eh,c=new Uint32Array(t.buffer,l,Hm/Uint32Array.BYTES_PER_ELEMENT),u=c[rh.DXGI_FORMAT],d=c[rh.RESOURCE_DIMENSION],f=c[rh.MISC_FLAG],p=c[rh.ARRAY_SIZE],m=NT[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===GT)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,b=hu+eh+Hm;if(p===1)g.push(new Uint8Array(r,b));else{const _=th[m];let x=0,v=s,T=i;for(let E=0;E<n;E++){const I=Math.max(1,v+3&-4),R=Math.max(1,T+3&-4),N=I*R*_;x+=N,v=v>>>1,T=T>>>1}let C=b;for(let E=0;E<p;E++)g.push(new Uint8Array(r,C,x)),C+=x}return g.map(_=>new us(_,{format:m,width:s,height:i,levels:n}))}throw a&ET?new Error("DDSParser does not support uncompressed texture data."):a&IT?new Error("DDSParser does not supported YUV uncompressed texture data."):a&AT?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&ST?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Km=[171,75,84,88,32,49,49,187,13,10,26,10],DT=67305985,hi={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},lu=64,Ym={[ht.UNSIGNED_BYTE]:1,[ht.UNSIGNED_SHORT]:2,[ht.INT]:4,[ht.UNSIGNED_INT]:4,[ht.FLOAT]:4,[ht.HALF_FLOAT]:8},OT={[V.RGBA]:4,[V.RGB]:3,[V.RG]:2,[V.RED]:1,[V.LUMINANCE]:1,[V.LUMINANCE_ALPHA]:2,[V.ALPHA]:1},BT={[ht.UNSIGNED_SHORT_4_4_4_4]:2,[ht.UNSIGNED_SHORT_5_5_5_1]:2,[ht.UNSIGNED_SHORT_5_6_5]:2};function UT(r,t,e=!1){const i=new DataView(t);if(!XT(r,i))return null;const s=i.getUint32(hi.ENDIANNESS,!0)===DT,n=i.getUint32(hi.GL_TYPE,s),o=i.getUint32(hi.GL_FORMAT,s),a=i.getUint32(hi.GL_INTERNAL_FORMAT,s),h=i.getUint32(hi.PIXEL_WIDTH,s),l=i.getUint32(hi.PIXEL_HEIGHT,s)||1,c=i.getUint32(hi.PIXEL_DEPTH,s)||1,u=i.getUint32(hi.NUMBER_OF_ARRAY_ELEMENTS,s)||1,d=i.getUint32(hi.NUMBER_OF_FACES,s),f=i.getUint32(hi.NUMBER_OF_MIPMAP_LEVELS,s),p=i.getUint32(hi.BYTES_OF_KEY_VALUE_DATA,s);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,b=h+3&-4,_=l+3&-4,x=new Array(u);let v=h*l;n===0&&(v=b*_);let T;if(n!==0?Ym[n]?T=Ym[n]*OT[o]:T=BT[n]:T=th[a],T===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const C=e?ZT(i,p,s):null;let E=v*T,I=h,R=l,N=b,F=_,P=lu+p;for(let A=0;A<f;A++){const G=i.getUint32(P,s);let D=P+4;for(let X=0;X<u;X++){let B=x[X];B||(B=x[X]=new Array(f)),B[A]={levelID:A,levelWidth:f>1||n!==0?I:N,levelHeight:f>1||n!==0?R:F,levelBuffer:new Uint8Array(t,D,E)},D+=E}P+=G+4,P=P%4!==0?P+4-P%4:P,I=I>>1||1,R=R>>1||1,N=I+m-1&~(m-1),F=R+g-1&~(g-1),E=N*F*T}return n!==0?{uncompressed:x.map(A=>{let G=A[0].levelBuffer,D=!1;return n===ht.FLOAT?G=new Float32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4):n===ht.UNSIGNED_INT?(D=!0,G=new Uint32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4)):n===ht.INT&&(D=!0,G=new Int32Array(A[0].levelBuffer.buffer,A[0].levelBuffer.byteOffset,A[0].levelBuffer.byteLength/4)),{resource:new Aa(G,{width:A[0].levelWidth,height:A[0].levelHeight}),type:n,format:D?WT(o):o}}),kvData:C}:{compressed:x.map(A=>new us(null,{format:a,width:h,height:l,levels:f,levelBuffers:A})),kvData:C}}function XT(r,t){for(let e=0;e<Km.length;e++)if(t.getUint8(e)!==Km[e])return console.error(`${r} is not a valid *.ktx file!`),!1;return!0}function WT(r){switch(r){case V.RGBA:return V.RGBA_INTEGER;case V.RGB:return V.RGB_INTEGER;case V.RG:return V.RG_INTEGER;case V.RED:return V.RED_INTEGER;default:return r}}function ZT(r,t,e){const i=new Map;let s=0;for(;s<t;){const n=r.getUint32(lu+s,e),o=lu+s+4,a=3-(n+3)%4;if(n===0||n>t-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&r.getUint8(o+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=new TextDecoder().decode(new Uint8Array(r.buffer,o,h)),c=new DataView(r.buffer,o+h+1,n-h-1);i.set(l,c),s+=4+n+a}return i}const VT={extension:{type:J.LoadParser,priority:ai.High},name:"loadDDS",test(r){return Cr(r,".dds")},async load(r,t,e){const i=await(await it.ADAPTER.fetch(r)).arrayBuffer(),s=kT(i).map(n=>{const o=new bt(n,{mipmap:vi.OFF,alphaMode:we.NO_PREMULTIPLIED_ALPHA,resolution:Qi(r),...t.data});return uo(o,e,r)});return s.length===1?s[0]:s},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};nt.add(VT);const HT={extension:{type:J.LoadParser,priority:ai.High},name:"loadKTX",test(r){return Cr(r,".ktx")},async load(r,t,e){const i=await(await it.ADAPTER.fetch(r)).arrayBuffer(),{compressed:s,uncompressed:n,kvData:o}=UT(r,i),a=s??n,h={mipmap:vi.OFF,alphaMode:we.NO_PREMULTIPLIED_ALPHA,resolution:Qi(r),...t.data},l=a.map(c=>{a===n&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new bt(u,h);return d.ktxKeyValueData=o,uo(d,e,r)});return l.length===1?l[0]:l},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};nt.add(HT);const KT={extension:J.ResolveParser,test:r=>{const t=ee.extname(r).slice(1);return["basis","ktx","dds"].includes(t)},parse:r=>{var e,i;const t=ee.extname(r).slice(1);if(t==="ktx"){const s=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(s.some(n=>r.endsWith(n)))return{resolution:parseFloat(((e=it.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:s.find(n=>r.endsWith(n)),src:r}}return{resolution:parseFloat(((i=it.RETINA_PREFIX.exec(r))==null?void 0:i[1])??"1"),format:t,src:r}}};nt.add(KT);const sh=new pt,YT=4,zm=class ha{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,i,s){const n=new Image;return n.src=await this.base64(t,e,i,s),n}async base64(t,e,i,s){const n=this.canvas(t,s);if(n.toBlob!==void 0)return new Promise((o,a)=>{n.toBlob(h=>{if(!h){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(h)},e,i)});if(n.toDataURL!==void 0)return n.toDataURL(e,i);if(n.convertToBlob!==void 0){const o=await n.convertToBlob({type:e,quality:i});return new Promise((a,h)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=h,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);o&&ha._flipY(i,s,n),a&&ha._unpremultiplyAlpha(i);const h=new Mv(s,n,1),l=new ImageData(new Uint8ClampedArray(i.buffer),s,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);return o&&ha._flipY(i,s,n),a&&ha._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,n=!1,o=!1,a,h=!1;t&&(t instanceof os?a=t:(a=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(sh.width=e.width,sh.height=e.height,e=sh)));const l=i.gl;if(a){if(s=a.baseTexture.resolution,e=e??a.frame,n=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===V.RGBA,!h){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else s=i.resolution,e||(e=sh,e.width=i.width/s,e.height=i.height/s),n=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*s),1),u=Math.max(Math.round(e.height*s),1),d=new Uint8Array(YT*c*u);return l.readPixels(Math.round(e.x*s),Math.round(e.y*s),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(a==null||a.destroy(!0)),{pixels:d,width:c,height:u,flipY:n,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(t,e,i){const s=e<<2,n=i>>1,o=new Uint8Array(s);for(let a=0;a<n;a++){const h=a*s,l=(i-a-1)*s;o.set(t.subarray(h,h+s)),t.copyWithin(h,l,l+s),t.set(o,l)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let i=0;i<e;i+=4){const s=t[i+3];if(s!==0){const n=255.001/s;t[i]=t[i]*n+.5,t[i+1]=t[i+1]*n+.5,t[i+2]=t[i+2]*n+.5}}}};zm.extension={name:"extract",type:J.RendererSystem};let zT=zm;nt.add(zT);const nh={build(r){const t=r.points;let e,i,s,n,o,a;if(r.type===ce.CIRC){const p=r.shape;e=p.x,i=p.y,o=a=p.radius,s=n=0}else if(r.type===ce.ELIP){const p=r.shape;e=p.x,i=p.y,o=p.width,a=p.height,s=n=0}else{const p=r.shape,m=p.width/2,g=p.height/2;e=p.x+m,i=p.y+g,o=a=Math.max(0,Math.min(p.radius,Math.min(m,g))),s=m-o,n=g-a}if(!(o>=0&&a>=0&&s>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(s?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+s,t[1]=t[3]=i+n,t[2]=t[4]=e-s,t[5]=t[7]=i-n;return}let c=0,u=h*4+(s?2:0)+2,d=u,f=l;{const p=s+o,m=n,g=e+p,b=e-p,_=i+m;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=b,n){const x=i-m;t[d++]=b,t[d++]=x,t[--f]=x,t[--f]=g}}for(let p=1;p<h;p++){const m=Math.PI/2*(p/h),g=s+Math.cos(m)*o,b=n+Math.sin(m)*a,_=e+g,x=e-g,v=i+b,T=i-b;t[c++]=_,t[c++]=v,t[--u]=v,t[--u]=x,t[d++]=x,t[d++]=T,t[--f]=T,t[--f]=_}{const p=s,m=n+a,g=e+p,b=e-p,_=i+m,x=i-m;t[c++]=g,t[c++]=_,t[--f]=x,t[--f]=g,s&&(t[c++]=b,t[c++]=_,t[--f]=x,t[--f]=b)}},triangulate(r,t){const e=r.points,i=t.points,s=t.indices;if(e.length===0)return;let n=i.length/2;const o=n;let a,h;if(r.type!==ce.RREC){const c=r.shape;a=c.x,h=c.y}else{const c=r.shape;a=c.x+c.width/2,h=c.y+c.height/2}const l=r.matrix;i.push(r.matrix?l.a*a+l.c*h+l.tx:a,r.matrix?l.b*a+l.d*h+l.ty:h),n++,i.push(e[0],e[1]);for(let c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),s.push(n++,o,n);s.push(o+1,o,n)}};function jm(r,t=!1){const e=r.length;if(e<6)return;let i=0;for(let s=0,n=r[e-2],o=r[e-1];s<e;s+=2){const a=r[s],h=r[s+1];i+=(a-n)*(h+o),n=a,o=h}if(!t&&i>0||t&&i<=0){const s=e/2;for(let n=s+s%2;n<e;n+=2){const o=e-n-2,a=e-n-1,h=n,l=n+1;[r[o],r[h]]=[r[h],r[o]],[r[a],r[l]]=[r[l],r[a]]}}}const Jm={build(r){r.points=r.shape.points.slice()},triangulate(r,t){let e=r.points;const i=r.holes,s=t.points,n=t.indices;if(e.length>=6){jm(e,!1);const o=[];for(let l=0;l<i.length;l++){const c=i[l];jm(c.points,!0),o.push(e.length/2),e=e.concat(c.points)}const a=nx(e,o,2);if(!a)return;const h=s.length/2;for(let l=0;l<a.length;l+=3)n.push(a[l]+h),n.push(a[l+1]+h),n.push(a[l+2]+h);for(let l=0;l<e.length;l++)s.push(e[l])}}},jT={build(r){const t=r.shape,e=t.x,i=t.y,s=t.width,n=t.height,o=r.points;o.length=0,s>=0&&n>=0&&o.push(e,i,e+s,i,e+s,i+n,e,i+n)},triangulate(r,t){const e=r.points,i=t.points;if(e.length===0)return;const s=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},JT={build(r){nh.build(r)},triangulate(r,t){nh.triangulate(r,t)}};var He=(r=>(r.MITER="miter",r.BEVEL="bevel",r.ROUND="round",r))(He||{}),Er=(r=>(r.BUTT="butt",r.ROUND="round",r.SQUARE="square",r))(Er||{});const hn={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,t=20){if(!this.adaptive||!r||isNaN(r))return t;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class $m{static curveTo(t,e,i,s,n,o){const a=o[o.length-2],h=o[o.length-1]-e,l=a-t,c=s-e,u=i-t,d=Math.abs(h*u-l*c);if(d<1e-8||n===0)return(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=n*Math.sqrt(f)/d,b=n*Math.sqrt(p)/d,_=g*m/f,x=b*m/p,v=g*u+b*l,T=g*c+b*h,C=l*(b+_),E=h*(b+_),I=u*(g+x),R=c*(g+x),N=Math.atan2(E-T,C-v),F=Math.atan2(R-T,I-v);return{cx:v+t,cy:T+e,radius:n,startAngle:N,endAngle:F,anticlockwise:l*c>u*h}}static arc(t,e,i,s,n,o,a,h,l){const c=a-o,u=hn._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/Ra)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,b=g%1/g;for(let _=0;_<=g;++_){const x=_+b*_,v=d+o+f*x,T=Math.cos(v),C=-Math.sin(v);l.push((p*T+m*C)*n+i,(p*-C+m*T)*n+s)}}}class $T{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class cu{static curveLength(t,e,i,s,n,o,a,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,b=0,_=0,x=0,v=t,T=e;for(let C=1;C<=10;++C)c=C/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*t+3*p*c*i+3*f*u*n+d*a,b=m*e+3*p*c*s+3*f*u*o+d*h,_=v-g,x=T-b,v=g,T=b,l+=Math.sqrt(_*_+x*x);return l}static curveTo(t,e,i,s,n,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=hn._segmentsCount(cu.curveLength(h,l,t,e,i,s,n,o));let u=0,d=0,f=0,p=0,m=0;a.push(h,l);for(let g=1,b=0;g<=c;++g)b=g/c,u=1-b,d=u*u,f=d*u,p=b*b,m=p*b,a.push(f*h+3*d*b*t+3*u*p*i+m*n,f*l+3*d*b*e+3*u*p*s+m*o)}}function Qm(r,t,e,i,s,n,o,a){const h=r-e*s,l=t-i*s,c=r+e*n,u=t+i*n;let d,f;o?(d=i,f=-e):(d=-i,f=e);const p=h+d,m=l+f,g=c+d,b=u+f;return a.push(p,m,g,b),2}function ds(r,t,e,i,s,n,o,a){const h=e-r,l=i-t;let c=Math.atan2(h,l),u=Math.atan2(s-r,n-t);a&&c<u?c+=Math.PI*2:!a&&c>u&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,b=f/g;if(d+=b,a){o.push(r,t,e,i);for(let _=1,x=d;_<g;_++,x+=b)o.push(r,t,r+Math.sin(x)*m,t+Math.cos(x)*m);o.push(r,t,s,n)}else{o.push(e,i,r,t);for(let _=1,x=d;_<g;_++,x+=b)o.push(r+Math.sin(x)*m,t+Math.cos(x)*m,r,t);o.push(s,n,r,t)}return g*2}function QT(r,t){const e=r.shape;let i=r.points||e.points.slice();const s=t.closePointEps;if(i.length===0)return;const n=r.lineStyle,o=new ct(i[0],i[1]),a=new ct(i[i.length-2],i[i.length-1]),h=e.type!==ce.POLY||e.closeStroke,l=Math.abs(o.x-a.x)<s&&Math.abs(o.y-a.y)<s;if(h){i=i.slice(),l&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));const B=(o.x+a.x)*.5,H=(a.y+o.y)*.5;i.unshift(B,H),i.push(B,H)}const c=t.points,u=i.length/2;let d=i.length;const f=c.length/2,p=n.width/2,m=p*p,g=n.miterLimit*n.miterLimit;let b=i[0],_=i[1],x=i[2],v=i[3],T=0,C=0,E=-(_-v),I=b-x,R=0,N=0,F=Math.sqrt(E*E+I*I);E/=F,I/=F,E*=p,I*=p;const P=n.alignment,A=(1-P)*2,G=P*2;h||(n.cap===Er.ROUND?d+=ds(b-E*(A-G)*.5,_-I*(A-G)*.5,b-E*A,_-I*A,b+E*G,_+I*G,c,!0)+2:n.cap===Er.SQUARE&&(d+=Qm(b,_,E,I,A,G,!0,c))),c.push(b-E*A,_-I*A,b+E*G,_+I*G);for(let B=1;B<u-1;++B){b=i[(B-1)*2],_=i[(B-1)*2+1],x=i[B*2],v=i[B*2+1],T=i[(B+1)*2],C=i[(B+1)*2+1],E=-(_-v),I=b-x,F=Math.sqrt(E*E+I*I),E/=F,I/=F,E*=p,I*=p,R=-(v-C),N=x-T,F=Math.sqrt(R*R+N*N),R/=F,N/=F,R*=p,N*=p;const H=x-b,lt=_-v,W=x-T,L=C-v,O=H*W+lt*L,U=lt*W-L*H,tt=U<0;if(Math.abs(U)<.001*Math.abs(O)){c.push(x-E*A,v-I*A,x+E*G,v+I*G),O>=0&&(n.join===He.ROUND?d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+4:d+=2,c.push(x-R*G,v-N*G,x+R*A,v+N*A));continue}const Q=(-E+b)*(-I+v)-(-E+x)*(-I+_),xt=(-R+T)*(-N+v)-(-R+x)*(-N+C),Ct=(H*xt-W*Q)/U,q=(L*Q-lt*xt)/U,Z=(Ct-x)*(Ct-x)+(q-v)*(q-v),Y=x+(Ct-x)*A,z=v+(q-v)*A,k=x-(Ct-x)*G,ut=v-(q-v)*G,gt=Math.min(H*H+lt*lt,W*W+L*L),At=tt?A:G,Ft=gt+At*At*m,Pe=Z<=Ft;let Ue=n.join;if(Ue===He.MITER&&Z/m>g&&(Ue=He.BEVEL),Pe)switch(Ue){case He.MITER:{c.push(Y,z,k,ut);break}case He.BEVEL:{tt?c.push(Y,z,x+E*G,v+I*G,Y,z,x+R*G,v+N*G):c.push(x-E*A,v-I*A,k,ut,x-R*A,v-N*A,k,ut),d+=2;break}case He.ROUND:{tt?(c.push(Y,z,x+E*G,v+I*G),d+=ds(x,v,x+E*G,v+I*G,x+R*G,v+N*G,c,!0)+4,c.push(Y,z,x+R*G,v+N*G)):(c.push(x-E*A,v-I*A,k,ut),d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+4,c.push(x-R*A,v-N*A,k,ut));break}}else{switch(c.push(x-E*A,v-I*A,x+E*G,v+I*G),Ue){case He.MITER:{tt?c.push(k,ut,k,ut):c.push(Y,z,Y,z),d+=2;break}case He.ROUND:{tt?d+=ds(x,v,x+E*G,v+I*G,x+R*G,v+N*G,c,!0)+2:d+=ds(x,v,x-E*A,v-I*A,x-R*A,v-N*A,c,!1)+2;break}}c.push(x-R*A,v-N*A,x+R*G,v+N*G),d+=2}}b=i[(u-2)*2],_=i[(u-2)*2+1],x=i[(u-1)*2],v=i[(u-1)*2+1],E=-(_-v),I=b-x,F=Math.sqrt(E*E+I*I),E/=F,I/=F,E*=p,I*=p,c.push(x-E*A,v-I*A,x+E*G,v+I*G),h||(n.cap===Er.ROUND?d+=ds(x-E*(A-G)*.5,v-I*(A-G)*.5,x-E*A,v-I*A,x+E*G,v+I*G,c,!1)+2:n.cap===Er.SQUARE&&(d+=Qm(x,v,E,I,A,G,!1,c)));const D=t.indices,X=hn.epsilon*hn.epsilon;for(let B=f;B<d+f-2;++B)b=c[B*2],_=c[B*2+1],x=c[(B+1)*2],v=c[(B+1)*2+1],T=c[(B+2)*2],C=c[(B+2)*2+1],!(Math.abs(b*(v-C)+x*(C-_)+T*(_-v))<X)&&D.push(B,B+1,B+2)}function qT(r,t){let e=0;const i=r.shape,s=r.points||i.points,n=i.type!==ce.POLY||i.closeStroke;if(s.length===0)return;const o=t.points,a=t.indices,h=s.length/2,l=o.length/2;let c=l;for(o.push(s[0],s[1]),e=1;e<h;e++)o.push(s[e*2],s[e*2+1]),a.push(c,c+1),c++;n&&a.push(c,l)}function qm(r,t){r.lineStyle.native?qT(r,t):QT(r,t)}class uu{static curveLength(t,e,i,s,n,o){const a=t-2*i+n,h=e-2*s+o,l=2*i-2*t,c=2*s-2*e,u=4*(a*a+h*h),d=4*(a*l+h*c),f=l*l+c*c,p=2*Math.sqrt(u+d+f),m=Math.sqrt(u),g=2*u*m,b=2*Math.sqrt(f),_=d/m;return(g*p+m*d*(p-b)+(4*f*u-d*d)*Math.log((2*m+_+p)/(_+b)))/(4*g)}static curveTo(t,e,i,s,n){const o=n[n.length-2],a=n[n.length-1],h=hn._segmentsCount(uu.curveLength(o,a,t,e,i,s));let l=0,c=0;for(let u=1;u<=h;++u){const d=u/h;l=o+(t-o)*d,c=a+(e-a)*d,n.push(l+(t+(i-t)*d-l)*d,c+(e+(s-e)*d-c)*d)}}}const du={[ce.POLY]:Jm,[ce.CIRC]:nh,[ce.ELIP]:nh,[ce.RECT]:jT,[ce.RREC]:JT},tg=[],oh=[];class ah{constructor(t,e=null,i=null,s=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=s,this.type=t.type}clone(){return new ah(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const ln=new ct,eg=class Mb extends F0{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new za,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),oh.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),tg.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,s=null){const n=new ah(t,e,i,s);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new ah(t,null,null,e),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let i=0;i<e.length;++i){const s=e[i];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,ln):ln.copyFrom(t),s.shape.contains(ln.x,ln.y))){let n=!1;if(s.holes){for(let o=0;o<s.holes.length;o++)if(s.holes[o].shape.contains(ln.x,ln.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let i=null,s=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],s=i.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const l=e[h],c=l.fillStyle,u=l.lineStyle;du[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(c.visible||u.visible)&&this.processHoles(l.holes);for(let d=0;d<2;d++){const f=d===0?c:u;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,g=this.points.length/2;p.wrapMode=_i.REPEAT,d===0?this.processFill(l):this.processLine(l);const b=this.points.length/2-g;b!==0&&(i&&!this._compareStyles(s,f)&&(i.end(m,g),i=null),i||(i=tg.pop()||new $T,i.begin(f,m,g),this.batches.push(i),s=f),this.addUvs(this.points,t,f.texture,g,b,f.matrix))}}const n=this.indices.length,o=this.points.length/2;if(i&&i.end(n,o),this.batches.length===0){this.batchable=!0;return}const a=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const i=this.graphicsData[t],s=i.fillStyle,n=i.lineStyle;if(s&&!s.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,i=t.length;e<i;e++){const s=t[e];for(let n=0;n<s.size;n++){const o=s.start+n;this.indicesUint16[o]=this.indicesUint16[o]-s.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<Mb.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++bt._globalBatch;for(let u=0;u<this.drawCalls.length;u++)this.drawCalls[u].texArray.clear(),oh.push(this.drawCalls[u]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let s=oh.pop();s||(s=new Fc,s.texArray=new Xc),s.texArray.count=0,s.start=0,s.size=0,s.type=xi.TRIANGLES;let n=0,o=null,a=0,h=!1,l=xi.TRIANGLES,c=0;this.drawCalls.push(s);for(let u=0;u<this.batches.length;u++){const d=this.batches[u],f=8,p=d.style,m=p.texture.baseTexture;h!==!!p.native&&(h=!!p.native,l=h?xi.LINES:xi.TRIANGLES,o=null,n=f,t++),o!==m&&(o=m,m._batchEnabled!==t&&(n===f&&(t++,n=0,s.size>0&&(s=oh.pop(),s||(s=new Fc,s.texArray=new Xc),this.drawCalls.push(s)),s.start=c,s.size=0,s.texArray.count=0,s.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=_i.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=d.size,c+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}bt._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,s=this.textureIds,n=new ArrayBuffer(t.length*3*4),o=new Float32Array(n),a=new Uint32Array(n);let h=0;for(let l=0;l<t.length/2;l++)o[h++]=t[l*2],o[h++]=t[l*2+1],o[h++]=e[l*2],o[h++]=e[l*2+1],a[h++]=i[l],o[h++]=s[l];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Jm.triangulate(t,this):du[t.type].triangulate(t,this)}processLine(t){qm(t,this);for(let e=0;e<t.holes.length;e++)qm(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];du[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let i=0;i<t.length/2;i++){const s=t[i*2],n=t[i*2+1];t[i*2]=e.a*s+e.c*n+e.tx,t[i*2+1]=e.b*s+e.d*n+e.ty}}addColors(t,e,i,s,n=0){const o=Lt.shared.setValue(e).toLittleEndianNumber(),a=Lt.shared.setValue(o).toPremultiplied(i);t.length=Math.max(t.length,n+s);for(let h=0;h<s;h++)t[n+h]=a}addTextureIds(t,e,i,s=0){t.length=Math.max(t.length,s+i);for(let n=0;n<i;n++)t[s+n]=e}addUvs(t,e,i,s,n,o=null){let a=0;const h=e.length,l=i.frame;for(;a<n;){let u=t[(s+a)*2],d=t[(s+a)*2+1];if(o){const f=o.a*u+o.c*d+o.tx;d=o.b*u+o.d*d+o.ty,u=f}a++,e.push(u/l.width,d/l.height)}const c=i.baseTexture;(l.width<c.width||l.height<c.height)&&this.adjustUvs(e,i,h,n)}adjustUvs(t,e,i,s){const n=e.baseTexture,o=1e-6,a=i+s*2,h=e.frame,l=h.width/n.width,c=h.height/n.height;let u=h.x/h.width,d=h.y/h.height,f=Math.floor(t[i]+o),p=Math.floor(t[i+1]+o);for(let m=i+2;m<a;m+=2)f=Math.min(f,Math.floor(t[m]+o)),p=Math.min(p,Math.floor(t[m+1]+o));u-=f,d-=p;for(let m=i;m<a;m+=2)t[m]=(t[m]+u)*l,t[m+1]=(t[m+1]+d)*c}};eg.BATCHABLE_SIZE=100;let tS=eg;class hh{constructor(){this.color=16777215,this.alpha=1,this.texture=ot.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new hh;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=ot.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class fu extends hh{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Er.BUTT,this.join=He.MITER,this.miterLimit=10}clone(){const t=new fu;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Er.BUTT,this.join=He.MITER,this.miterLimit=10}}const pu={},mu=class wl extends Tt{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new hh,this._lineStyle=new fu,this._matrix=null,this._holeMode=!1,this.state=Ai.for2d(),this._geometry=t||new tS,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Lt(16777215),this.blendMode=dt.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new wl(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,i,s=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:i,alignment:s,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:ot.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Er.BUTT,join:He.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new ts,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ts,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],n=i[i.length-1];return(s!==t||n!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),uu.curveTo(t,e,i,s,n),this}bezierCurveTo(t,e,i,s,n,o){return this._initCurve(),cu.curveTo(t,e,i,s,n,o,this.currentPath.points),this}arcTo(t,e,i,s,n){this._initCurve(t,e);const o=this.currentPath.points,a=$m.curveTo(t,e,i,s,n,o);if(a){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(h,l,c,u,d,f)}return this}arc(t,e,i,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=Ra:o&&s<=n&&(s+=Ra),n-s===0)return this;const a=t+Math.cos(s)*i,h=e+Math.sin(s)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u<l&&d<l||c.push(a,h)}else this.moveTo(a,h),c=this.currentPath.points;return $m.arc(a,h,t,e,i,s,n,o,c),this}beginFill(t=0,e){return this.beginTextureFill({texture:ot.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Lt.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:ot.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,s){return this.drawShape(new pt(t,e,i,s))}drawRoundedRect(t,e,i,s,n){return this.drawShape(new Fa(t,e,i,s,n))}drawCircle(t,e,i){return this.drawShape(new La(t,e,i))}drawEllipse(t,e,i,s){return this.drawShape(new Ga(t,e,i,s))}drawPolygon(...t){let e,i=!0;const s=t[0];s.points?(i=s.closeStroke,e=s.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new ts(e);return n.closeStroke=i,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===ce.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let s=0;s<i;s++){const n=t.batches[s],o=n.style.color,a=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),h=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),c={vertexData:a,blendMode:e,indices:l,uvs:h,_batchRGB:Lt.shared.setValue(o).toRgbArray(),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[s]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,i=this.batches.length;e<i;e++){const s=this.batches[e];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}}_renderDirect(t){const e=this._resolveDirectShader(t),i=this._geometry,s=this.worldAlpha,n=e.uniforms,o=i.drawCalls;n.translationMatrix=this.transform.worldTransform,Lt.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let a=0,h=o.length;a<h;a++)this._renderDrawCallDirect(t,i.drawCalls[a])}_renderDrawCallDirect(t,e){const{texArray:i,type:s,size:n,start:o}=e,a=i.count;for(let h=0;h<a;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(s,n,o)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!pu[i]){const{maxTextures:s}=t.plugins[i],n=new Int32Array(s);for(let h=0;h<s;h++)n[h]=h;const o={tint:new Float32Array([1,1,1,1]),translationMatrix:new Gt,default:si.from({uSamplers:n},!0)},a=t.plugins[i]._shader.program;pu[i]=new Mi(a,o)}e=pu[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:s,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,i,s,n)}containsPoint(t){return this.worldTransform.applyInverse(t,wl._TEMP_POINT),this._geometry.containsPoint(wl._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Lt.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this._geometry.points,c=this.vertexData;let u=0;for(let d=0;d<l.length;d+=2){const f=l[d],p=l[d+1];c[u++]=i*f+n*p+a,c[u++]=o*p+s*f+h}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};mu.curves=hn,mu._TEMP_POINT=new ct;let Ir=mu;class eS{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const gu=new ct,ig=new ts,rg=class Rb extends Tt{constructor(t,e,i,s=xi.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=i||Ai.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=it.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(t){const e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===xi.TRIANGLES&&e.length<Rb.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(t){const e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;const s=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[s]),t.plugins[s].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,i=t._updateID;if(i===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,c=s.ty,u=this.vertexData;for(let d=0;d<u.length/2;d++){const f=e[d*2],p=e[d*2+1];u[d*2]=n*f+a*p+l,u[d*2+1]=o*f+h*p+c}if(this._roundPixels){const d=it.RESOLUTION;for(let f=0;f<u.length;++f)u[f]=Math.round(u[f]*d)/d}this.vertexDirty=i}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new eS(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,gu);const e=this.geometry.getBuffer("aVertexPosition").data,i=ig.points,s=this.geometry.getIndex().data,n=s.length,o=this.drawMode===4?3:1;for(let a=0;a+2<n;a+=o){const h=s[a]*2,l=s[a+1]*2,c=s[a+2]*2;if(i[0]=e[h],i[1]=e[h+1],i[2]=e[l],i[3]=e[l+1],i[4]=e[c],i[5]=e[c+1],ig.contains(gu.x,gu.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};rg.BATCHABLE_SIZE=100;let yu=rg;class sg extends wr{constructor(t,e,i){super();const s=new Kt(t),n=new Kt(e,!0),o=new Kt(i,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,ht.FLOAT).addAttribute("aTextureCoord",n,2,!1,ht.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var iS=`varying vec2 vTextureCoord;
924
924
  uniform vec4 uColor;
925
925
 
926
926
  uniform sampler2D uSampler;
@@ -1156,7 +1156,7 @@ void main(void)\r
1156
1156
  font-weight: ${e.weight};
1157
1157
  font-style: ${e.style};
1158
1158
  font-display: ${e.display};
1159
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=Cv(t)),typeof t=="number"?Sv(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,Vn.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=it.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};Cu.availableFonts={},Cu.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Eu=Cu;const mh=class Hn extends jt{constructor(t="",e={}){super(ot.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=ot.from(i,{scaleMode:it.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new pt,s.trim=new pt,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Hn.defaultMaxWidth,this.maxHeight=Hn.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Hn.defaultAutoResolution,this._resolution=Hn.defaultResolution??it.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(s)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:s}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await e.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const l=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(l)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:i,resolution:s}=this,{padding:n}=t,{baseTexture:o}=e;e.trim.width=e._frame.width=i.width/s,e.trim.height=e._frame.height=i.height/s,e.trim.x=-n,e.trim.y=-n,e.orig.width=e._frame.width-n*2,e.orig.height=e._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var i,s,n,o,a;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Hn.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=e,(s=this._svgRoot)==null||s.remove(),this._svgRoot=e,(n=this._domElement)==null||n.remove(),this._domElement=e,(o=this._foreignObject)==null||o.remove(),this._foreignObject=e,(a=this._styleElement)==null||a.remove(),this._styleElement=e,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=e,this._image.src="",this._image=e}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=_r(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=_r(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&(t=t||{},t instanceof Eu?(this.ownsStyle=!1,this._style=t):t instanceof Mr?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Eu.from(t)):(this.ownsStyle=!0,this._style=new Eu(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(t===""||t===null||t===void 0?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};mh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},mh.defaultMaxWidth=2024,mh.defaultMaxHeight=2024,mh.defaultAutoResolution=!0;function kS(){const r=new Map;function t(o,a){const h=r.get(o);return h?h.add(a):r.set(o,new Set([a])),()=>i(o,a)}function e(o,a){const h=l=>{i(o,h),a(l)};t(o,h)}function i(o,a){var h;(h=r.get(o))==null||h.delete(a)}function s(o,a){var h;(h=r.get(o))==null||h.forEach(l=>l(a))}function n(){r.clear()}return{on:t,off:i,once:e,emit:s,clear:n}}const $=kS();function Ge(r){let t;return new Promise(e=>{t=e,$.on(r,t)}).then(e=>($.off(r,t),e))}let Pi=null;const Tg=new ResizeObserver(()=>{Pi&&$.emit("stageUpdated",Pi)});function DS(r){Pi=r,Tg.observe(Pi),$.emit("stageCreated",Pi)}function OS(){Pi&&Tg.unobserve(Pi),Pi=null}async function Iu(){return Pi||await Ge("stageCreated")}let Fe=null;async function BS(){const r=await Iu();XS(r),$.on("stageUpdated",WS)}function US(){Fe&&(Fe.destroy(!0,{children:!0}),Fe=null)}function XS(r){Fe=new km({backgroundAlpha:0,resizeTo:r,antialias:!0,resolution:Math.ceil(window.devicePixelRatio)}),Fe.stage.sortableChildren=!0,r.appendChild(Fe.view),$.emit("applicationCreated",Fe),process.env.NODE_ENV==="development"&&(globalThis.__PIXI_APP__=Fe)}async function Jt(){return Fe||await Ge("applicationCreated")}function WS(r){Fe&&(Fe.resizeTo=r,$.emit("applicationResized",Fe))}let gh=new Map;function ZS(){gh=new Map}async function fo(r,t){const e=`${r.toString()}-${JSON.stringify(t)}`;if(gh.has(e))return gh.get(e);const i=await r(...t);return gh.set(e,i),i}var yh={exports:{}};yh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=800,n=16,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",b="[object Null]",_="[object Object]",x="[object Proxy]",v="[object RegExp]",T="[object Set]",C="[object String]",E="[object Undefined]",I="[object WeakMap]",R="[object ArrayBuffer]",N="[object DataView]",F="[object Float32Array]",P="[object Float64Array]",A="[object Int8Array]",G="[object Int16Array]",D="[object Int32Array]",X="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",lt="[object Uint32Array]",W=/[\\^$.*+?()[\]{}|]/g,L=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,U={};U[F]=U[P]=U[A]=U[G]=U[D]=U[X]=U[B]=U[H]=U[lt]=!0,U[a]=U[h]=U[R]=U[c]=U[N]=U[u]=U[d]=U[f]=U[m]=U[g]=U[_]=U[v]=U[T]=U[C]=U[I]=!1;var tt=typeof be=="object"&&be&&be.Object===Object&&be,Q=typeof self=="object"&&self&&self.Object===Object&&self,xt=tt||Q||Function("return this")(),Ct=t&&!t.nodeType&&t,q=Ct&&!0&&r&&!r.nodeType&&r,Z=q&&q.exports===Ct,Y=Z&&tt.process,z=function(){try{var y=q&&q.require&&q.require("util").types;return y||Y&&Y.binding&&Y.binding("util")}catch{}}(),k=z&&z.isTypedArray;function ut(y,w,M){switch(M.length){case 0:return y.call(w);case 1:return y.call(w,M[0]);case 2:return y.call(w,M[0],M[1]);case 3:return y.call(w,M[0],M[1],M[2])}return y.apply(w,M)}function gt(y,w){for(var M=-1,K=Array(y);++M<y;)K[M]=w(M);return K}function At(y){return function(w){return y(w)}}function Ft(y,w){return y==null?void 0:y[w]}function Re(y,w){return function(M){return y(w(M))}}var Ue=Array.prototype,Ho=Function.prototype,Wr=Object.prototype,Ln=xt["__core-js_shared__"],Gn=Ho.toString,Wi=Wr.hasOwnProperty,sl=function(){var y=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),nl=Wr.toString,$d=Gn.call(Object),Fn=RegExp("^"+Gn.call(Wi).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zr=Z?xt.Buffer:void 0,Ko=xt.Symbol,Xe=xt.Uint8Array;Zr&&Zr.allocUnsafe;var Yo=Re(Object.getPrototypeOf,Object),zo=Object.create,Qd=Wr.propertyIsEnumerable,ol=Ue.splice,ti=Ko?Ko.toStringTag:void 0,Ps=function(){try{var y=ta(Object,"defineProperty");return y({},"",{}),y}catch{}}(),al=Zr?Zr.isBuffer:void 0,hl=Math.max,fr=Date.now,jo=ta(xt,"Map"),Ls=ta(Object,"create"),qd=function(){function y(){}return function(w){if(!mr(w))return{};if(zo)return zo(w);y.prototype=w;var M=new y;return y.prototype=void 0,M}}();function di(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function Gs(){this.__data__=Ls?Ls(null):{},this.size=0}function Jo(y){var w=this.has(y)&&delete this.__data__[y];return this.size-=w?1:0,w}function $o(y){var w=this.__data__;if(Ls){var M=w[y];return M===i?void 0:M}return Wi.call(w,y)?w[y]:void 0}function Qo(y){var w=this.__data__;return Ls?w[y]!==void 0:Wi.call(w,y)}function Fs(y,w){var M=this.__data__;return this.size+=this.has(y)?0:1,M[y]=Ls&&w===void 0?i:w,this}di.prototype.clear=Gs,di.prototype.delete=Jo,di.prototype.get=$o,di.prototype.has=Qo,di.prototype.set=Fs;function fi(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function tf(){this.__data__=[],this.size=0}function ef(y){var w=this.__data__,M=Nn(w,y);if(M<0)return!1;var K=w.length-1;return M==K?w.pop():ol.call(w,M,1),--this.size,!0}function rf(y){var w=this.__data__,M=Nn(w,y);return M<0?void 0:w[M][1]}function sf(y){return Nn(this.__data__,y)>-1}function ll(y,w){var M=this.__data__,K=Nn(M,y);return K<0?(++this.size,M.push([y,w])):M[K][1]=w,this}fi.prototype.clear=tf,fi.prototype.delete=ef,fi.prototype.get=rf,fi.prototype.has=sf,fi.prototype.set=ll;function Zi(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function pr(){this.size=0,this.__data__={hash:new di,map:new(jo||fi),string:new di}}function nf(y){var w=On(this,y).delete(y);return this.size-=w?1:0,w}function of(y){return On(this,y).get(y)}function af(y){return On(this,y).has(y)}function hf(y,w){var M=On(this,y),K=M.size;return M.set(y,w),this.size+=M.size==K?0:1,this}Zi.prototype.clear=pr,Zi.prototype.delete=nf,Zi.prototype.get=of,Zi.prototype.has=af,Zi.prototype.set=hf;function Vr(y){var w=this.__data__=new fi(y);this.size=w.size}function pi(){this.__data__=new fi,this.size=0}function lf(y){var w=this.__data__,M=w.delete(y);return this.size=w.size,M}function cf(y){return this.__data__.get(y)}function uf(y){return this.__data__.has(y)}function df(y,w){var M=this.__data__;if(M instanceof fi){var K=M.__data__;if(!jo||K.length<e-1)return K.push([y,w]),this.size=++M.size,this;M=this.__data__=new Zi(K)}return M.set(y,w),this.size=M.size,this}Vr.prototype.clear=pi,Vr.prototype.delete=lf,Vr.prototype.get=cf,Vr.prototype.has=uf,Vr.prototype.set=df;function ff(y,w){var M=gi(y),K=!M&&ia(y),j=!M&&!K&&Os(y),ft=!M&&!K&&!j&&sa(y),_t=M||K||j||ft,mt=_t?gt(y.length,String):[],yt=mt.length;for(var Nt in y)_t&&(Nt=="length"||j&&(Nt=="offset"||Nt=="parent")||ft&&(Nt=="buffer"||Nt=="byteLength"||Nt=="byteOffset")||ea(Nt,yt))||mt.push(Nt);return mt}function mi(y,w,M){(M!==void 0&&!Bn(y[w],M)||M===void 0&&!(w in y))&&qo(y,w,M)}function pf(y,w,M){var K=y[w];(!(Wi.call(y,w)&&Bn(K,M))||M===void 0&&!(w in y))&&qo(y,w,M)}function Nn(y,w){for(var M=y.length;M--;)if(Bn(y[M][0],w))return M;return-1}function qo(y,w,M){w=="__proto__"&&Ps?Ps(y,w,{configurable:!0,enumerable:!0,value:M,writable:!0}):y[w]=M}var mf=dl();function kn(y){return y==null?y===void 0?E:b:ti&&ti in Object(y)?Sf(y):Af(y)}function Ns(y){return Kr(y)&&kn(y)==a}function gf(y){if(!mr(y)||fl(y))return!1;var w=ra(y)?Fn:L;return w.test(Lf(y))}function yf(y){return Kr(y)&&Xn(y.length)&&!!U[kn(y)]}function Vi(y){if(!mr(y))return Hr(y);var w=Ds(y),M=[];for(var K in y)K=="constructor"&&(w||!Wi.call(y,K))||M.push(K);return M}function cl(y,w,M,K,j){y!==w&&mf(w,function(ft,_t){if(j||(j=new Vr),mr(ft))bf(y,w,_t,M,cl,K,j);else{var mt=K?K(ei(y,_t),ft,_t+"",y,w,j):void 0;mt===void 0&&(mt=ft),mi(y,_t,mt)}},na)}function bf(y,w,M,K,j,ft,_t){var mt=ei(y,M),yt=ei(w,M),Nt=_t.get(yt);if(Nt){mi(y,M,Nt);return}var kt=ft?ft(mt,yt,M+"",y,w,_t):void 0,Ht=kt===void 0;if(Ht){var ge=gi(yt),ye=!ge&&Os(yt),yi=!ge&&!ye&&sa(yt);kt=yt,ge||ye||yi?gi(mt)?kt=mt:Gf(mt)?kt=Tf(mt):ye?(Ht=!1,kt=vf(yt)):yi?(Ht=!1,kt=Dn(yt)):kt=[]:pl(yt)||ia(yt)?(kt=mt,ia(mt)?kt=Bs(mt):(!mr(mt)||ra(mt))&&(kt=Cf(yt))):Ht=!1}Ht&&(_t.set(yt,kt),j(kt,yt,K,ft,_t),_t.delete(yt)),mi(y,M,kt)}function xf(y,w){return Rf(Mf(y,w,ml),y+"")}var _f=Ps?function(y,w){return Ps(y,"toString",{configurable:!0,enumerable:!1,value:Nf(w),writable:!0})}:ml;function vf(y,w){return y.slice()}function wf(y){var w=new y.constructor(y.byteLength);return new Xe(w).set(new Xe(y)),w}function Dn(y,w){var M=wf(y.buffer);return new y.constructor(M,y.byteOffset,y.length)}function Tf(y,w){var M=-1,K=y.length;for(w||(w=Array(K));++M<K;)w[M]=y[M];return w}function ks(y,w,M,K){var j=!M;M||(M={});for(var ft=-1,_t=w.length;++ft<_t;){var mt=w[ft],yt=void 0;yt===void 0&&(yt=y[mt]),j?qo(M,mt,yt):pf(M,mt,yt)}return M}function ul(y){return xf(function(w,M){var K=-1,j=M.length,ft=j>1?M[j-1]:void 0,_t=j>2?M[2]:void 0;for(ft=y.length>3&&typeof ft=="function"?(j--,ft):void 0,_t&&Ef(M[0],M[1],_t)&&(ft=j<3?void 0:ft,j=1),w=Object(w);++K<j;){var mt=M[K];mt&&y(w,mt,K,ft)}return w})}function dl(y){return function(w,M,K){for(var j=-1,ft=Object(w),_t=K(w),mt=_t.length;mt--;){var yt=_t[++j];if(M(ft[yt],yt,ft)===!1)break}return w}}function On(y,w){var M=y.__data__;return If(w)?M[typeof w=="string"?"string":"hash"]:M.map}function ta(y,w){var M=Ft(y,w);return gf(M)?M:void 0}function Sf(y){var w=Wi.call(y,ti),M=y[ti];try{y[ti]=void 0;var K=!0}catch{}var j=nl.call(y);return K&&(w?y[ti]=M:delete y[ti]),j}function Cf(y){return typeof y.constructor=="function"&&!Ds(y)?qd(Yo(y)):{}}function ea(y,w){var M=typeof y;return w=w??o,!!w&&(M=="number"||M!="symbol"&&O.test(y))&&y>-1&&y%1==0&&y<w}function Ef(y,w,M){if(!mr(M))return!1;var K=typeof w;return(K=="number"?Un(M)&&ea(w,M.length):K=="string"&&w in M)?Bn(M[w],y):!1}function If(y){var w=typeof y;return w=="string"||w=="number"||w=="symbol"||w=="boolean"?y!=="__proto__":y===null}function fl(y){return!!sl&&sl in y}function Ds(y){var w=y&&y.constructor,M=typeof w=="function"&&w.prototype||Wr;return y===M}function Hr(y){var w=[];if(y!=null)for(var M in Object(y))w.push(M);return w}function Af(y){return nl.call(y)}function Mf(y,w,M){return w=hl(w===void 0?y.length-1:w,0),function(){for(var K=arguments,j=-1,ft=hl(K.length-w,0),_t=Array(ft);++j<ft;)_t[j]=K[w+j];j=-1;for(var mt=Array(w+1);++j<w;)mt[j]=K[j];return mt[w]=M(_t),ut(y,this,mt)}}function ei(y,w){if(!(w==="constructor"&&typeof y[w]=="function")&&w!="__proto__")return y[w]}var Rf=Pf(_f);function Pf(y){var w=0,M=0;return function(){var K=fr(),j=n-(K-M);if(M=K,j>0){if(++w>=s)return arguments[0]}else w=0;return y.apply(void 0,arguments)}}function Lf(y){if(y!=null){try{return Gn.call(y)}catch{}try{return y+""}catch{}}return""}function Bn(y,w){return y===w||y!==y&&w!==w}var ia=Ns(function(){return arguments}())?Ns:function(y){return Kr(y)&&Wi.call(y,"callee")&&!Qd.call(y,"callee")},gi=Array.isArray;function Un(y){return y!=null&&Xn(y.length)&&!ra(y)}function Gf(y){return Kr(y)&&Un(y)}var Os=al||S;function ra(y){if(!mr(y))return!1;var w=kn(y);return w==f||w==p||w==l||w==x}function Xn(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function mr(y){var w=typeof y;return y!=null&&(w=="object"||w=="function")}function Kr(y){return y!=null&&typeof y=="object"}function pl(y){if(!Kr(y)||kn(y)!=_)return!1;var w=Yo(y);if(w===null)return!0;var M=Wi.call(w,"constructor")&&w.constructor;return typeof M=="function"&&M instanceof M&&Gn.call(M)==$d}var sa=k?At(k):yf;function Bs(y){return ks(y,na(y))}function na(y){return Un(y)?ff(y):Vi(y)}var Ff=ul(function(y,w,M){cl(y,w,M)});function Nf(y){return function(){return y}}function ml(y){return y}function S(){return!1}r.exports=Ff}(yh,yh.exports);var VS=yh.exports;const HS=Zs(VS);let cn=null;const Sg={animationDuration:500,disableAnimationsThreshold:500,disableEdgesThreshold:500,fetchEvents:()=>[],fetchEventsInterval:3e4,styles:{colorMode:"dark",rowGap:24,columnGap:32,textDefault:"#ffffff",textInverse:"#000000",selectedBorderColor:"#3fa2c3",selectedBorderWidth:2,selectedBorderOffset:4,selectedBorderRadius:9,nodesPadding:16,nodeHeight:32,nodePadding:4,nodeRadius:6,nodeBorderRadius:9,nodeToggleSize:28,nodeToggleBgColor:"#35363C",nodeToggleBorderRadius:6,nodeToggleBorderColor:"#51525C",nodeUnselectedAlpha:.2,artifactsGap:4,artifactsNodeOverlap:4,artifactPaddingLeft:2,artifactPaddingRight:4,artifactPaddingY:2,artifactTextColor:"#ffffff",artifactBgColor:"#35363b",artifactBorderRadius:4,artifactContentGap:4,artifactIconSize:16,artifactIconColor:"#ffffff",flowStateBarHeight:8,flowStateSelectedBarHeight:10,flowStateAreaAlpha:.1,eventTargetSize:30,eventBottomMargin:4,eventSelectedBorderInset:8,eventRadiusDefault:4,eventColor:"#A564F9",eventClusterRadiusDefault:6,eventClusterColor:"#A564F9",edgeColor:"#51525C",guideLineWidth:1,guideLineColor:"#51525C",guideTextTopPadding:8,guideTextLeftPadding:8,guideTextSize:12,guideTextColor:"#ADADAD",playheadWidth:2,playheadColor:"#6272FF",node:()=>({background:"#ffffff"}),state:()=>({background:"#ffffff"})}};function KS(r){const t=HS({},Sg,r);return t.styles.node=e=>{var i,s;return{...Sg.styles.node(e),...(s=(i=r.styles)==null?void 0:i.node)==null?void 0:s.call(i,e)}},t}function YS(r){Cg(r)}function Cg(r){const t=KS(r);if(!cn){cn=t,$.emit("configCreated",t);return}Object.assign(cn,t),$.emit("configUpdated",t)}function zS(){cn=null}async function Mt(){return cn||await Ge("configCreated")}const fs=new pt;class jS{constructor(t={}){this._recursive=typeof t.recursive=="boolean"?t.recursive:!0,this._toggle=t.toggle||"visible",this._targetList=new Set}add(t){return this._targetList.add(t),this}addAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.add(t[e]);return this}remove(t){return this._targetList.delete(t),this}removeAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.delete(t[e]);return this}clear(){return this._targetList.clear(),this}cull(t,e=!1){return e||this.uncull(),this._targetList.forEach(i=>{e||i.getBounds(!1,fs),this._recursive?this.cullRecursive(t,i,e):(e&&i._bounds.getRectangle(t),i[this._toggle]=fs.right>t.left&&fs.left<t.right&&fs.bottom>t.top&&fs.top<t.bottom)}),this}uncull(){return this._targetList.forEach(t=>{this._recursive?this.uncullRecursive(t):t[this._toggle]=!1}),this}cullRecursive(t,e,i){const s=i?e._bounds.getRectangle(fs):e.getBounds(!0,fs);if(e[this._toggle]=s.right>t.left&&s.left<t.right&&s.bottom>t.top&&s.top<t.bottom,!(s.left>=t.left&&s.top>=t.top&&s.right<=t.right&&s.bottom<=t.bottom)&&e[this._toggle]&&e.children&&e.children.length){const o=e.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(t,o[a])}}uncullRecursive(t){if(t[this._toggle]=!0,t.children&&t.children.length){const e=t.children;for(let i=0,s=e.length;i<s;i++)this.uncullRecursive(e[i])}}}var bh={exports:{}};bh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=1,n=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",b="[object Null]",_="[object Object]",x="[object Promise]",v="[object Proxy]",T="[object RegExp]",C="[object Set]",E="[object String]",I="[object Symbol]",R="[object Undefined]",N="[object WeakMap]",F="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",G="[object Float64Array]",D="[object Int8Array]",X="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",lt="[object Uint8ClampedArray]",W="[object Uint16Array]",L="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,U=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,Q={};Q[A]=Q[G]=Q[D]=Q[X]=Q[B]=Q[H]=Q[lt]=Q[W]=Q[L]=!0,Q[a]=Q[h]=Q[F]=Q[c]=Q[P]=Q[u]=Q[d]=Q[f]=Q[m]=Q[g]=Q[_]=Q[T]=Q[C]=Q[E]=Q[N]=!1;var xt=typeof be=="object"&&be&&be.Object===Object&&be,Ct=typeof self=="object"&&self&&self.Object===Object&&self,q=xt||Ct||Function("return this")(),Z=t&&!t.nodeType&&t,Y=Z&&!0&&r&&!r.nodeType&&r,z=Y&&Y.exports===Z,k=z&&xt.process,ut=function(){try{return k&&k.binding&&k.binding("util")}catch{}}(),gt=ut&&ut.isTypedArray;function At(S,y){for(var w=-1,M=S==null?0:S.length,K=0,j=[];++w<M;){var ft=S[w];y(ft,w,S)&&(j[K++]=ft)}return j}function Ft(S,y){for(var w=-1,M=y.length,K=S.length;++w<M;)S[K+w]=y[w];return S}function Re(S,y){for(var w=-1,M=S==null?0:S.length;++w<M;)if(y(S[w],w,S))return!0;return!1}function Ue(S,y){for(var w=-1,M=Array(S);++w<S;)M[w]=y(w);return M}function Ho(S){return function(y){return S(y)}}function Wr(S,y){return S.has(y)}function Ln(S,y){return S==null?void 0:S[y]}function Gn(S){var y=-1,w=Array(S.size);return S.forEach(function(M,K){w[++y]=[K,M]}),w}function Wi(S,y){return function(w){return S(y(w))}}function sl(S){var y=-1,w=Array(S.size);return S.forEach(function(M){w[++y]=M}),w}var nl=Array.prototype,$d=Function.prototype,Fn=Object.prototype,Zr=q["__core-js_shared__"],Ko=$d.toString,Xe=Fn.hasOwnProperty,Yo=function(){var S=/[^.]+$/.exec(Zr&&Zr.keys&&Zr.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),zo=Fn.toString,Qd=RegExp("^"+Ko.call(Xe).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=z?q.Buffer:void 0,ti=q.Symbol,Ps=q.Uint8Array,al=Fn.propertyIsEnumerable,hl=nl.splice,fr=ti?ti.toStringTag:void 0,jo=Object.getOwnPropertySymbols,Ls=ol?ol.isBuffer:void 0,qd=Wi(Object.keys,Object),di=Hr(q,"DataView"),Gs=Hr(q,"Map"),Jo=Hr(q,"Promise"),$o=Hr(q,"Set"),Qo=Hr(q,"WeakMap"),Fs=Hr(Object,"create"),fi=gi(di),tf=gi(Gs),ef=gi(Jo),rf=gi($o),sf=gi(Qo),ll=ti?ti.prototype:void 0,Zi=ll?ll.valueOf:void 0;function pr(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function nf(){this.__data__=Fs?Fs(null):{},this.size=0}function of(S){var y=this.has(S)&&delete this.__data__[S];return this.size-=y?1:0,y}function af(S){var y=this.__data__;if(Fs){var w=y[S];return w===i?void 0:w}return Xe.call(y,S)?y[S]:void 0}function hf(S){var y=this.__data__;return Fs?y[S]!==void 0:Xe.call(y,S)}function Vr(S,y){var w=this.__data__;return this.size+=this.has(S)?0:1,w[S]=Fs&&y===void 0?i:y,this}pr.prototype.clear=nf,pr.prototype.delete=of,pr.prototype.get=af,pr.prototype.has=hf,pr.prototype.set=Vr;function pi(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function lf(){this.__data__=[],this.size=0}function cf(S){var y=this.__data__,w=Dn(y,S);if(w<0)return!1;var M=y.length-1;return w==M?y.pop():hl.call(y,w,1),--this.size,!0}function uf(S){var y=this.__data__,w=Dn(y,S);return w<0?void 0:y[w][1]}function df(S){return Dn(this.__data__,S)>-1}function ff(S,y){var w=this.__data__,M=Dn(w,S);return M<0?(++this.size,w.push([S,y])):w[M][1]=y,this}pi.prototype.clear=lf,pi.prototype.delete=cf,pi.prototype.get=uf,pi.prototype.has=df,pi.prototype.set=ff;function mi(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function pf(){this.size=0,this.__data__={hash:new pr,map:new(Gs||pi),string:new pr}}function Nn(S){var y=Ds(this,S).delete(S);return this.size-=y?1:0,y}function qo(S){return Ds(this,S).get(S)}function mf(S){return Ds(this,S).has(S)}function kn(S,y){var w=Ds(this,S),M=w.size;return w.set(S,y),this.size+=w.size==M?0:1,this}mi.prototype.clear=pf,mi.prototype.delete=Nn,mi.prototype.get=qo,mi.prototype.has=mf,mi.prototype.set=kn;function Ns(S){var y=-1,w=S==null?0:S.length;for(this.__data__=new mi;++y<w;)this.add(S[y])}function gf(S){return this.__data__.set(S,i),this}function yf(S){return this.__data__.has(S)}Ns.prototype.add=Ns.prototype.push=gf,Ns.prototype.has=yf;function Vi(S){var y=this.__data__=new pi(S);this.size=y.size}function cl(){this.__data__=new pi,this.size=0}function bf(S){var y=this.__data__,w=y.delete(S);return this.size=y.size,w}function xf(S){return this.__data__.get(S)}function _f(S){return this.__data__.has(S)}function vf(S,y){var w=this.__data__;if(w instanceof pi){var M=w.__data__;if(!Gs||M.length<e-1)return M.push([S,y]),this.size=++w.size,this;w=this.__data__=new mi(M)}return w.set(S,y),this.size=w.size,this}Vi.prototype.clear=cl,Vi.prototype.delete=bf,Vi.prototype.get=xf,Vi.prototype.has=_f,Vi.prototype.set=vf;function wf(S,y){var w=Os(S),M=!w&&Gf(S),K=!w&&!M&&Xn(S),j=!w&&!M&&!K&&na(S),ft=w||M||K||j,_t=ft?Ue(S.length,String):[],mt=_t.length;for(var yt in S)Xe.call(S,yt)&&!(ft&&(yt=="length"||K&&(yt=="offset"||yt=="parent")||j&&(yt=="buffer"||yt=="byteLength"||yt=="byteOffset")||Rf(yt,mt)))&&_t.push(yt);return _t}function Dn(S,y){for(var w=S.length;w--;)if(Un(S[w][0],y))return w;return-1}function Tf(S,y,w){var M=y(S);return Os(S)?M:Ft(M,w(S))}function ks(S){return S==null?S===void 0?R:b:fr&&fr in Object(S)?Af(S):ia(S)}function ul(S){return Bs(S)&&ks(S)==a}function dl(S,y,w,M,K){return S===y?!0:S==null||y==null||!Bs(S)&&!Bs(y)?S!==S&&y!==y:On(S,y,w,M,dl,K)}function On(S,y,w,M,K,j){var ft=Os(S),_t=Os(y),mt=ft?h:ei(S),yt=_t?h:ei(y);mt=mt==a?_:mt,yt=yt==a?_:yt;var Nt=mt==_,kt=yt==_,Ht=mt==yt;if(Ht&&Xn(S)){if(!Xn(y))return!1;ft=!0,Nt=!1}if(Ht&&!Nt)return j||(j=new Vi),ft||na(S)?ea(S,y,w,M,K,j):Ef(S,y,mt,w,M,K,j);if(!(w&s)){var ge=Nt&&Xe.call(S,"__wrapped__"),ye=kt&&Xe.call(y,"__wrapped__");if(ge||ye){var yi=ge?S.value():S,gr=ye?y.value():y;return j||(j=new Vi),K(yi,gr,w,M,j)}}return Ht?(j||(j=new Vi),If(S,y,w,M,K,j)):!1}function ta(S){if(!sa(S)||Lf(S))return!1;var y=Kr(S)?Qd:U;return y.test(gi(S))}function Sf(S){return Bs(S)&&pl(S.length)&&!!Q[ks(S)]}function Cf(S){if(!Bn(S))return qd(S);var y=[];for(var w in Object(S))Xe.call(S,w)&&w!="constructor"&&y.push(w);return y}function ea(S,y,w,M,K,j){var ft=w&s,_t=S.length,mt=y.length;if(_t!=mt&&!(ft&&mt>_t))return!1;var yt=j.get(S);if(yt&&j.get(y))return yt==y;var Nt=-1,kt=!0,Ht=w&n?new Ns:void 0;for(j.set(S,y),j.set(y,S);++Nt<_t;){var ge=S[Nt],ye=y[Nt];if(M)var yi=ft?M(ye,ge,Nt,y,S,j):M(ge,ye,Nt,S,y,j);if(yi!==void 0){if(yi)continue;kt=!1;break}if(Ht){if(!Re(y,function(gr,Us){if(!Wr(Ht,Us)&&(ge===gr||K(ge,gr,w,M,j)))return Ht.push(Us)})){kt=!1;break}}else if(!(ge===ye||K(ge,ye,w,M,j))){kt=!1;break}}return j.delete(S),j.delete(y),kt}function Ef(S,y,w,M,K,j,ft){switch(w){case P:if(S.byteLength!=y.byteLength||S.byteOffset!=y.byteOffset)return!1;S=S.buffer,y=y.buffer;case F:return!(S.byteLength!=y.byteLength||!j(new Ps(S),new Ps(y)));case c:case u:case g:return Un(+S,+y);case d:return S.name==y.name&&S.message==y.message;case T:case E:return S==y+"";case m:var _t=Gn;case C:var mt=M&s;if(_t||(_t=sl),S.size!=y.size&&!mt)return!1;var yt=ft.get(S);if(yt)return yt==y;M|=n,ft.set(S,y);var Nt=ea(_t(S),_t(y),M,K,j,ft);return ft.delete(S),Nt;case I:if(Zi)return Zi.call(S)==Zi.call(y)}return!1}function If(S,y,w,M,K,j){var ft=w&s,_t=fl(S),mt=_t.length,yt=fl(y),Nt=yt.length;if(mt!=Nt&&!ft)return!1;for(var kt=mt;kt--;){var Ht=_t[kt];if(!(ft?Ht in y:Xe.call(y,Ht)))return!1}var ge=j.get(S);if(ge&&j.get(y))return ge==y;var ye=!0;j.set(S,y),j.set(y,S);for(var yi=ft;++kt<mt;){Ht=_t[kt];var gr=S[Ht],Us=y[Ht];if(M)var Ab=ft?M(Us,gr,Ht,y,S,j):M(gr,Us,Ht,S,y,j);if(!(Ab===void 0?gr===Us||K(gr,Us,w,M,j):Ab)){ye=!1;break}yi||(yi=Ht=="constructor")}if(ye&&!yi){var gl=S.constructor,yl=y.constructor;gl!=yl&&"constructor"in S&&"constructor"in y&&!(typeof gl=="function"&&gl instanceof gl&&typeof yl=="function"&&yl instanceof yl)&&(ye=!1)}return j.delete(S),j.delete(y),ye}function fl(S){return Tf(S,Ff,Mf)}function Ds(S,y){var w=S.__data__;return Pf(y)?w[typeof y=="string"?"string":"hash"]:w.map}function Hr(S,y){var w=Ln(S,y);return ta(w)?w:void 0}function Af(S){var y=Xe.call(S,fr),w=S[fr];try{S[fr]=void 0;var M=!0}catch{}var K=zo.call(S);return M&&(y?S[fr]=w:delete S[fr]),K}var Mf=jo?function(S){return S==null?[]:(S=Object(S),At(jo(S),function(y){return al.call(S,y)}))}:Nf,ei=ks;(di&&ei(new di(new ArrayBuffer(1)))!=P||Gs&&ei(new Gs)!=m||Jo&&ei(Jo.resolve())!=x||$o&&ei(new $o)!=C||Qo&&ei(new Qo)!=N)&&(ei=function(S){var y=ks(S),w=y==_?S.constructor:void 0,M=w?gi(w):"";if(M)switch(M){case fi:return P;case tf:return m;case ef:return x;case rf:return C;case sf:return N}return y});function Rf(S,y){return y=y??o,!!y&&(typeof S=="number"||tt.test(S))&&S>-1&&S%1==0&&S<y}function Pf(S){var y=typeof S;return y=="string"||y=="number"||y=="symbol"||y=="boolean"?S!=="__proto__":S===null}function Lf(S){return!!Yo&&Yo in S}function Bn(S){var y=S&&S.constructor,w=typeof y=="function"&&y.prototype||Fn;return S===w}function ia(S){return zo.call(S)}function gi(S){if(S!=null){try{return Ko.call(S)}catch{}try{return S+""}catch{}}return""}function Un(S,y){return S===y||S!==S&&y!==y}var Gf=ul(function(){return arguments}())?ul:function(S){return Bs(S)&&Xe.call(S,"callee")&&!al.call(S,"callee")},Os=Array.isArray;function ra(S){return S!=null&&pl(S.length)&&!Kr(S)}var Xn=Ls||ml;function mr(S,y){return dl(S,y)}function Kr(S){if(!sa(S))return!1;var y=ks(S);return y==f||y==p||y==l||y==v}function pl(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function sa(S){var y=typeof S;return S!=null&&(y=="object"||y=="function")}function Bs(S){return S!=null&&typeof S=="object"}var na=gt?Ho(gt):Sf;function Ff(S){return ra(S)?wf(S):Cf(S)}function Nf(){return[]}function ml(){return!1}r.exports=mr}(bh,bh.exports);var JS=bh.exports;const Eg=Zs(JS);class Ke{constructor(t){this.parent=t,this.paused=!1}destroy(){}down(t){return!1}move(t){return!1}up(t){return!1}wheel(t){return!1}update(t){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var $S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function QS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ig={exports:{}};(function(r,t){(function(){var e,i;i=function(s){return r.exports=s},e={linear:function(s,n,o,a){return o*s/a+n},easeInQuad:function(s,n,o,a){return o*(s/=a)*s+n},easeOutQuad:function(s,n,o,a){return-o*(s/=a)*(s-2)+n},easeInOutQuad:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s+n:-o/2*(--s*(s-2)-1)+n},easeInCubic:function(s,n,o,a){return o*(s/=a)*s*s+n},easeOutCubic:function(s,n,o,a){return o*((s=s/a-1)*s*s+1)+n},easeInOutCubic:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s+n:o/2*((s-=2)*s*s+2)+n},easeInQuart:function(s,n,o,a){return o*(s/=a)*s*s*s+n},easeOutQuart:function(s,n,o,a){return-o*((s=s/a-1)*s*s*s-1)+n},easeInOutQuart:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s+n:-o/2*((s-=2)*s*s*s-2)+n},easeInQuint:function(s,n,o,a){return o*(s/=a)*s*s*s*s+n},easeOutQuint:function(s,n,o,a){return o*((s=s/a-1)*s*s*s*s+1)+n},easeInOutQuint:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s*s+n:o/2*((s-=2)*s*s*s*s+2)+n},easeInSine:function(s,n,o,a){return-o*Math.cos(s/a*(Math.PI/2))+o+n},easeOutSine:function(s,n,o,a){return o*Math.sin(s/a*(Math.PI/2))+n},easeInOutSine:function(s,n,o,a){return-o/2*(Math.cos(Math.PI*s/a)-1)+n},easeInExpo:function(s,n,o,a){return s===0?n:o*Math.pow(2,10*(s/a-1))+n},easeOutExpo:function(s,n,o,a){return s===a?n+o:o*(-Math.pow(2,-10*s/a)+1)+n},easeInOutExpo:function(s,n,o,a){return(s/=a/2)<1?o/2*Math.pow(2,10*(s-1))+n:o/2*(-Math.pow(2,-10*--s)+2)+n},easeInCirc:function(s,n,o,a){return-o*(Math.sqrt(1-(s/=a)*s)-1)+n},easeOutCirc:function(s,n,o,a){return o*Math.sqrt(1-(s=s/a-1)*s)+n},easeInOutCirc:function(s,n,o,a){return(s/=a/2)<1?-o/2*(Math.sqrt(1-s*s)-1)+n:o/2*(Math.sqrt(1-(s-=2)*s)+1)+n},easeInElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n},easeOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*s)*Math.sin((s*a-c)*(2*Math.PI)/l)+o+n},easeInOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a/2),l||(l=a*(.3*1.5)),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),s<1?-.5*(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n:h*Math.pow(2,-10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l)*.5+o+n},easeInBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*(s/=a)*s*((h+1)*s-h)+n},easeOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*((s=s/a-1)*s*((h+1)*s+h)+1)+n},easeInOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),(s/=a/2)<1?o/2*(s*s*(((h*=1.525)+1)*s-h))+n:o/2*((s-=2)*s*(((h*=1.525)+1)*s+h)+2)+n},easeInBounce:function(s,n,o,a){var h;return h=e.easeOutBounce(a-s,0,o,a),o-h+n},easeOutBounce:function(s,n,o,a){return(s/=a)<1/2.75?o*(7.5625*s*s)+n:s<2/2.75?o*(7.5625*(s-=1.5/2.75)*s+.75)+n:s<2.5/2.75?o*(7.5625*(s-=2.25/2.75)*s+.9375)+n:o*(7.5625*(s-=2.625/2.75)*s+.984375)+n},easeInOutBounce:function(s,n,o,a){var h;return s<a/2?(h=e.easeInBounce(s*2,0,o,a),h*.5+n):(h=e.easeOutBounce(s*2-a,0,o,a),h*.5+o*.5+n)}},i(e)}).call($S)})(Ig);var qS=Ig.exports;const Ag=QS(qS);function xh(r,t){if(r){if(typeof r=="function")return r;if(typeof r=="string")return Ag[r]}else return Ag[t]}const tC={removeOnInterrupt:!1,ease:"linear",time:1e3};class eC extends Ke{constructor(t,e={}){super(t),this.startWidth=null,this.startHeight=null,this.deltaWidth=null,this.deltaHeight=null,this.width=null,this.height=null,this.time=0,this.options=Object.assign({},tC,e),this.options.ease=xh(this.options.ease),this.setupPosition(),this.setupZoom(),this.time=0}setupPosition(){typeof this.options.position<"u"?(this.startX=this.parent.center.x,this.startY=this.parent.center.y,this.deltaX=this.options.position.x-this.parent.center.x,this.deltaY=this.options.position.y-this.parent.center.y,this.keepCenter=!1):this.keepCenter=!0}setupZoom(){this.width=null,this.height=null,typeof this.options.scale<"u"?this.width=this.parent.screenWidth/this.options.scale:typeof this.options.scaleX<"u"||typeof this.options.scaleY<"u"?(typeof this.options.scaleX<"u"&&(this.width=this.parent.screenWidth/this.options.scaleX),typeof this.options.scaleY<"u"&&(this.height=this.parent.screenHeight/this.options.scaleY)):(typeof this.options.width<"u"&&(this.width=this.options.width),typeof this.options.height<"u"&&(this.height=this.options.height)),this.width!==null&&(this.startWidth=this.parent.screenWidthInWorldPixels,this.deltaWidth=this.width-this.startWidth),this.height!==null&&(this.startHeight=this.parent.screenHeightInWorldPixels,this.deltaHeight=this.height-this.startHeight)}down(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("animate"),!1}complete(){this.parent.plugins.remove("animate"),this.width!==null&&this.parent.fitWidth(this.width,this.keepCenter,this.height===null),this.height!==null&&this.parent.fitHeight(this.height,this.keepCenter,this.width===null),!this.keepCenter&&this.options.position&&this.parent.moveCenter(this.options.position),this.parent.emit("animate-end",this.parent),this.options.callbackOnComplete&&this.options.callbackOnComplete(this.parent)}update(t){if(this.paused)return;this.time+=t;const e=new ct(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,s=this.parent.height;this.complete(),(i!==this.parent.width||s!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const s=this.startWidth,n=this.deltaWidth;this.parent.fitWidth(s+n*i,this.keepCenter,this.height===null)}if(this.height!==null){const s=this.startHeight,n=this.deltaHeight;this.parent.fitHeight(s+n*i,this.keepCenter,this.width===null)}if(this.width===null?this.parent.scale.x=this.parent.scale.y:this.height===null&&(this.parent.scale.y=this.parent.scale.x),!this.keepCenter){const s=this.startX,n=this.startY,o=this.deltaX,a=this.deltaY,h=new ct(this.parent.x,this.parent.y);this.parent.moveCenter(s+o*i,n+a*i),this.parent.emit("moved",{viewport:this.parent,original:h,type:"animate"})}(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}}}const iC={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class rC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},iC,e),this.ease=xh(this.options.ease,"easeInOutSine"),this.options.sides?this.options.sides==="all"?this.top=this.bottom=this.left=this.right=!0:this.options.sides==="horizontal"?(this.right=this.left=!0,this.top=this.bottom=!1):this.options.sides==="vertical"?(this.left=this.right=!1,this.top=this.bottom=!0):(this.top=this.options.sides.indexOf("top")!==-1,this.bottom=this.options.sides.indexOf("bottom")!==-1,this.left=this.options.sides.indexOf("left")!==-1,this.right=this.options.sides.indexOf("right")!==-1):this.left=this.top=this.right=this.bottom=!1;const i=this.options.underflow.toLowerCase();i==="center"?(this.underflowX=0,this.underflowY=0):(this.underflowX=i.indexOf("left")!==-1?-1:i.indexOf("right")!==-1?1:0,this.underflowY=i.indexOf("top")!==-1?-1:i.indexOf("bottom")!==-1?1:0),this.reset()}isActive(){return this.toX!==null||this.toY!==null}down(){return this.toX=this.toY=null,!1}up(){return this.bounce(),!1}update(t){if(!this.paused){if(this.bounce(),this.toX){const e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)}if(this.toY){const e=this.toY;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),e.time>=this.options.time?(this.parent.y=e.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(e.time,e.start,e.delta,this.options.time)}}}calcUnderflowX(){let t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}calcUnderflowY(){let t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}oob(){const t=this.options.bounceBox;if(t){const e=typeof t.x>"u"?0:t.x,i=typeof t.y>"u"?0:t.y,s=typeof t.width>"u"?this.parent.worldWidth:t.width,n=typeof t.height>"u"?this.parent.worldHeight:t.height;return{left:this.parent.left<e,right:this.parent.right>s,top:this.parent.top<i,bottom:this.parent.bottom>n,topLeft:new ct(e*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new ct(s*this.parent.scale.x-this.parent.screenWidth,n*this.parent.scale.y-this.parent.screenHeight)}}return{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new ct(0,0),bottomRight:new ct(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){var t,e;if(this.paused)return;let i,s=this.parent.plugins.get("decelerate",!0);s&&(s.x||s.y)&&(s.x&&s.percentChangeX===((t=s.options)==null?void 0:t.friction)||s.y&&s.percentChangeY===((e=s.options)==null?void 0:e.friction))&&(i=this.oob(),(i.left&&this.left||i.right&&this.right)&&(s.percentChangeX=this.options.friction),(i.top&&this.top||i.bottom&&this.bottom)&&(s.percentChangeY=this.options.friction));const n=this.parent.plugins.get("drag",!0)||{},o=this.parent.plugins.get("pinch",!0)||{};if(s=s||{},!(n!=null&&n.active)&&!(o!=null&&o.active)&&(!this.toX||!this.toY)&&(!s.x||!s.y)){i=i||this.oob();const a=i.topLeft,h=i.bottomRight;if(!this.toX&&!s.x){let l=null;i.left&&this.left?l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x:i.right&&this.right&&(l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-h.x),l!==null&&this.parent.x!==l&&(this.toX={time:0,start:this.parent.x,delta:l-this.parent.x,end:l},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!s.y){let l=null;i.top&&this.top?l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y:i.bottom&&this.bottom&&(l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-h.y),l!==null&&this.parent.y!==l&&(this.toY={time:0,start:this.parent.y,delta:l-this.parent.y,end:l},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const sC={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class nC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},sC,e),this.options.direction&&(this.options.left=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.right=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.top=this.options.direction==="y"||this.options.direction==="all"?!0:null,this.options.bottom=this.options.direction==="y"||this.options.direction==="all"?!0:null),this.parseUnderflow(),this.last={x:null,y:null,scaleX:null,scaleY:null},this.update()}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="none"?this.noUnderflow=!0:t==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=t.indexOf("left")!==-1?-1:t.indexOf("right")!==-1?1:0,this.underflowY=t.indexOf("top")!==-1?-1:t.indexOf("bottom")!==-1?1:0,this.noUnderflow=!1)}move(){return this.update(),!1}update(){if(this.paused||this.parent.x===this.last.x&&this.parent.y===this.last.y&&this.parent.scale.x===this.last.scaleX&&this.parent.scale.y===this.last.scaleY)return;const t=new ct(this.parent.x,this.parent.y),e=this.parent.plugins.decelerate||{};if(this.options.left!==null||this.options.right!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x!==0&&(this.parent.x=0,i=!0);break;case 1:this.parent.x!==this.parent.screenWidth-this.parent.screenWorldWidth&&(this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth,i=!0);break;default:this.parent.x!==(this.parent.screenWidth-this.parent.screenWorldWidth)/2&&(this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2,i=!0)}else this.options.left!==null&&this.parent.left<(this.options.left===!0?0:this.options.left)&&(this.parent.x=-(this.options.left===!0?0:this.options.left)*this.parent.scale.x,e.x=0,i=!0),this.options.right!==null&&this.parent.right>(this.options.right===!0?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(this.options.right===!0?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,e.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(this.options.top!==null||this.options.bottom!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y!==0&&(this.parent.y=0,i=!0);break;case 1:this.parent.y!==this.parent.screenHeight-this.parent.screenWorldHeight&&(this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight,i=!0);break;default:this.parent.y!==(this.parent.screenHeight-this.parent.screenWorldHeight)/2&&(this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2,i=!0)}else this.options.top!==null&&this.parent.top<(this.options.top===!0?0:this.options.top)&&(this.parent.y=-(this.options.top===!0?0:this.options.top)*this.parent.scale.y,e.y=0,i=!0),this.options.bottom!==null&&this.parent.bottom>(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,e.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}reset(){this.update()}}const oC={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class aC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},oC,e),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&t<this.options.minWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.minWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&t>this.options.maxWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&e<this.options.minHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.minHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&e>this.options.maxHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}else if(this.options.minScale||this.options.maxScale){const t={x:null,y:null},e={x:null,y:null};if(typeof this.options.minScale=="number")t.x=this.options.minScale,t.y=this.options.minScale;else if(this.options.minScale!==null){const n=this.options.minScale;t.x=typeof n.x>"u"?null:n.x,t.y=typeof n.y>"u"?null:n.y}if(typeof this.options.maxScale=="number")e.x=this.options.maxScale,e.y=this.options.maxScale;else if(this.options.maxScale!==null){const n=this.options.maxScale;e.x=typeof n.x>"u"?null:n.x,e.y=typeof n.y>"u"?null:n.y}let i=this.parent.scale.x,s=this.parent.scale.y;t.x!==null&&i<t.x&&(i=t.x),e.x!==null&&i>e.x&&(i=e.x),t.y!==null&&s<t.y&&(s=t.y),e.y!==null&&s>e.y&&(s=e.y),(i!==this.parent.scale.x||s!==this.parent.scale.y)&&(this.parent.scale.set(i,s),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const hC={friction:.98,bounce:.8,minSpeed:.01},Pr=16;class lC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},hC,e),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.handleMoved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const t=this.parent.input.count();return(t===1||t>1&&!this.parent.plugins.get("pinch",!0))&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30)),!1}handleMoved(t){if(this.saved.length){const e=this.saved[this.saved.length-1];t.type==="clamp-x"&&t.original?e.x===t.original.x&&(e.x=this.parent.x):t.type==="clamp-y"&&t.original&&e.y===t.original.y&&(e.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const t=performance.now();for(const e of this.saved)if(e.time>=t-100){const i=t-e.time;this.x=(this.parent.x-e.x)/i,this.y=(this.parent.y-e.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(t){t=t||{},typeof t.x<"u"&&(this.x=t.x,this.percentChangeX=this.options.friction),typeof t.y<"u"&&(this.y=t.y,this.percentChangeY=this.options.friction)}update(t){if(this.paused)return;const e=this.x||this.y,i=this.timeSinceRelease,s=this.timeSinceRelease+t;if(this.x){const n=this.percentChangeX,o=Math.log(n);this.parent.x+=this.x*Pr/o*(Math.pow(n,s/Pr)-Math.pow(n,i/Pr)),this.x*=Math.pow(this.percentChangeX,t/Pr)}if(this.y){const n=this.percentChangeY,o=Math.log(n);this.parent.y+=this.y*Pr/o*(Math.pow(n,s/Pr)-Math.pow(n,i/Pr)),this.y*=Math.pow(this.percentChangeY,t/Pr)}this.timeSinceRelease+=t,this.x&&this.y?Math.abs(this.x)<this.options.minSpeed&&Math.abs(this.y)<this.options.minSpeed&&(this.x=0,this.y=0):(Math.abs(this.x||0)<this.options.minSpeed&&(this.x=0),Math.abs(this.y||0)<this.options.minSpeed&&(this.y=0)),e&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const cC={direction:"all",pressDrag:!0,wheel:!0,wheelScroll:1,reverse:!1,clampWheel:!1,underflow:"center",factor:1,mouseButtons:"all",keyToPress:null,ignoreKeyToPressOnTouch:!1,lineHeight:20,wheelSwapAxes:!1};class uC extends Ke{constructor(t,e={}){super(t),this.windowEventHandlers=[],this.options=Object.assign({},cC,e),this.moved=!1,this.reverse=this.options.reverse?1:-1,this.xDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="x",this.yDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="y",this.keyIsPressed=!1,this.parseUnderflow(),this.mouseButtons(this.options.mouseButtons),this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){const e=s=>{t.includes(s.code)&&(this.keyIsPressed=!0)},i=s=>{t.includes(s.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",e)}addWindowEventHandler(t,e){typeof window>"u"||(window.addEventListener(t,e),this.windowEventHandlers.push({event:t,handler:e}))}destroy(){typeof window>"u"||this.windowEventHandlers.forEach(({event:t,handler:e})=>{window.removeEventListener(t,e)})}mouseButtons(t){!t||t==="all"?this.mouse=[!0,!0,!0]:this.mouse=[t.indexOf("left")!==-1,t.indexOf("middle")!==-1,t.indexOf("right")!==-1]}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="center"?(this.underflowX=0,this.underflowY=0):(t.includes("left")?this.underflowX=-1:t.includes("right")?this.underflowX=1:this.underflowX=0,t.includes("top")?this.underflowY=-1:t.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(t){const e=t.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!e||this.mouse[t.button]))}checkKeyPress(t){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&t.data.pointerType==="touch"}down(t){return this.paused||!this.options.pressDrag?!1:this.checkButtons(t)&&this.checkKeyPress(t)?(this.last={x:t.global.x,y:t.global.y},this.current=t.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(t){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===t.data.pointerId){const e=t.global.x,i=t.global.y,s=this.parent.input.count();if(s===1||s>1&&!this.parent.plugins.get("pinch",!0)){const n=e-this.last.x,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(n)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:e,y:i};return this.xDirection&&(this.parent.x+=(a.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(a.y-this.last.y)*this.options.factor),this.last=a,this.moved||this.parent.emit("drag-start",{event:t,screen:new ct(this.last.x,this.last.y),world:this.parent.toWorld(new ct(this.last.x,this.last.y)),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}return!1}up(t){if(this.paused)return!1;const e=this.parent.input.touches;if(e.length===1){const i=e[0];return i.last&&(this.last={x:i.last.x,y:i.last.y},this.current=i.id),this.moved=!1,!0}else if(this.last&&this.moved){const i=new ct(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:t,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(t){if(this.paused)return!1;if(this.options.wheel){const e=this.parent.plugins.get("wheel",!0);if(!e||!e.options.wheelZoom&&!t.ctrlKey){const i=t.deltaMode?this.options.lineHeight:1,s=[t.deltaX,t.deltaY],[n,o]=this.options.wheelSwapAxes?s.reverse():s;return this.xDirection&&(this.parent.x+=n*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=o*i*this.options.wheelScroll*this.reverse),this.options.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.options.passiveWheel||t.preventDefault(),this.parent.options.stopPropagation&&t.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const t=this.parent.plugins.get("decelerate",!0)||{};if(this.options.clampWheel!=="y")if(this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x=0;break;case 1:this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}else this.parent.left<0?(this.parent.x=0,t.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if(this.options.clampWheel!=="x")if(this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y=0;break;case 1:this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}else this.parent.top<0&&(this.parent.y=0,t.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}}const dC={speed:0,acceleration:null,radius:null};class fC extends Ke{constructor(t,e,i={}){super(t),this.target=e,this.options=Object.assign({},dC,i),this.velocity={x:0,y:0}}update(t){if(this.paused)return;const e=this.parent.center;let i=this.target.x,s=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.options.radius){const a=Math.atan2(this.target.y-e.y,this.target.x-e.x);i=this.target.x-Math.cos(a)*this.options.radius,s=this.target.y-Math.sin(a)*this.options.radius}else return;const n=i-e.x,o=s-e.y;if(n||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(s-e.y,i-e.x),h=Math.sqrt(Math.pow(n,2)+Math.pow(o,2));if(h){const l=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>l?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*t,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*t,this.options.speed))}:this.velocity={x:Math.max(this.velocity.x-this.options.acceleration*this.options.speed,0),y:Math.max(this.velocity.y-this.options.acceleration*this.options.speed,0)};const c=Math.cos(a)*this.velocity.x,u=Math.sin(a)*this.velocity.y,d=Math.abs(c)>Math.abs(n)?i:e.x+c,f=Math.abs(u)>Math.abs(o)?s:e.y+u;this.parent.moveCenter(d,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(s-e.y,i-e.x),h=Math.cos(a)*this.options.speed,l=Math.sin(a)*this.options.speed,c=Math.abs(h)>Math.abs(n)?i:e.x+h,u=Math.abs(l)>Math.abs(o)?s:e.y+l;this.parent.moveCenter(c,u),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,s),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const pC={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class mC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},pC,e),this.reverse=this.options.reverse?1:-1,this.radiusSquared=typeof this.options.radius=="number"?Math.pow(this.options.radius,2):null,this.resize()}resize(){const t=this.options.distance;t!==null?(this.left=t,this.top=t,this.right=this.parent.screenWidth-t,this.bottom=this.parent.screenHeight-t):this.options.radius||(this.left=this.options.left,this.top=this.options.top,this.right=this.options.right===null?null:this.parent.screenWidth-this.options.right,this.bottom=this.options.bottom===null?null:this.parent.screenHeight-this.options.bottom)}down(){return this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null),!1}move(t){if(this.paused||t.pointerType!=="mouse"&&t.pointerId!==1||!this.options.allowButtons&&t.buttons!==0)return!1;const e=t.global.x,i=t.global.y;if(this.radiusSquared){const s=this.parent.toScreen(this.parent.center);if(Math.pow(s.x-e,2)+Math.pow(s.y-i,2)>=this.radiusSquared){const n=Math.atan2(s.y-i,s.x-e);this.options.linear?(this.horizontal=Math.round(Math.cos(n))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(n))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(n)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(n)*this.options.speed*this.reverse*(60/1e3))}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else this.left!==null&&e<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&e>this.right?this.horizontal=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateHorizontal(),this.horizontal=0),this.top!==null&&i<this.top?this.vertical=Number(this.reverse)*this.options.speed*(60/1e3):this.bottom!==null&&i>this.bottom?this.vertical=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateVertical(),this.vertical=0);return!1}decelerateHorizontal(){const t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}up(){return this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null),!1}update(){if(!this.paused&&(this.horizontal||this.vertical)){const t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const gC={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class yC extends Ke{constructor(t,e={}){super(t),this.active=!1,this.pinching=!1,this.moved=!1,this.options=Object.assign({},gC,e)}down(){return this.parent.input.count()>=2?(this.active=!0,!0):!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}move(t){if(this.paused||!this.active)return!1;const e=t.global.x,i=t.global.y,s=this.parent.input.touches;if(s.length>=2){const n=s[0],o=s[1],a=n.last&&o.last?Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2)):null;if(n.id===t.pointerId?n.last={x:e,y:i,data:t}:o.id===t.pointerId&&(o.last={x:e,y:i,data:t}),a){let h;const l=new ct(n.last.x+(o.last.x-n.last.x)/2,n.last.y+(o.last.y-n.last.y)/2);this.options.center||(h=this.parent.toLocal(l));let c=Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2));c=c===0?c=1e-10:c;const u=(1-a/c)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=u),this.isAxisY()&&(this.parent.scale.y+=u),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:l});const d=this.parent.plugins.get("clamp-zoom",!0);if(d&&d.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const f=this.parent.toGlobal(h);this.parent.x+=(l.x-f.x)*this.options.factor,this.parent.y+=(l.y-f.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(l.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(l.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=l,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}return!1}up(){return this.pinching&&this.parent.input.touches.length<=1?(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0):!1}}const bC={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class xC extends Ke{constructor(t,e,i,s={}){super(t),this.options=Object.assign({},bC,s),this.ease=xh(s.ease,"easeInOutSine"),this.x=e,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.y,this.parent.emit("snap-start",this.parent)}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null),!1}up(){if(this.parent.input.count()===0){const t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction)}return!1}update(t){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const e=this.snapping;e.time+=t;let i,s,n;const o=this.startX,a=this.startY,h=this.deltaX,l=this.deltaY;if(e.time>this.options.time)i=!0,s=o+h,n=a+l;else{const c=this.ease(e.time,0,1,this.options.time);s=o+h*c,n=a+l*c}this.options.topLeft?this.parent.moveCorner(s,n):this.parent.moveCenter(s,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),i&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{const e=this.options.topLeft?this.parent.corner:this.parent.center;(e.x!==this.x||e.y!==this.y)&&this.snapStart()}}}const _C={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class vC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},_C,e),this.ease=xh(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=t.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=t.screenHeight/this.options.height,this.yIndependent=!0),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale,this.options.time===0?(t.container.scale.x=this.xScale,t.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):e.forceStart&&this.createSnapping()}createSnapping(){const t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,s=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:t,startY:e,deltaX:i-t,deltaY:s-e},this.parent.emit("snap-zoom-start",this.parent)}resize(){this.snapping=null,this.options.width>0&&(this.xScale=this.parent.screenWidth/this.options.width),this.options.height>0&&(this.yScale=this.parent.screenHeight/this.options.height),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap-zoom"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap-zoom"):this.options.interrupt&&(this.snapping=null),!1}update(t){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let e;if(!this.options.center&&!this.options.noMove&&(e=this.parent.center),!this.snapping)(this.parent.scale.x!==this.xScale||this.parent.scale.y!==this.yScale)&&this.createSnapping();else if(this.snapping){const i=this.snapping;if(i.time+=t,i.time>=this.options.time)this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{const n=this.snapping,o=this.ease(n.time,n.startX,n.deltaX,this.options.time),a=this.ease(n.time,n.startY,n.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}const s=this.parent.plugins.get("clamp-zoom",!0);s&&s.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(e))}}resume(){this.snapping=null,super.resume()}}const wC={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class TC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},wC,e),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){typeof window>"u"||(window.addEventListener("keydown",e=>{t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.code)&&(this.keyIsPressed=!1)}))}checkKeyPress(){return!this.options.keyToPress||this.keyIsPressed}down(){return this.options.interrupt&&(this.smoothing=null),!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}update(){if(this.smoothing){const t=this.smoothingCenter,e=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x+=e.x),this.isAxisY()&&(this.parent.scale.y+=e.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const s=this.parent.plugins.get("clamp-zoom",!0);if(s&&s.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const n=this.parent.toGlobal(i);this.parent.x+=t.x-n.x,this.parent.y+=t.y-n.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(t){if(this.paused)return;const e=this.parent.input.getPointerPosition(t),i=-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/200,s=Math.pow(2,(1+this.options.percent)*i);let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}wheel(t){if(this.paused||!this.checkKeyPress())return!1;if(t.ctrlKey&&this.options.trackpadPinch)this.pinch(t);else if(this.options.wheelZoom){const e=this.parent.input.getPointerPosition(t),i=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*i);if(this.options.smooth){const n={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+n.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+n.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}return!this.parent.options.passiveWheel}}class SC{constructor(t){this.viewport=t,this.touches=[],this.addListeners()}addListeners(){this.viewport.eventMode="static",this.viewport.forceHitArea||(this.viewport.hitArea=new pt(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.options.allowPreserveDragOutside?this.viewport.on("globalpointermove",this.move,this):this.viewport.on("pointermove",this.move,this),this.viewport.on("pointerup",this.up,this),this.viewport.on("pointerupoutside",this.up,this),this.viewport.on("pointercancel",this.up,this),this.viewport.options.allowPreserveDragOutside||this.viewport.on("pointerleave",this.up,this),this.wheelFunction=t=>this.handleWheel(t),this.viewport.options.events.domElement.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){var t;(t=this.viewport.options.events.domElement)==null||t.removeEventListener("wheel",this.wheelFunction)}down(t){if(!(this.viewport.pause||!this.viewport.visible)){if(t.pointerType==="mouse"?this.isMouseDown=!0:this.get(t.pointerId)||this.touches.push({id:t.pointerId,last:null}),this.count()===1){this.last=t.global.clone();const e=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0);(!e||!e.isActive())&&(!i||!i.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(t)&&this.viewport.options.stopPropagation&&t.stopPropagation()}}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(t){return Math.abs(t)>=this.viewport.threshold}move(t){if(this.viewport.pause||!this.viewport.visible)return;const e=this.viewport.plugins.move(t);if(this.clickedAvailable&&this.last){const i=t.global.x-this.last.x,s=t.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}e&&this.viewport.options.stopPropagation&&t.stopPropagation()}up(t){if(this.viewport.pause||!this.viewport.visible)return;t.pointerType==="mouse"&&(this.isMouseDown=!1),t.pointerType!=="mouse"&&this.remove(t.pointerId);const e=this.viewport.plugins.up(t);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this.viewport}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation()}getPointerPosition(t){const e=new ct;return this.viewport.options.events.mapPositionToPoint(e,t.clientX,t.clientY),e}handleWheel(t){if(this.viewport.pause||!this.viewport.visible)return;const e=this.viewport.toLocal(this.getPointerPosition(t));this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom&&this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(t){for(const e of this.touches)if(e.id===t)return e;return null}remove(t){for(let e=0;e<this.touches.length;e++)if(this.touches[e].id===t){this.touches.splice(e,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}const po=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class CC{constructor(t){this.viewport=t,this.list=[],this.plugins={}}add(t,e,i=po.length){const s=this.plugins[t];s&&s.destroy(),this.plugins[t]=e;const n=po.indexOf(t);n!==-1&&po.splice(n,1),po.splice(i,0,t),this.sort()}get(t,e){var i;return e&&(i=this.plugins[t])!=null&&i.paused?null:this.plugins[t]}update(t){for(const e of this.list)e.update(t)}resize(){for(const t of this.list)t.resize()}reset(){for(const t of this.list)t.reset()}removeAll(){this.list.forEach(t=>{t.destroy()}),this.plugins={},this.sort()}remove(t){var e;this.plugins[t]&&((e=this.plugins[t])==null||e.destroy(),delete this.plugins[t],this.viewport.emit("plugin-remove",t),this.sort())}pause(t){var e;(e=this.plugins[t])==null||e.pause()}resume(t){var e;(e=this.plugins[t])==null||e.resume()}sort(){this.list=[];for(const t of po)this.plugins[t]&&this.list.push(this.plugins[t])}down(t){let e=!1;for(const i of this.list)i.down(t)&&(e=!0);return e}move(t){let e=!1;for(const i of this.viewport.plugins.list)i.move(t)&&(e=!0);return e}up(t){let e=!1;for(const i of this.list)i.up(t)&&(e=!0);return e}wheel(t){let e=!1;for(const i of this.list)i.wheel(t)&&(e=!0);return e}}const EC={screenWidth:typeof window>"u"?0:window.innerWidth,screenHeight:typeof window>"u"?0:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,disableOnContextMenu:!1,ticker:_e.shared,allowPreserveDragOutside:!1};class IC extends Tt{constructor(t){super(),this._disableOnContextMenu=e=>e.preventDefault(),this.options={...EC,...t},this.screenWidth=this.options.screenWidth,this.screenHeight=this.options.screenHeight,this._worldWidth=this.options.worldWidth,this._worldHeight=this.options.worldHeight,this.forceHitArea=this.options.forceHitArea,this.threshold=this.options.threshold,this.options.disableOnContextMenu&&this.options.events.domElement.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new SC(this),this.plugins=new CC(this)}destroy(t){var e;!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&((e=this.options.events.domElement)==null||e.removeEventListener("contextmenu",this._disableOnContextMenu)),this.input.destroy(),super.destroy(t)}update(t){this.pause||(this.plugins.update(t),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new pt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}resize(t=typeof window>"u"?0:window.innerWidth,e=typeof window>"u"?0:window.innerHeight,i,s){this.screenWidth=t,this.screenHeight=e,typeof i<"u"&&(this._worldWidth=i),typeof s<"u"&&(this._worldHeight=s),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(t){this._worldWidth=t,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(t){this._worldHeight=t,this.plugins.resize()}getVisibleBounds(){return new pt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(t,e){return arguments.length===2?this.toLocal(new ct(t,e)):this.toLocal(t)}toScreen(t,e){return arguments.length===2?this.toGlobal(new ct(t,e)):this.toGlobal(t)}get worldScreenWidth(){return this.screenWidth/this.scale.x}get worldScreenHeight(){return this.screenHeight/this.scale.y}get screenWorldWidth(){return this.worldWidth*this.scale.x}get screenWorldHeight(){return this.worldHeight*this.scale.y}get center(){return new ct(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(t){this.moveCenter(t)}moveCenter(...t){let e,i;typeof t[0]=="number"?(e=t[0],i=t[1]):(e=t[0].x,i=t[0].y);const s=(this.worldScreenWidth/2-e)*this.scale.x,n=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==s||this.y!==n)&&(this.position.set(s,n),this.plugins.reset(),this.dirty=!0),this}get corner(){return new ct(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(t){this.moveCorner(t)}moveCorner(...t){let e,i;return t.length===1?(e=-t[0].x*this.scale.x,i=-t[0].y*this.scale.y):(e=-t[0]*this.scale.x,i=-t[1]*this.scale.y),(e!==this.x||i!==this.y)&&(this.position.set(e,i),this.plugins.reset(),this.dirty=!0),this}get screenWidthInWorldPixels(){return this.screenWidth/this.scale.x}get screenHeightInWorldPixels(){return this.screenHeight/this.scale.y}findFitWidth(t){return this.screenWidth/t}findFitHeight(t){return this.screenHeight/t}findFit(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.min(i,s)}findCover(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.max(i,s)}fitWidth(t=this.worldWidth,e,i=!0,s){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,i&&(this.scale.y=this.scale.x);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitHeight(t=this.worldHeight,e,i=!0,s){let n;e&&(n=this.center),this.scale.y=this.screenHeight/t,i&&(this.scale.x=this.scale.y);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitWorld(t){let e;t&&(e=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const i=this.plugins.get("clamp-zoom",!0);return i&&i.clamp(),t&&e&&this.moveCenter(e),this}fit(t,e=this.worldWidth,i=this.worldHeight){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,this.scale.y=this.screenHeight/i,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&s&&this.moveCenter(s),this}setZoom(t,e){let i;e&&(i=this.center),this.scale.set(t);const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&i&&this.moveCenter(i),this}zoomPercent(t,e){return this.setZoom(this.scale.x+this.scale.x*t,e)}zoom(t,e){return this.fitWidth(t+this.worldScreenWidth,e),this}get scaled(){return this.scale.x}set scaled(t){this.setZoom(t,!0)}snapZoom(t){return this.plugins.add("snap-zoom",new vC(this,t)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new ct(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}get right(){return-this.x/this.scale.x+this.worldScreenWidth}set right(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(t){this.x=-t*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(t){this.y=-t*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(t){this._dirty=t}get forceHitArea(){return this._forceHitArea}set forceHitArea(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new pt(0,0,this.worldWidth,this.worldHeight))}drag(t){return this.plugins.add("drag",new uC(this,t)),this}clamp(t){return this.plugins.add("clamp",new nC(this,t)),this}decelerate(t){return this.plugins.add("decelerate",new lC(this,t)),this}bounce(t){return this.plugins.add("bounce",new rC(this,t)),this}pinch(t){return this.plugins.add("pinch",new yC(this,t)),this}snap(t,e,i){return this.plugins.add("snap",new xC(this,t,e,i)),this}follow(t,e){return this.plugins.add("follow",new fC(this,t,e)),this}wheel(t){return this.plugins.add("wheel",new TC(this,t)),this}animate(t){return this.plugins.add("animate",new eC(this,t)),this}clampZoom(t){return this.plugins.add("clamp-zoom",new aC(this,t)),this}mouseEdges(t){return this.plugins.add("mouse-edges",new mC(this,t)),this}get pause(){return!!this._pause}set pause(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}ensureVisible(t,e,i,s,n){n&&(i>this.worldScreenWidth||s>this.worldScreenHeight)&&(this.fit(!0,i,s),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let o=!1;t<this.left?(this.left=t,o=!0):t+i>this.right&&(this.right=t+i,o=!0),e<this.top?(this.top=e,o=!0):e+s>this.bottom&&(this.bottom=e+s,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const _h=1e3,Mg=Symbol.for("constructDateFrom");async function Rg(r,t){const e=await Mt();let i,s=null;async function n(){try{s=await e.fetch(r),t(s)}catch(a){console.error(a)}s&&!s.end_time&&(i=setTimeout(()=>n(),AC(s)))}function o(){clearTimeout(i)}return{start:n,stop:o}}function AC(r){const t=Math.floor(r.nodes.size/_h)*_h;return Math.max(_h,t)}function ir(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Pg(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}/*!
1159
+ }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=Cv(t)),typeof t=="number"?Sv(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,Vn.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=it.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};Cu.availableFonts={},Cu.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Eu=Cu;const mh=class Hn extends jt{constructor(t="",e={}){super(ot.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=ot.from(i,{scaleMode:it.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new pt,s.trim=new pt,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Hn.defaultMaxWidth,this.maxHeight=Hn.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Hn.defaultAutoResolution,this._resolution=Hn.defaultResolution??it.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(s)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:s}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await e.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const l=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(l)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:i,resolution:s}=this,{padding:n}=t,{baseTexture:o}=e;e.trim.width=e._frame.width=i.width/s,e.trim.height=e._frame.height=i.height/s,e.trim.x=-n,e.trim.y=-n,e.orig.width=e._frame.width-n*2,e.orig.height=e._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var i,s,n,o,a;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Hn.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=e,(s=this._svgRoot)==null||s.remove(),this._svgRoot=e,(n=this._domElement)==null||n.remove(),this._domElement=e,(o=this._foreignObject)==null||o.remove(),this._foreignObject=e,(a=this._styleElement)==null||a.remove(),this._styleElement=e,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=e,this._image.src="",this._image=e}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=_r(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=_r(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&(t=t||{},t instanceof Eu?(this.ownsStyle=!1,this._style=t):t instanceof Mr?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Eu.from(t)):(this.ownsStyle=!0,this._style=new Eu(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(t===""||t===null||t===void 0?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};mh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},mh.defaultMaxWidth=2024,mh.defaultMaxHeight=2024,mh.defaultAutoResolution=!0;function kS(){const r=new Map;function t(o,a){const h=r.get(o);return h?h.add(a):r.set(o,new Set([a])),()=>i(o,a)}function e(o,a){const h=l=>{i(o,h),a(l)};t(o,h)}function i(o,a){var h;(h=r.get(o))==null||h.delete(a)}function s(o,a){var h;(h=r.get(o))==null||h.forEach(l=>l(a))}function n(){r.clear()}return{on:t,off:i,once:e,emit:s,clear:n}}const $=kS();function Fe(r){let t;return new Promise(e=>{t=e,$.on(r,t)}).then(e=>($.off(r,t),e))}let Pi=null;const Tg=new ResizeObserver(()=>{Pi&&$.emit("stageUpdated",Pi)});function DS(r){Pi=r,Tg.observe(Pi),$.emit("stageCreated",Pi)}function OS(){Pi&&Tg.unobserve(Pi),Pi=null}async function Iu(){return Pi||await Fe("stageCreated")}let Te=null;async function BS(){const r=await Iu();XS(r),$.on("stageUpdated",WS)}function US(){Te&&(Te.destroy(!0,{children:!0}),Te=null)}function XS(r){Te||(Te=new km({backgroundAlpha:0,resizeTo:r,antialias:!0,resolution:Math.ceil(window.devicePixelRatio)}),Te.stage.sortableChildren=!0,r.appendChild(Te.view),$.emit("applicationCreated",Te),process.env.NODE_ENV==="development"&&(globalThis.__PIXI_APP__=Te))}async function Jt(){return Te||await Fe("applicationCreated")}function WS(r){Te&&(Te.resizeTo=r,$.emit("applicationResized",Te))}let gh=new Map;function ZS(){gh=new Map}async function fo(r,t){const e=`${r.toString()}-${JSON.stringify(t)}`;if(gh.has(e))return gh.get(e);const i=await r(...t);return gh.set(e,i),i}var yh={exports:{}};yh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=800,n=16,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",b="[object Null]",_="[object Object]",x="[object Proxy]",v="[object RegExp]",T="[object Set]",C="[object String]",E="[object Undefined]",I="[object WeakMap]",R="[object ArrayBuffer]",N="[object DataView]",F="[object Float32Array]",P="[object Float64Array]",A="[object Int8Array]",G="[object Int16Array]",D="[object Int32Array]",X="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",lt="[object Uint32Array]",W=/[\\^$.*+?()[\]{}|]/g,L=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,U={};U[F]=U[P]=U[A]=U[G]=U[D]=U[X]=U[B]=U[H]=U[lt]=!0,U[a]=U[h]=U[R]=U[c]=U[N]=U[u]=U[d]=U[f]=U[m]=U[g]=U[_]=U[v]=U[T]=U[C]=U[I]=!1;var tt=typeof be=="object"&&be&&be.Object===Object&&be,Q=typeof self=="object"&&self&&self.Object===Object&&self,xt=tt||Q||Function("return this")(),Ct=t&&!t.nodeType&&t,q=Ct&&!0&&r&&!r.nodeType&&r,Z=q&&q.exports===Ct,Y=Z&&tt.process,z=function(){try{var y=q&&q.require&&q.require("util").types;return y||Y&&Y.binding&&Y.binding("util")}catch{}}(),k=z&&z.isTypedArray;function ut(y,w,M){switch(M.length){case 0:return y.call(w);case 1:return y.call(w,M[0]);case 2:return y.call(w,M[0],M[1]);case 3:return y.call(w,M[0],M[1],M[2])}return y.apply(w,M)}function gt(y,w){for(var M=-1,K=Array(y);++M<y;)K[M]=w(M);return K}function At(y){return function(w){return y(w)}}function Ft(y,w){return y==null?void 0:y[w]}function Pe(y,w){return function(M){return y(w(M))}}var Ue=Array.prototype,Ho=Function.prototype,Wr=Object.prototype,Ln=xt["__core-js_shared__"],Gn=Ho.toString,Wi=Wr.hasOwnProperty,sl=function(){var y=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),nl=Wr.toString,$d=Gn.call(Object),Fn=RegExp("^"+Gn.call(Wi).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zr=Z?xt.Buffer:void 0,Ko=xt.Symbol,Xe=xt.Uint8Array;Zr&&Zr.allocUnsafe;var Yo=Pe(Object.getPrototypeOf,Object),zo=Object.create,Qd=Wr.propertyIsEnumerable,ol=Ue.splice,ti=Ko?Ko.toStringTag:void 0,Ps=function(){try{var y=ta(Object,"defineProperty");return y({},"",{}),y}catch{}}(),al=Zr?Zr.isBuffer:void 0,hl=Math.max,fr=Date.now,jo=ta(xt,"Map"),Ls=ta(Object,"create"),qd=function(){function y(){}return function(w){if(!mr(w))return{};if(zo)return zo(w);y.prototype=w;var M=new y;return y.prototype=void 0,M}}();function di(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function Gs(){this.__data__=Ls?Ls(null):{},this.size=0}function Jo(y){var w=this.has(y)&&delete this.__data__[y];return this.size-=w?1:0,w}function $o(y){var w=this.__data__;if(Ls){var M=w[y];return M===i?void 0:M}return Wi.call(w,y)?w[y]:void 0}function Qo(y){var w=this.__data__;return Ls?w[y]!==void 0:Wi.call(w,y)}function Fs(y,w){var M=this.__data__;return this.size+=this.has(y)?0:1,M[y]=Ls&&w===void 0?i:w,this}di.prototype.clear=Gs,di.prototype.delete=Jo,di.prototype.get=$o,di.prototype.has=Qo,di.prototype.set=Fs;function fi(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function tf(){this.__data__=[],this.size=0}function ef(y){var w=this.__data__,M=Nn(w,y);if(M<0)return!1;var K=w.length-1;return M==K?w.pop():ol.call(w,M,1),--this.size,!0}function rf(y){var w=this.__data__,M=Nn(w,y);return M<0?void 0:w[M][1]}function sf(y){return Nn(this.__data__,y)>-1}function ll(y,w){var M=this.__data__,K=Nn(M,y);return K<0?(++this.size,M.push([y,w])):M[K][1]=w,this}fi.prototype.clear=tf,fi.prototype.delete=ef,fi.prototype.get=rf,fi.prototype.has=sf,fi.prototype.set=ll;function Zi(y){var w=-1,M=y==null?0:y.length;for(this.clear();++w<M;){var K=y[w];this.set(K[0],K[1])}}function pr(){this.size=0,this.__data__={hash:new di,map:new(jo||fi),string:new di}}function nf(y){var w=On(this,y).delete(y);return this.size-=w?1:0,w}function of(y){return On(this,y).get(y)}function af(y){return On(this,y).has(y)}function hf(y,w){var M=On(this,y),K=M.size;return M.set(y,w),this.size+=M.size==K?0:1,this}Zi.prototype.clear=pr,Zi.prototype.delete=nf,Zi.prototype.get=of,Zi.prototype.has=af,Zi.prototype.set=hf;function Vr(y){var w=this.__data__=new fi(y);this.size=w.size}function pi(){this.__data__=new fi,this.size=0}function lf(y){var w=this.__data__,M=w.delete(y);return this.size=w.size,M}function cf(y){return this.__data__.get(y)}function uf(y){return this.__data__.has(y)}function df(y,w){var M=this.__data__;if(M instanceof fi){var K=M.__data__;if(!jo||K.length<e-1)return K.push([y,w]),this.size=++M.size,this;M=this.__data__=new Zi(K)}return M.set(y,w),this.size=M.size,this}Vr.prototype.clear=pi,Vr.prototype.delete=lf,Vr.prototype.get=cf,Vr.prototype.has=uf,Vr.prototype.set=df;function ff(y,w){var M=gi(y),K=!M&&ia(y),j=!M&&!K&&Os(y),ft=!M&&!K&&!j&&sa(y),_t=M||K||j||ft,mt=_t?gt(y.length,String):[],yt=mt.length;for(var Nt in y)_t&&(Nt=="length"||j&&(Nt=="offset"||Nt=="parent")||ft&&(Nt=="buffer"||Nt=="byteLength"||Nt=="byteOffset")||ea(Nt,yt))||mt.push(Nt);return mt}function mi(y,w,M){(M!==void 0&&!Bn(y[w],M)||M===void 0&&!(w in y))&&qo(y,w,M)}function pf(y,w,M){var K=y[w];(!(Wi.call(y,w)&&Bn(K,M))||M===void 0&&!(w in y))&&qo(y,w,M)}function Nn(y,w){for(var M=y.length;M--;)if(Bn(y[M][0],w))return M;return-1}function qo(y,w,M){w=="__proto__"&&Ps?Ps(y,w,{configurable:!0,enumerable:!0,value:M,writable:!0}):y[w]=M}var mf=dl();function kn(y){return y==null?y===void 0?E:b:ti&&ti in Object(y)?Sf(y):Af(y)}function Ns(y){return Kr(y)&&kn(y)==a}function gf(y){if(!mr(y)||fl(y))return!1;var w=ra(y)?Fn:L;return w.test(Lf(y))}function yf(y){return Kr(y)&&Xn(y.length)&&!!U[kn(y)]}function Vi(y){if(!mr(y))return Hr(y);var w=Ds(y),M=[];for(var K in y)K=="constructor"&&(w||!Wi.call(y,K))||M.push(K);return M}function cl(y,w,M,K,j){y!==w&&mf(w,function(ft,_t){if(j||(j=new Vr),mr(ft))bf(y,w,_t,M,cl,K,j);else{var mt=K?K(ei(y,_t),ft,_t+"",y,w,j):void 0;mt===void 0&&(mt=ft),mi(y,_t,mt)}},na)}function bf(y,w,M,K,j,ft,_t){var mt=ei(y,M),yt=ei(w,M),Nt=_t.get(yt);if(Nt){mi(y,M,Nt);return}var kt=ft?ft(mt,yt,M+"",y,w,_t):void 0,Ht=kt===void 0;if(Ht){var ge=gi(yt),ye=!ge&&Os(yt),yi=!ge&&!ye&&sa(yt);kt=yt,ge||ye||yi?gi(mt)?kt=mt:Gf(mt)?kt=Tf(mt):ye?(Ht=!1,kt=vf(yt)):yi?(Ht=!1,kt=Dn(yt)):kt=[]:pl(yt)||ia(yt)?(kt=mt,ia(mt)?kt=Bs(mt):(!mr(mt)||ra(mt))&&(kt=Cf(yt))):Ht=!1}Ht&&(_t.set(yt,kt),j(kt,yt,K,ft,_t),_t.delete(yt)),mi(y,M,kt)}function xf(y,w){return Rf(Mf(y,w,ml),y+"")}var _f=Ps?function(y,w){return Ps(y,"toString",{configurable:!0,enumerable:!1,value:Nf(w),writable:!0})}:ml;function vf(y,w){return y.slice()}function wf(y){var w=new y.constructor(y.byteLength);return new Xe(w).set(new Xe(y)),w}function Dn(y,w){var M=wf(y.buffer);return new y.constructor(M,y.byteOffset,y.length)}function Tf(y,w){var M=-1,K=y.length;for(w||(w=Array(K));++M<K;)w[M]=y[M];return w}function ks(y,w,M,K){var j=!M;M||(M={});for(var ft=-1,_t=w.length;++ft<_t;){var mt=w[ft],yt=void 0;yt===void 0&&(yt=y[mt]),j?qo(M,mt,yt):pf(M,mt,yt)}return M}function ul(y){return xf(function(w,M){var K=-1,j=M.length,ft=j>1?M[j-1]:void 0,_t=j>2?M[2]:void 0;for(ft=y.length>3&&typeof ft=="function"?(j--,ft):void 0,_t&&Ef(M[0],M[1],_t)&&(ft=j<3?void 0:ft,j=1),w=Object(w);++K<j;){var mt=M[K];mt&&y(w,mt,K,ft)}return w})}function dl(y){return function(w,M,K){for(var j=-1,ft=Object(w),_t=K(w),mt=_t.length;mt--;){var yt=_t[++j];if(M(ft[yt],yt,ft)===!1)break}return w}}function On(y,w){var M=y.__data__;return If(w)?M[typeof w=="string"?"string":"hash"]:M.map}function ta(y,w){var M=Ft(y,w);return gf(M)?M:void 0}function Sf(y){var w=Wi.call(y,ti),M=y[ti];try{y[ti]=void 0;var K=!0}catch{}var j=nl.call(y);return K&&(w?y[ti]=M:delete y[ti]),j}function Cf(y){return typeof y.constructor=="function"&&!Ds(y)?qd(Yo(y)):{}}function ea(y,w){var M=typeof y;return w=w??o,!!w&&(M=="number"||M!="symbol"&&O.test(y))&&y>-1&&y%1==0&&y<w}function Ef(y,w,M){if(!mr(M))return!1;var K=typeof w;return(K=="number"?Un(M)&&ea(w,M.length):K=="string"&&w in M)?Bn(M[w],y):!1}function If(y){var w=typeof y;return w=="string"||w=="number"||w=="symbol"||w=="boolean"?y!=="__proto__":y===null}function fl(y){return!!sl&&sl in y}function Ds(y){var w=y&&y.constructor,M=typeof w=="function"&&w.prototype||Wr;return y===M}function Hr(y){var w=[];if(y!=null)for(var M in Object(y))w.push(M);return w}function Af(y){return nl.call(y)}function Mf(y,w,M){return w=hl(w===void 0?y.length-1:w,0),function(){for(var K=arguments,j=-1,ft=hl(K.length-w,0),_t=Array(ft);++j<ft;)_t[j]=K[w+j];j=-1;for(var mt=Array(w+1);++j<w;)mt[j]=K[j];return mt[w]=M(_t),ut(y,this,mt)}}function ei(y,w){if(!(w==="constructor"&&typeof y[w]=="function")&&w!="__proto__")return y[w]}var Rf=Pf(_f);function Pf(y){var w=0,M=0;return function(){var K=fr(),j=n-(K-M);if(M=K,j>0){if(++w>=s)return arguments[0]}else w=0;return y.apply(void 0,arguments)}}function Lf(y){if(y!=null){try{return Gn.call(y)}catch{}try{return y+""}catch{}}return""}function Bn(y,w){return y===w||y!==y&&w!==w}var ia=Ns(function(){return arguments}())?Ns:function(y){return Kr(y)&&Wi.call(y,"callee")&&!Qd.call(y,"callee")},gi=Array.isArray;function Un(y){return y!=null&&Xn(y.length)&&!ra(y)}function Gf(y){return Kr(y)&&Un(y)}var Os=al||S;function ra(y){if(!mr(y))return!1;var w=kn(y);return w==f||w==p||w==l||w==x}function Xn(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function mr(y){var w=typeof y;return y!=null&&(w=="object"||w=="function")}function Kr(y){return y!=null&&typeof y=="object"}function pl(y){if(!Kr(y)||kn(y)!=_)return!1;var w=Yo(y);if(w===null)return!0;var M=Wi.call(w,"constructor")&&w.constructor;return typeof M=="function"&&M instanceof M&&Gn.call(M)==$d}var sa=k?At(k):yf;function Bs(y){return ks(y,na(y))}function na(y){return Un(y)?ff(y):Vi(y)}var Ff=ul(function(y,w,M){cl(y,w,M)});function Nf(y){return function(){return y}}function ml(y){return y}function S(){return!1}r.exports=Ff}(yh,yh.exports);var VS=yh.exports;const HS=Zs(VS);let cn=null;const Sg={animationDuration:500,disableAnimationsThreshold:500,disableEdgesThreshold:500,fetchEvents:()=>[],fetchEventsInterval:3e4,styles:{colorMode:"dark",rowGap:24,columnGap:32,textDefault:"#ffffff",textInverse:"#000000",selectedBorderColor:"#3fa2c3",selectedBorderWidth:2,selectedBorderOffset:4,selectedBorderRadius:9,nodesPadding:16,nodeHeight:32,nodePadding:4,nodeRadius:6,nodeBorderRadius:9,nodeToggleSize:28,nodeToggleBgColor:"#35363C",nodeToggleBorderRadius:6,nodeToggleBorderColor:"#51525C",nodeUnselectedAlpha:.2,artifactsGap:4,artifactsNodeOverlap:4,artifactPaddingLeft:2,artifactPaddingRight:4,artifactPaddingY:2,artifactTextColor:"#ffffff",artifactBgColor:"#35363b",artifactBorderRadius:4,artifactContentGap:4,artifactIconSize:16,artifactIconColor:"#ffffff",flowStateBarHeight:8,flowStateSelectedBarHeight:10,flowStateAreaAlpha:.1,eventTargetSize:30,eventBottomMargin:4,eventSelectedBorderInset:8,eventRadiusDefault:4,eventColor:"#A564F9",eventClusterRadiusDefault:6,eventClusterColor:"#A564F9",edgeColor:"#51525C",guideLineWidth:1,guideLineColor:"#51525C",guideTextTopPadding:8,guideTextLeftPadding:8,guideTextSize:12,guideTextColor:"#ADADAD",playheadWidth:2,playheadColor:"#6272FF",node:()=>({background:"#ffffff"}),state:()=>({background:"#ffffff"})}};function KS(r){const t=HS({},Sg,r);return t.styles.node=e=>{var i,s;return{...Sg.styles.node(e),...(s=(i=r.styles)==null?void 0:i.node)==null?void 0:s.call(i,e)}},t}function YS(r){Cg(r)}function Cg(r){const t=KS(r);if(!cn){cn=t,$.emit("configCreated",t);return}Object.assign(cn,t),$.emit("configUpdated",t)}function zS(){cn=null}async function Mt(){return cn||await Fe("configCreated")}const fs=new pt;class jS{constructor(t={}){this._recursive=typeof t.recursive=="boolean"?t.recursive:!0,this._toggle=t.toggle||"visible",this._targetList=new Set}add(t){return this._targetList.add(t),this}addAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.add(t[e]);return this}remove(t){return this._targetList.delete(t),this}removeAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.delete(t[e]);return this}clear(){return this._targetList.clear(),this}cull(t,e=!1){return e||this.uncull(),this._targetList.forEach(i=>{e||i.getBounds(!1,fs),this._recursive?this.cullRecursive(t,i,e):(e&&i._bounds.getRectangle(t),i[this._toggle]=fs.right>t.left&&fs.left<t.right&&fs.bottom>t.top&&fs.top<t.bottom)}),this}uncull(){return this._targetList.forEach(t=>{this._recursive?this.uncullRecursive(t):t[this._toggle]=!1}),this}cullRecursive(t,e,i){const s=i?e._bounds.getRectangle(fs):e.getBounds(!0,fs);if(e[this._toggle]=s.right>t.left&&s.left<t.right&&s.bottom>t.top&&s.top<t.bottom,!(s.left>=t.left&&s.top>=t.top&&s.right<=t.right&&s.bottom<=t.bottom)&&e[this._toggle]&&e.children&&e.children.length){const o=e.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(t,o[a])}}uncullRecursive(t){if(t[this._toggle]=!0,t.children&&t.children.length){const e=t.children;for(let i=0,s=e.length;i<s;i++)this.uncullRecursive(e[i])}}}var bh={exports:{}};bh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=1,n=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",b="[object Null]",_="[object Object]",x="[object Promise]",v="[object Proxy]",T="[object RegExp]",C="[object Set]",E="[object String]",I="[object Symbol]",R="[object Undefined]",N="[object WeakMap]",F="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",G="[object Float64Array]",D="[object Int8Array]",X="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",lt="[object Uint8ClampedArray]",W="[object Uint16Array]",L="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,U=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,Q={};Q[A]=Q[G]=Q[D]=Q[X]=Q[B]=Q[H]=Q[lt]=Q[W]=Q[L]=!0,Q[a]=Q[h]=Q[F]=Q[c]=Q[P]=Q[u]=Q[d]=Q[f]=Q[m]=Q[g]=Q[_]=Q[T]=Q[C]=Q[E]=Q[N]=!1;var xt=typeof be=="object"&&be&&be.Object===Object&&be,Ct=typeof self=="object"&&self&&self.Object===Object&&self,q=xt||Ct||Function("return this")(),Z=t&&!t.nodeType&&t,Y=Z&&!0&&r&&!r.nodeType&&r,z=Y&&Y.exports===Z,k=z&&xt.process,ut=function(){try{return k&&k.binding&&k.binding("util")}catch{}}(),gt=ut&&ut.isTypedArray;function At(S,y){for(var w=-1,M=S==null?0:S.length,K=0,j=[];++w<M;){var ft=S[w];y(ft,w,S)&&(j[K++]=ft)}return j}function Ft(S,y){for(var w=-1,M=y.length,K=S.length;++w<M;)S[K+w]=y[w];return S}function Pe(S,y){for(var w=-1,M=S==null?0:S.length;++w<M;)if(y(S[w],w,S))return!0;return!1}function Ue(S,y){for(var w=-1,M=Array(S);++w<S;)M[w]=y(w);return M}function Ho(S){return function(y){return S(y)}}function Wr(S,y){return S.has(y)}function Ln(S,y){return S==null?void 0:S[y]}function Gn(S){var y=-1,w=Array(S.size);return S.forEach(function(M,K){w[++y]=[K,M]}),w}function Wi(S,y){return function(w){return S(y(w))}}function sl(S){var y=-1,w=Array(S.size);return S.forEach(function(M){w[++y]=M}),w}var nl=Array.prototype,$d=Function.prototype,Fn=Object.prototype,Zr=q["__core-js_shared__"],Ko=$d.toString,Xe=Fn.hasOwnProperty,Yo=function(){var S=/[^.]+$/.exec(Zr&&Zr.keys&&Zr.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),zo=Fn.toString,Qd=RegExp("^"+Ko.call(Xe).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=z?q.Buffer:void 0,ti=q.Symbol,Ps=q.Uint8Array,al=Fn.propertyIsEnumerable,hl=nl.splice,fr=ti?ti.toStringTag:void 0,jo=Object.getOwnPropertySymbols,Ls=ol?ol.isBuffer:void 0,qd=Wi(Object.keys,Object),di=Hr(q,"DataView"),Gs=Hr(q,"Map"),Jo=Hr(q,"Promise"),$o=Hr(q,"Set"),Qo=Hr(q,"WeakMap"),Fs=Hr(Object,"create"),fi=gi(di),tf=gi(Gs),ef=gi(Jo),rf=gi($o),sf=gi(Qo),ll=ti?ti.prototype:void 0,Zi=ll?ll.valueOf:void 0;function pr(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function nf(){this.__data__=Fs?Fs(null):{},this.size=0}function of(S){var y=this.has(S)&&delete this.__data__[S];return this.size-=y?1:0,y}function af(S){var y=this.__data__;if(Fs){var w=y[S];return w===i?void 0:w}return Xe.call(y,S)?y[S]:void 0}function hf(S){var y=this.__data__;return Fs?y[S]!==void 0:Xe.call(y,S)}function Vr(S,y){var w=this.__data__;return this.size+=this.has(S)?0:1,w[S]=Fs&&y===void 0?i:y,this}pr.prototype.clear=nf,pr.prototype.delete=of,pr.prototype.get=af,pr.prototype.has=hf,pr.prototype.set=Vr;function pi(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function lf(){this.__data__=[],this.size=0}function cf(S){var y=this.__data__,w=Dn(y,S);if(w<0)return!1;var M=y.length-1;return w==M?y.pop():hl.call(y,w,1),--this.size,!0}function uf(S){var y=this.__data__,w=Dn(y,S);return w<0?void 0:y[w][1]}function df(S){return Dn(this.__data__,S)>-1}function ff(S,y){var w=this.__data__,M=Dn(w,S);return M<0?(++this.size,w.push([S,y])):w[M][1]=y,this}pi.prototype.clear=lf,pi.prototype.delete=cf,pi.prototype.get=uf,pi.prototype.has=df,pi.prototype.set=ff;function mi(S){var y=-1,w=S==null?0:S.length;for(this.clear();++y<w;){var M=S[y];this.set(M[0],M[1])}}function pf(){this.size=0,this.__data__={hash:new pr,map:new(Gs||pi),string:new pr}}function Nn(S){var y=Ds(this,S).delete(S);return this.size-=y?1:0,y}function qo(S){return Ds(this,S).get(S)}function mf(S){return Ds(this,S).has(S)}function kn(S,y){var w=Ds(this,S),M=w.size;return w.set(S,y),this.size+=w.size==M?0:1,this}mi.prototype.clear=pf,mi.prototype.delete=Nn,mi.prototype.get=qo,mi.prototype.has=mf,mi.prototype.set=kn;function Ns(S){var y=-1,w=S==null?0:S.length;for(this.__data__=new mi;++y<w;)this.add(S[y])}function gf(S){return this.__data__.set(S,i),this}function yf(S){return this.__data__.has(S)}Ns.prototype.add=Ns.prototype.push=gf,Ns.prototype.has=yf;function Vi(S){var y=this.__data__=new pi(S);this.size=y.size}function cl(){this.__data__=new pi,this.size=0}function bf(S){var y=this.__data__,w=y.delete(S);return this.size=y.size,w}function xf(S){return this.__data__.get(S)}function _f(S){return this.__data__.has(S)}function vf(S,y){var w=this.__data__;if(w instanceof pi){var M=w.__data__;if(!Gs||M.length<e-1)return M.push([S,y]),this.size=++w.size,this;w=this.__data__=new mi(M)}return w.set(S,y),this.size=w.size,this}Vi.prototype.clear=cl,Vi.prototype.delete=bf,Vi.prototype.get=xf,Vi.prototype.has=_f,Vi.prototype.set=vf;function wf(S,y){var w=Os(S),M=!w&&Gf(S),K=!w&&!M&&Xn(S),j=!w&&!M&&!K&&na(S),ft=w||M||K||j,_t=ft?Ue(S.length,String):[],mt=_t.length;for(var yt in S)Xe.call(S,yt)&&!(ft&&(yt=="length"||K&&(yt=="offset"||yt=="parent")||j&&(yt=="buffer"||yt=="byteLength"||yt=="byteOffset")||Rf(yt,mt)))&&_t.push(yt);return _t}function Dn(S,y){for(var w=S.length;w--;)if(Un(S[w][0],y))return w;return-1}function Tf(S,y,w){var M=y(S);return Os(S)?M:Ft(M,w(S))}function ks(S){return S==null?S===void 0?R:b:fr&&fr in Object(S)?Af(S):ia(S)}function ul(S){return Bs(S)&&ks(S)==a}function dl(S,y,w,M,K){return S===y?!0:S==null||y==null||!Bs(S)&&!Bs(y)?S!==S&&y!==y:On(S,y,w,M,dl,K)}function On(S,y,w,M,K,j){var ft=Os(S),_t=Os(y),mt=ft?h:ei(S),yt=_t?h:ei(y);mt=mt==a?_:mt,yt=yt==a?_:yt;var Nt=mt==_,kt=yt==_,Ht=mt==yt;if(Ht&&Xn(S)){if(!Xn(y))return!1;ft=!0,Nt=!1}if(Ht&&!Nt)return j||(j=new Vi),ft||na(S)?ea(S,y,w,M,K,j):Ef(S,y,mt,w,M,K,j);if(!(w&s)){var ge=Nt&&Xe.call(S,"__wrapped__"),ye=kt&&Xe.call(y,"__wrapped__");if(ge||ye){var yi=ge?S.value():S,gr=ye?y.value():y;return j||(j=new Vi),K(yi,gr,w,M,j)}}return Ht?(j||(j=new Vi),If(S,y,w,M,K,j)):!1}function ta(S){if(!sa(S)||Lf(S))return!1;var y=Kr(S)?Qd:U;return y.test(gi(S))}function Sf(S){return Bs(S)&&pl(S.length)&&!!Q[ks(S)]}function Cf(S){if(!Bn(S))return qd(S);var y=[];for(var w in Object(S))Xe.call(S,w)&&w!="constructor"&&y.push(w);return y}function ea(S,y,w,M,K,j){var ft=w&s,_t=S.length,mt=y.length;if(_t!=mt&&!(ft&&mt>_t))return!1;var yt=j.get(S);if(yt&&j.get(y))return yt==y;var Nt=-1,kt=!0,Ht=w&n?new Ns:void 0;for(j.set(S,y),j.set(y,S);++Nt<_t;){var ge=S[Nt],ye=y[Nt];if(M)var yi=ft?M(ye,ge,Nt,y,S,j):M(ge,ye,Nt,S,y,j);if(yi!==void 0){if(yi)continue;kt=!1;break}if(Ht){if(!Pe(y,function(gr,Us){if(!Wr(Ht,Us)&&(ge===gr||K(ge,gr,w,M,j)))return Ht.push(Us)})){kt=!1;break}}else if(!(ge===ye||K(ge,ye,w,M,j))){kt=!1;break}}return j.delete(S),j.delete(y),kt}function Ef(S,y,w,M,K,j,ft){switch(w){case P:if(S.byteLength!=y.byteLength||S.byteOffset!=y.byteOffset)return!1;S=S.buffer,y=y.buffer;case F:return!(S.byteLength!=y.byteLength||!j(new Ps(S),new Ps(y)));case c:case u:case g:return Un(+S,+y);case d:return S.name==y.name&&S.message==y.message;case T:case E:return S==y+"";case m:var _t=Gn;case C:var mt=M&s;if(_t||(_t=sl),S.size!=y.size&&!mt)return!1;var yt=ft.get(S);if(yt)return yt==y;M|=n,ft.set(S,y);var Nt=ea(_t(S),_t(y),M,K,j,ft);return ft.delete(S),Nt;case I:if(Zi)return Zi.call(S)==Zi.call(y)}return!1}function If(S,y,w,M,K,j){var ft=w&s,_t=fl(S),mt=_t.length,yt=fl(y),Nt=yt.length;if(mt!=Nt&&!ft)return!1;for(var kt=mt;kt--;){var Ht=_t[kt];if(!(ft?Ht in y:Xe.call(y,Ht)))return!1}var ge=j.get(S);if(ge&&j.get(y))return ge==y;var ye=!0;j.set(S,y),j.set(y,S);for(var yi=ft;++kt<mt;){Ht=_t[kt];var gr=S[Ht],Us=y[Ht];if(M)var Ab=ft?M(Us,gr,Ht,y,S,j):M(gr,Us,Ht,S,y,j);if(!(Ab===void 0?gr===Us||K(gr,Us,w,M,j):Ab)){ye=!1;break}yi||(yi=Ht=="constructor")}if(ye&&!yi){var gl=S.constructor,yl=y.constructor;gl!=yl&&"constructor"in S&&"constructor"in y&&!(typeof gl=="function"&&gl instanceof gl&&typeof yl=="function"&&yl instanceof yl)&&(ye=!1)}return j.delete(S),j.delete(y),ye}function fl(S){return Tf(S,Ff,Mf)}function Ds(S,y){var w=S.__data__;return Pf(y)?w[typeof y=="string"?"string":"hash"]:w.map}function Hr(S,y){var w=Ln(S,y);return ta(w)?w:void 0}function Af(S){var y=Xe.call(S,fr),w=S[fr];try{S[fr]=void 0;var M=!0}catch{}var K=zo.call(S);return M&&(y?S[fr]=w:delete S[fr]),K}var Mf=jo?function(S){return S==null?[]:(S=Object(S),At(jo(S),function(y){return al.call(S,y)}))}:Nf,ei=ks;(di&&ei(new di(new ArrayBuffer(1)))!=P||Gs&&ei(new Gs)!=m||Jo&&ei(Jo.resolve())!=x||$o&&ei(new $o)!=C||Qo&&ei(new Qo)!=N)&&(ei=function(S){var y=ks(S),w=y==_?S.constructor:void 0,M=w?gi(w):"";if(M)switch(M){case fi:return P;case tf:return m;case ef:return x;case rf:return C;case sf:return N}return y});function Rf(S,y){return y=y??o,!!y&&(typeof S=="number"||tt.test(S))&&S>-1&&S%1==0&&S<y}function Pf(S){var y=typeof S;return y=="string"||y=="number"||y=="symbol"||y=="boolean"?S!=="__proto__":S===null}function Lf(S){return!!Yo&&Yo in S}function Bn(S){var y=S&&S.constructor,w=typeof y=="function"&&y.prototype||Fn;return S===w}function ia(S){return zo.call(S)}function gi(S){if(S!=null){try{return Ko.call(S)}catch{}try{return S+""}catch{}}return""}function Un(S,y){return S===y||S!==S&&y!==y}var Gf=ul(function(){return arguments}())?ul:function(S){return Bs(S)&&Xe.call(S,"callee")&&!al.call(S,"callee")},Os=Array.isArray;function ra(S){return S!=null&&pl(S.length)&&!Kr(S)}var Xn=Ls||ml;function mr(S,y){return dl(S,y)}function Kr(S){if(!sa(S))return!1;var y=ks(S);return y==f||y==p||y==l||y==v}function pl(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=o}function sa(S){var y=typeof S;return S!=null&&(y=="object"||y=="function")}function Bs(S){return S!=null&&typeof S=="object"}var na=gt?Ho(gt):Sf;function Ff(S){return ra(S)?wf(S):Cf(S)}function Nf(){return[]}function ml(){return!1}r.exports=mr}(bh,bh.exports);var JS=bh.exports;const Eg=Zs(JS);class Ke{constructor(t){this.parent=t,this.paused=!1}destroy(){}down(t){return!1}move(t){return!1}up(t){return!1}wheel(t){return!1}update(t){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var $S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function QS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ig={exports:{}};(function(r,t){(function(){var e,i;i=function(s){return r.exports=s},e={linear:function(s,n,o,a){return o*s/a+n},easeInQuad:function(s,n,o,a){return o*(s/=a)*s+n},easeOutQuad:function(s,n,o,a){return-o*(s/=a)*(s-2)+n},easeInOutQuad:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s+n:-o/2*(--s*(s-2)-1)+n},easeInCubic:function(s,n,o,a){return o*(s/=a)*s*s+n},easeOutCubic:function(s,n,o,a){return o*((s=s/a-1)*s*s+1)+n},easeInOutCubic:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s+n:o/2*((s-=2)*s*s+2)+n},easeInQuart:function(s,n,o,a){return o*(s/=a)*s*s*s+n},easeOutQuart:function(s,n,o,a){return-o*((s=s/a-1)*s*s*s-1)+n},easeInOutQuart:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s+n:-o/2*((s-=2)*s*s*s-2)+n},easeInQuint:function(s,n,o,a){return o*(s/=a)*s*s*s*s+n},easeOutQuint:function(s,n,o,a){return o*((s=s/a-1)*s*s*s*s+1)+n},easeInOutQuint:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s*s+n:o/2*((s-=2)*s*s*s*s+2)+n},easeInSine:function(s,n,o,a){return-o*Math.cos(s/a*(Math.PI/2))+o+n},easeOutSine:function(s,n,o,a){return o*Math.sin(s/a*(Math.PI/2))+n},easeInOutSine:function(s,n,o,a){return-o/2*(Math.cos(Math.PI*s/a)-1)+n},easeInExpo:function(s,n,o,a){return s===0?n:o*Math.pow(2,10*(s/a-1))+n},easeOutExpo:function(s,n,o,a){return s===a?n+o:o*(-Math.pow(2,-10*s/a)+1)+n},easeInOutExpo:function(s,n,o,a){return(s/=a/2)<1?o/2*Math.pow(2,10*(s-1))+n:o/2*(-Math.pow(2,-10*--s)+2)+n},easeInCirc:function(s,n,o,a){return-o*(Math.sqrt(1-(s/=a)*s)-1)+n},easeOutCirc:function(s,n,o,a){return o*Math.sqrt(1-(s=s/a-1)*s)+n},easeInOutCirc:function(s,n,o,a){return(s/=a/2)<1?-o/2*(Math.sqrt(1-s*s)-1)+n:o/2*(Math.sqrt(1-(s-=2)*s)+1)+n},easeInElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n},easeOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*s)*Math.sin((s*a-c)*(2*Math.PI)/l)+o+n},easeInOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a/2),l||(l=a*(.3*1.5)),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),s<1?-.5*(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n:h*Math.pow(2,-10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l)*.5+o+n},easeInBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*(s/=a)*s*((h+1)*s-h)+n},easeOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*((s=s/a-1)*s*((h+1)*s+h)+1)+n},easeInOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),(s/=a/2)<1?o/2*(s*s*(((h*=1.525)+1)*s-h))+n:o/2*((s-=2)*s*(((h*=1.525)+1)*s+h)+2)+n},easeInBounce:function(s,n,o,a){var h;return h=e.easeOutBounce(a-s,0,o,a),o-h+n},easeOutBounce:function(s,n,o,a){return(s/=a)<1/2.75?o*(7.5625*s*s)+n:s<2/2.75?o*(7.5625*(s-=1.5/2.75)*s+.75)+n:s<2.5/2.75?o*(7.5625*(s-=2.25/2.75)*s+.9375)+n:o*(7.5625*(s-=2.625/2.75)*s+.984375)+n},easeInOutBounce:function(s,n,o,a){var h;return s<a/2?(h=e.easeInBounce(s*2,0,o,a),h*.5+n):(h=e.easeOutBounce(s*2-a,0,o,a),h*.5+o*.5+n)}},i(e)}).call($S)})(Ig);var qS=Ig.exports;const Ag=QS(qS);function xh(r,t){if(r){if(typeof r=="function")return r;if(typeof r=="string")return Ag[r]}else return Ag[t]}const tC={removeOnInterrupt:!1,ease:"linear",time:1e3};class eC extends Ke{constructor(t,e={}){super(t),this.startWidth=null,this.startHeight=null,this.deltaWidth=null,this.deltaHeight=null,this.width=null,this.height=null,this.time=0,this.options=Object.assign({},tC,e),this.options.ease=xh(this.options.ease),this.setupPosition(),this.setupZoom(),this.time=0}setupPosition(){typeof this.options.position<"u"?(this.startX=this.parent.center.x,this.startY=this.parent.center.y,this.deltaX=this.options.position.x-this.parent.center.x,this.deltaY=this.options.position.y-this.parent.center.y,this.keepCenter=!1):this.keepCenter=!0}setupZoom(){this.width=null,this.height=null,typeof this.options.scale<"u"?this.width=this.parent.screenWidth/this.options.scale:typeof this.options.scaleX<"u"||typeof this.options.scaleY<"u"?(typeof this.options.scaleX<"u"&&(this.width=this.parent.screenWidth/this.options.scaleX),typeof this.options.scaleY<"u"&&(this.height=this.parent.screenHeight/this.options.scaleY)):(typeof this.options.width<"u"&&(this.width=this.options.width),typeof this.options.height<"u"&&(this.height=this.options.height)),this.width!==null&&(this.startWidth=this.parent.screenWidthInWorldPixels,this.deltaWidth=this.width-this.startWidth),this.height!==null&&(this.startHeight=this.parent.screenHeightInWorldPixels,this.deltaHeight=this.height-this.startHeight)}down(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("animate"),!1}complete(){this.parent.plugins.remove("animate"),this.width!==null&&this.parent.fitWidth(this.width,this.keepCenter,this.height===null),this.height!==null&&this.parent.fitHeight(this.height,this.keepCenter,this.width===null),!this.keepCenter&&this.options.position&&this.parent.moveCenter(this.options.position),this.parent.emit("animate-end",this.parent),this.options.callbackOnComplete&&this.options.callbackOnComplete(this.parent)}update(t){if(this.paused)return;this.time+=t;const e=new ct(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,s=this.parent.height;this.complete(),(i!==this.parent.width||s!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const s=this.startWidth,n=this.deltaWidth;this.parent.fitWidth(s+n*i,this.keepCenter,this.height===null)}if(this.height!==null){const s=this.startHeight,n=this.deltaHeight;this.parent.fitHeight(s+n*i,this.keepCenter,this.width===null)}if(this.width===null?this.parent.scale.x=this.parent.scale.y:this.height===null&&(this.parent.scale.y=this.parent.scale.x),!this.keepCenter){const s=this.startX,n=this.startY,o=this.deltaX,a=this.deltaY,h=new ct(this.parent.x,this.parent.y);this.parent.moveCenter(s+o*i,n+a*i),this.parent.emit("moved",{viewport:this.parent,original:h,type:"animate"})}(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}}}const iC={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class rC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},iC,e),this.ease=xh(this.options.ease,"easeInOutSine"),this.options.sides?this.options.sides==="all"?this.top=this.bottom=this.left=this.right=!0:this.options.sides==="horizontal"?(this.right=this.left=!0,this.top=this.bottom=!1):this.options.sides==="vertical"?(this.left=this.right=!1,this.top=this.bottom=!0):(this.top=this.options.sides.indexOf("top")!==-1,this.bottom=this.options.sides.indexOf("bottom")!==-1,this.left=this.options.sides.indexOf("left")!==-1,this.right=this.options.sides.indexOf("right")!==-1):this.left=this.top=this.right=this.bottom=!1;const i=this.options.underflow.toLowerCase();i==="center"?(this.underflowX=0,this.underflowY=0):(this.underflowX=i.indexOf("left")!==-1?-1:i.indexOf("right")!==-1?1:0,this.underflowY=i.indexOf("top")!==-1?-1:i.indexOf("bottom")!==-1?1:0),this.reset()}isActive(){return this.toX!==null||this.toY!==null}down(){return this.toX=this.toY=null,!1}up(){return this.bounce(),!1}update(t){if(!this.paused){if(this.bounce(),this.toX){const e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)}if(this.toY){const e=this.toY;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),e.time>=this.options.time?(this.parent.y=e.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(e.time,e.start,e.delta,this.options.time)}}}calcUnderflowX(){let t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}calcUnderflowY(){let t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}oob(){const t=this.options.bounceBox;if(t){const e=typeof t.x>"u"?0:t.x,i=typeof t.y>"u"?0:t.y,s=typeof t.width>"u"?this.parent.worldWidth:t.width,n=typeof t.height>"u"?this.parent.worldHeight:t.height;return{left:this.parent.left<e,right:this.parent.right>s,top:this.parent.top<i,bottom:this.parent.bottom>n,topLeft:new ct(e*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new ct(s*this.parent.scale.x-this.parent.screenWidth,n*this.parent.scale.y-this.parent.screenHeight)}}return{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new ct(0,0),bottomRight:new ct(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){var t,e;if(this.paused)return;let i,s=this.parent.plugins.get("decelerate",!0);s&&(s.x||s.y)&&(s.x&&s.percentChangeX===((t=s.options)==null?void 0:t.friction)||s.y&&s.percentChangeY===((e=s.options)==null?void 0:e.friction))&&(i=this.oob(),(i.left&&this.left||i.right&&this.right)&&(s.percentChangeX=this.options.friction),(i.top&&this.top||i.bottom&&this.bottom)&&(s.percentChangeY=this.options.friction));const n=this.parent.plugins.get("drag",!0)||{},o=this.parent.plugins.get("pinch",!0)||{};if(s=s||{},!(n!=null&&n.active)&&!(o!=null&&o.active)&&(!this.toX||!this.toY)&&(!s.x||!s.y)){i=i||this.oob();const a=i.topLeft,h=i.bottomRight;if(!this.toX&&!s.x){let l=null;i.left&&this.left?l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x:i.right&&this.right&&(l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-h.x),l!==null&&this.parent.x!==l&&(this.toX={time:0,start:this.parent.x,delta:l-this.parent.x,end:l},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!s.y){let l=null;i.top&&this.top?l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y:i.bottom&&this.bottom&&(l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-h.y),l!==null&&this.parent.y!==l&&(this.toY={time:0,start:this.parent.y,delta:l-this.parent.y,end:l},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const sC={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class nC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},sC,e),this.options.direction&&(this.options.left=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.right=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.top=this.options.direction==="y"||this.options.direction==="all"?!0:null,this.options.bottom=this.options.direction==="y"||this.options.direction==="all"?!0:null),this.parseUnderflow(),this.last={x:null,y:null,scaleX:null,scaleY:null},this.update()}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="none"?this.noUnderflow=!0:t==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=t.indexOf("left")!==-1?-1:t.indexOf("right")!==-1?1:0,this.underflowY=t.indexOf("top")!==-1?-1:t.indexOf("bottom")!==-1?1:0,this.noUnderflow=!1)}move(){return this.update(),!1}update(){if(this.paused||this.parent.x===this.last.x&&this.parent.y===this.last.y&&this.parent.scale.x===this.last.scaleX&&this.parent.scale.y===this.last.scaleY)return;const t=new ct(this.parent.x,this.parent.y),e=this.parent.plugins.decelerate||{};if(this.options.left!==null||this.options.right!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x!==0&&(this.parent.x=0,i=!0);break;case 1:this.parent.x!==this.parent.screenWidth-this.parent.screenWorldWidth&&(this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth,i=!0);break;default:this.parent.x!==(this.parent.screenWidth-this.parent.screenWorldWidth)/2&&(this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2,i=!0)}else this.options.left!==null&&this.parent.left<(this.options.left===!0?0:this.options.left)&&(this.parent.x=-(this.options.left===!0?0:this.options.left)*this.parent.scale.x,e.x=0,i=!0),this.options.right!==null&&this.parent.right>(this.options.right===!0?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(this.options.right===!0?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,e.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(this.options.top!==null||this.options.bottom!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y!==0&&(this.parent.y=0,i=!0);break;case 1:this.parent.y!==this.parent.screenHeight-this.parent.screenWorldHeight&&(this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight,i=!0);break;default:this.parent.y!==(this.parent.screenHeight-this.parent.screenWorldHeight)/2&&(this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2,i=!0)}else this.options.top!==null&&this.parent.top<(this.options.top===!0?0:this.options.top)&&(this.parent.y=-(this.options.top===!0?0:this.options.top)*this.parent.scale.y,e.y=0,i=!0),this.options.bottom!==null&&this.parent.bottom>(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,e.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}reset(){this.update()}}const oC={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class aC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},oC,e),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&t<this.options.minWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.minWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&t>this.options.maxWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&e<this.options.minHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.minHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&e>this.options.maxHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}else if(this.options.minScale||this.options.maxScale){const t={x:null,y:null},e={x:null,y:null};if(typeof this.options.minScale=="number")t.x=this.options.minScale,t.y=this.options.minScale;else if(this.options.minScale!==null){const n=this.options.minScale;t.x=typeof n.x>"u"?null:n.x,t.y=typeof n.y>"u"?null:n.y}if(typeof this.options.maxScale=="number")e.x=this.options.maxScale,e.y=this.options.maxScale;else if(this.options.maxScale!==null){const n=this.options.maxScale;e.x=typeof n.x>"u"?null:n.x,e.y=typeof n.y>"u"?null:n.y}let i=this.parent.scale.x,s=this.parent.scale.y;t.x!==null&&i<t.x&&(i=t.x),e.x!==null&&i>e.x&&(i=e.x),t.y!==null&&s<t.y&&(s=t.y),e.y!==null&&s>e.y&&(s=e.y),(i!==this.parent.scale.x||s!==this.parent.scale.y)&&(this.parent.scale.set(i,s),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const hC={friction:.98,bounce:.8,minSpeed:.01},Pr=16;class lC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},hC,e),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.handleMoved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const t=this.parent.input.count();return(t===1||t>1&&!this.parent.plugins.get("pinch",!0))&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30)),!1}handleMoved(t){if(this.saved.length){const e=this.saved[this.saved.length-1];t.type==="clamp-x"&&t.original?e.x===t.original.x&&(e.x=this.parent.x):t.type==="clamp-y"&&t.original&&e.y===t.original.y&&(e.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const t=performance.now();for(const e of this.saved)if(e.time>=t-100){const i=t-e.time;this.x=(this.parent.x-e.x)/i,this.y=(this.parent.y-e.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(t){t=t||{},typeof t.x<"u"&&(this.x=t.x,this.percentChangeX=this.options.friction),typeof t.y<"u"&&(this.y=t.y,this.percentChangeY=this.options.friction)}update(t){if(this.paused)return;const e=this.x||this.y,i=this.timeSinceRelease,s=this.timeSinceRelease+t;if(this.x){const n=this.percentChangeX,o=Math.log(n);this.parent.x+=this.x*Pr/o*(Math.pow(n,s/Pr)-Math.pow(n,i/Pr)),this.x*=Math.pow(this.percentChangeX,t/Pr)}if(this.y){const n=this.percentChangeY,o=Math.log(n);this.parent.y+=this.y*Pr/o*(Math.pow(n,s/Pr)-Math.pow(n,i/Pr)),this.y*=Math.pow(this.percentChangeY,t/Pr)}this.timeSinceRelease+=t,this.x&&this.y?Math.abs(this.x)<this.options.minSpeed&&Math.abs(this.y)<this.options.minSpeed&&(this.x=0,this.y=0):(Math.abs(this.x||0)<this.options.minSpeed&&(this.x=0),Math.abs(this.y||0)<this.options.minSpeed&&(this.y=0)),e&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const cC={direction:"all",pressDrag:!0,wheel:!0,wheelScroll:1,reverse:!1,clampWheel:!1,underflow:"center",factor:1,mouseButtons:"all",keyToPress:null,ignoreKeyToPressOnTouch:!1,lineHeight:20,wheelSwapAxes:!1};class uC extends Ke{constructor(t,e={}){super(t),this.windowEventHandlers=[],this.options=Object.assign({},cC,e),this.moved=!1,this.reverse=this.options.reverse?1:-1,this.xDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="x",this.yDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="y",this.keyIsPressed=!1,this.parseUnderflow(),this.mouseButtons(this.options.mouseButtons),this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){const e=s=>{t.includes(s.code)&&(this.keyIsPressed=!0)},i=s=>{t.includes(s.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",e)}addWindowEventHandler(t,e){typeof window>"u"||(window.addEventListener(t,e),this.windowEventHandlers.push({event:t,handler:e}))}destroy(){typeof window>"u"||this.windowEventHandlers.forEach(({event:t,handler:e})=>{window.removeEventListener(t,e)})}mouseButtons(t){!t||t==="all"?this.mouse=[!0,!0,!0]:this.mouse=[t.indexOf("left")!==-1,t.indexOf("middle")!==-1,t.indexOf("right")!==-1]}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="center"?(this.underflowX=0,this.underflowY=0):(t.includes("left")?this.underflowX=-1:t.includes("right")?this.underflowX=1:this.underflowX=0,t.includes("top")?this.underflowY=-1:t.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(t){const e=t.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!e||this.mouse[t.button]))}checkKeyPress(t){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&t.data.pointerType==="touch"}down(t){return this.paused||!this.options.pressDrag?!1:this.checkButtons(t)&&this.checkKeyPress(t)?(this.last={x:t.global.x,y:t.global.y},this.current=t.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(t){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===t.data.pointerId){const e=t.global.x,i=t.global.y,s=this.parent.input.count();if(s===1||s>1&&!this.parent.plugins.get("pinch",!0)){const n=e-this.last.x,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(n)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:e,y:i};return this.xDirection&&(this.parent.x+=(a.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(a.y-this.last.y)*this.options.factor),this.last=a,this.moved||this.parent.emit("drag-start",{event:t,screen:new ct(this.last.x,this.last.y),world:this.parent.toWorld(new ct(this.last.x,this.last.y)),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}return!1}up(t){if(this.paused)return!1;const e=this.parent.input.touches;if(e.length===1){const i=e[0];return i.last&&(this.last={x:i.last.x,y:i.last.y},this.current=i.id),this.moved=!1,!0}else if(this.last&&this.moved){const i=new ct(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:t,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(t){if(this.paused)return!1;if(this.options.wheel){const e=this.parent.plugins.get("wheel",!0);if(!e||!e.options.wheelZoom&&!t.ctrlKey){const i=t.deltaMode?this.options.lineHeight:1,s=[t.deltaX,t.deltaY],[n,o]=this.options.wheelSwapAxes?s.reverse():s;return this.xDirection&&(this.parent.x+=n*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=o*i*this.options.wheelScroll*this.reverse),this.options.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.options.passiveWheel||t.preventDefault(),this.parent.options.stopPropagation&&t.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const t=this.parent.plugins.get("decelerate",!0)||{};if(this.options.clampWheel!=="y")if(this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x=0;break;case 1:this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}else this.parent.left<0?(this.parent.x=0,t.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if(this.options.clampWheel!=="x")if(this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y=0;break;case 1:this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}else this.parent.top<0&&(this.parent.y=0,t.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}}const dC={speed:0,acceleration:null,radius:null};class fC extends Ke{constructor(t,e,i={}){super(t),this.target=e,this.options=Object.assign({},dC,i),this.velocity={x:0,y:0}}update(t){if(this.paused)return;const e=this.parent.center;let i=this.target.x,s=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.options.radius){const a=Math.atan2(this.target.y-e.y,this.target.x-e.x);i=this.target.x-Math.cos(a)*this.options.radius,s=this.target.y-Math.sin(a)*this.options.radius}else return;const n=i-e.x,o=s-e.y;if(n||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(s-e.y,i-e.x),h=Math.sqrt(Math.pow(n,2)+Math.pow(o,2));if(h){const l=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>l?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*t,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*t,this.options.speed))}:this.velocity={x:Math.max(this.velocity.x-this.options.acceleration*this.options.speed,0),y:Math.max(this.velocity.y-this.options.acceleration*this.options.speed,0)};const c=Math.cos(a)*this.velocity.x,u=Math.sin(a)*this.velocity.y,d=Math.abs(c)>Math.abs(n)?i:e.x+c,f=Math.abs(u)>Math.abs(o)?s:e.y+u;this.parent.moveCenter(d,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(s-e.y,i-e.x),h=Math.cos(a)*this.options.speed,l=Math.sin(a)*this.options.speed,c=Math.abs(h)>Math.abs(n)?i:e.x+h,u=Math.abs(l)>Math.abs(o)?s:e.y+l;this.parent.moveCenter(c,u),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,s),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const pC={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class mC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},pC,e),this.reverse=this.options.reverse?1:-1,this.radiusSquared=typeof this.options.radius=="number"?Math.pow(this.options.radius,2):null,this.resize()}resize(){const t=this.options.distance;t!==null?(this.left=t,this.top=t,this.right=this.parent.screenWidth-t,this.bottom=this.parent.screenHeight-t):this.options.radius||(this.left=this.options.left,this.top=this.options.top,this.right=this.options.right===null?null:this.parent.screenWidth-this.options.right,this.bottom=this.options.bottom===null?null:this.parent.screenHeight-this.options.bottom)}down(){return this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null),!1}move(t){if(this.paused||t.pointerType!=="mouse"&&t.pointerId!==1||!this.options.allowButtons&&t.buttons!==0)return!1;const e=t.global.x,i=t.global.y;if(this.radiusSquared){const s=this.parent.toScreen(this.parent.center);if(Math.pow(s.x-e,2)+Math.pow(s.y-i,2)>=this.radiusSquared){const n=Math.atan2(s.y-i,s.x-e);this.options.linear?(this.horizontal=Math.round(Math.cos(n))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(n))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(n)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(n)*this.options.speed*this.reverse*(60/1e3))}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else this.left!==null&&e<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&e>this.right?this.horizontal=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateHorizontal(),this.horizontal=0),this.top!==null&&i<this.top?this.vertical=Number(this.reverse)*this.options.speed*(60/1e3):this.bottom!==null&&i>this.bottom?this.vertical=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateVertical(),this.vertical=0);return!1}decelerateHorizontal(){const t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}up(){return this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null),!1}update(){if(!this.paused&&(this.horizontal||this.vertical)){const t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const gC={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class yC extends Ke{constructor(t,e={}){super(t),this.active=!1,this.pinching=!1,this.moved=!1,this.options=Object.assign({},gC,e)}down(){return this.parent.input.count()>=2?(this.active=!0,!0):!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}move(t){if(this.paused||!this.active)return!1;const e=t.global.x,i=t.global.y,s=this.parent.input.touches;if(s.length>=2){const n=s[0],o=s[1],a=n.last&&o.last?Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2)):null;if(n.id===t.pointerId?n.last={x:e,y:i,data:t}:o.id===t.pointerId&&(o.last={x:e,y:i,data:t}),a){let h;const l=new ct(n.last.x+(o.last.x-n.last.x)/2,n.last.y+(o.last.y-n.last.y)/2);this.options.center||(h=this.parent.toLocal(l));let c=Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2));c=c===0?c=1e-10:c;const u=(1-a/c)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=u),this.isAxisY()&&(this.parent.scale.y+=u),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:l});const d=this.parent.plugins.get("clamp-zoom",!0);if(d&&d.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const f=this.parent.toGlobal(h);this.parent.x+=(l.x-f.x)*this.options.factor,this.parent.y+=(l.y-f.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(l.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(l.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=l,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}return!1}up(){return this.pinching&&this.parent.input.touches.length<=1?(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0):!1}}const bC={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class xC extends Ke{constructor(t,e,i,s={}){super(t),this.options=Object.assign({},bC,s),this.ease=xh(s.ease,"easeInOutSine"),this.x=e,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.y,this.parent.emit("snap-start",this.parent)}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null),!1}up(){if(this.parent.input.count()===0){const t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction)}return!1}update(t){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const e=this.snapping;e.time+=t;let i,s,n;const o=this.startX,a=this.startY,h=this.deltaX,l=this.deltaY;if(e.time>this.options.time)i=!0,s=o+h,n=a+l;else{const c=this.ease(e.time,0,1,this.options.time);s=o+h*c,n=a+l*c}this.options.topLeft?this.parent.moveCorner(s,n):this.parent.moveCenter(s,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),i&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{const e=this.options.topLeft?this.parent.corner:this.parent.center;(e.x!==this.x||e.y!==this.y)&&this.snapStart()}}}const _C={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class vC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},_C,e),this.ease=xh(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=t.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=t.screenHeight/this.options.height,this.yIndependent=!0),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale,this.options.time===0?(t.container.scale.x=this.xScale,t.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):e.forceStart&&this.createSnapping()}createSnapping(){const t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,s=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:t,startY:e,deltaX:i-t,deltaY:s-e},this.parent.emit("snap-zoom-start",this.parent)}resize(){this.snapping=null,this.options.width>0&&(this.xScale=this.parent.screenWidth/this.options.width),this.options.height>0&&(this.yScale=this.parent.screenHeight/this.options.height),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap-zoom"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap-zoom"):this.options.interrupt&&(this.snapping=null),!1}update(t){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let e;if(!this.options.center&&!this.options.noMove&&(e=this.parent.center),!this.snapping)(this.parent.scale.x!==this.xScale||this.parent.scale.y!==this.yScale)&&this.createSnapping();else if(this.snapping){const i=this.snapping;if(i.time+=t,i.time>=this.options.time)this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{const n=this.snapping,o=this.ease(n.time,n.startX,n.deltaX,this.options.time),a=this.ease(n.time,n.startY,n.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}const s=this.parent.plugins.get("clamp-zoom",!0);s&&s.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(e))}}resume(){this.snapping=null,super.resume()}}const wC={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class TC extends Ke{constructor(t,e={}){super(t),this.options=Object.assign({},wC,e),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){typeof window>"u"||(window.addEventListener("keydown",e=>{t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.code)&&(this.keyIsPressed=!1)}))}checkKeyPress(){return!this.options.keyToPress||this.keyIsPressed}down(){return this.options.interrupt&&(this.smoothing=null),!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}update(){if(this.smoothing){const t=this.smoothingCenter,e=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x+=e.x),this.isAxisY()&&(this.parent.scale.y+=e.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const s=this.parent.plugins.get("clamp-zoom",!0);if(s&&s.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const n=this.parent.toGlobal(i);this.parent.x+=t.x-n.x,this.parent.y+=t.y-n.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(t){if(this.paused)return;const e=this.parent.input.getPointerPosition(t),i=-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/200,s=Math.pow(2,(1+this.options.percent)*i);let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}wheel(t){if(this.paused||!this.checkKeyPress())return!1;if(t.ctrlKey&&this.options.trackpadPinch)this.pinch(t);else if(this.options.wheelZoom){const e=this.parent.input.getPointerPosition(t),i=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*i);if(this.options.smooth){const n={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+n.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+n.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}return!this.parent.options.passiveWheel}}class SC{constructor(t){this.viewport=t,this.touches=[],this.addListeners()}addListeners(){this.viewport.eventMode="static",this.viewport.forceHitArea||(this.viewport.hitArea=new pt(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.options.allowPreserveDragOutside?this.viewport.on("globalpointermove",this.move,this):this.viewport.on("pointermove",this.move,this),this.viewport.on("pointerup",this.up,this),this.viewport.on("pointerupoutside",this.up,this),this.viewport.on("pointercancel",this.up,this),this.viewport.options.allowPreserveDragOutside||this.viewport.on("pointerleave",this.up,this),this.wheelFunction=t=>this.handleWheel(t),this.viewport.options.events.domElement.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){var t;(t=this.viewport.options.events.domElement)==null||t.removeEventListener("wheel",this.wheelFunction)}down(t){if(!(this.viewport.pause||!this.viewport.visible)){if(t.pointerType==="mouse"?this.isMouseDown=!0:this.get(t.pointerId)||this.touches.push({id:t.pointerId,last:null}),this.count()===1){this.last=t.global.clone();const e=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0);(!e||!e.isActive())&&(!i||!i.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(t)&&this.viewport.options.stopPropagation&&t.stopPropagation()}}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(t){return Math.abs(t)>=this.viewport.threshold}move(t){if(this.viewport.pause||!this.viewport.visible)return;const e=this.viewport.plugins.move(t);if(this.clickedAvailable&&this.last){const i=t.global.x-this.last.x,s=t.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}e&&this.viewport.options.stopPropagation&&t.stopPropagation()}up(t){if(this.viewport.pause||!this.viewport.visible)return;t.pointerType==="mouse"&&(this.isMouseDown=!1),t.pointerType!=="mouse"&&this.remove(t.pointerId);const e=this.viewport.plugins.up(t);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this.viewport}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation()}getPointerPosition(t){const e=new ct;return this.viewport.options.events.mapPositionToPoint(e,t.clientX,t.clientY),e}handleWheel(t){if(this.viewport.pause||!this.viewport.visible)return;const e=this.viewport.toLocal(this.getPointerPosition(t));this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom&&this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(t){for(const e of this.touches)if(e.id===t)return e;return null}remove(t){for(let e=0;e<this.touches.length;e++)if(this.touches[e].id===t){this.touches.splice(e,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}const po=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class CC{constructor(t){this.viewport=t,this.list=[],this.plugins={}}add(t,e,i=po.length){const s=this.plugins[t];s&&s.destroy(),this.plugins[t]=e;const n=po.indexOf(t);n!==-1&&po.splice(n,1),po.splice(i,0,t),this.sort()}get(t,e){var i;return e&&(i=this.plugins[t])!=null&&i.paused?null:this.plugins[t]}update(t){for(const e of this.list)e.update(t)}resize(){for(const t of this.list)t.resize()}reset(){for(const t of this.list)t.reset()}removeAll(){this.list.forEach(t=>{t.destroy()}),this.plugins={},this.sort()}remove(t){var e;this.plugins[t]&&((e=this.plugins[t])==null||e.destroy(),delete this.plugins[t],this.viewport.emit("plugin-remove",t),this.sort())}pause(t){var e;(e=this.plugins[t])==null||e.pause()}resume(t){var e;(e=this.plugins[t])==null||e.resume()}sort(){this.list=[];for(const t of po)this.plugins[t]&&this.list.push(this.plugins[t])}down(t){let e=!1;for(const i of this.list)i.down(t)&&(e=!0);return e}move(t){let e=!1;for(const i of this.viewport.plugins.list)i.move(t)&&(e=!0);return e}up(t){let e=!1;for(const i of this.list)i.up(t)&&(e=!0);return e}wheel(t){let e=!1;for(const i of this.list)i.wheel(t)&&(e=!0);return e}}const EC={screenWidth:typeof window>"u"?0:window.innerWidth,screenHeight:typeof window>"u"?0:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,disableOnContextMenu:!1,ticker:_e.shared,allowPreserveDragOutside:!1};class IC extends Tt{constructor(t){super(),this._disableOnContextMenu=e=>e.preventDefault(),this.options={...EC,...t},this.screenWidth=this.options.screenWidth,this.screenHeight=this.options.screenHeight,this._worldWidth=this.options.worldWidth,this._worldHeight=this.options.worldHeight,this.forceHitArea=this.options.forceHitArea,this.threshold=this.options.threshold,this.options.disableOnContextMenu&&this.options.events.domElement.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new SC(this),this.plugins=new CC(this)}destroy(t){var e;!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&((e=this.options.events.domElement)==null||e.removeEventListener("contextmenu",this._disableOnContextMenu)),this.input.destroy(),super.destroy(t)}update(t){this.pause||(this.plugins.update(t),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new pt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}resize(t=typeof window>"u"?0:window.innerWidth,e=typeof window>"u"?0:window.innerHeight,i,s){this.screenWidth=t,this.screenHeight=e,typeof i<"u"&&(this._worldWidth=i),typeof s<"u"&&(this._worldHeight=s),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(t){this._worldWidth=t,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(t){this._worldHeight=t,this.plugins.resize()}getVisibleBounds(){return new pt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(t,e){return arguments.length===2?this.toLocal(new ct(t,e)):this.toLocal(t)}toScreen(t,e){return arguments.length===2?this.toGlobal(new ct(t,e)):this.toGlobal(t)}get worldScreenWidth(){return this.screenWidth/this.scale.x}get worldScreenHeight(){return this.screenHeight/this.scale.y}get screenWorldWidth(){return this.worldWidth*this.scale.x}get screenWorldHeight(){return this.worldHeight*this.scale.y}get center(){return new ct(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(t){this.moveCenter(t)}moveCenter(...t){let e,i;typeof t[0]=="number"?(e=t[0],i=t[1]):(e=t[0].x,i=t[0].y);const s=(this.worldScreenWidth/2-e)*this.scale.x,n=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==s||this.y!==n)&&(this.position.set(s,n),this.plugins.reset(),this.dirty=!0),this}get corner(){return new ct(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(t){this.moveCorner(t)}moveCorner(...t){let e,i;return t.length===1?(e=-t[0].x*this.scale.x,i=-t[0].y*this.scale.y):(e=-t[0]*this.scale.x,i=-t[1]*this.scale.y),(e!==this.x||i!==this.y)&&(this.position.set(e,i),this.plugins.reset(),this.dirty=!0),this}get screenWidthInWorldPixels(){return this.screenWidth/this.scale.x}get screenHeightInWorldPixels(){return this.screenHeight/this.scale.y}findFitWidth(t){return this.screenWidth/t}findFitHeight(t){return this.screenHeight/t}findFit(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.min(i,s)}findCover(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.max(i,s)}fitWidth(t=this.worldWidth,e,i=!0,s){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,i&&(this.scale.y=this.scale.x);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitHeight(t=this.worldHeight,e,i=!0,s){let n;e&&(n=this.center),this.scale.y=this.screenHeight/t,i&&(this.scale.x=this.scale.y);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitWorld(t){let e;t&&(e=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const i=this.plugins.get("clamp-zoom",!0);return i&&i.clamp(),t&&e&&this.moveCenter(e),this}fit(t,e=this.worldWidth,i=this.worldHeight){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,this.scale.y=this.screenHeight/i,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&s&&this.moveCenter(s),this}setZoom(t,e){let i;e&&(i=this.center),this.scale.set(t);const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&i&&this.moveCenter(i),this}zoomPercent(t,e){return this.setZoom(this.scale.x+this.scale.x*t,e)}zoom(t,e){return this.fitWidth(t+this.worldScreenWidth,e),this}get scaled(){return this.scale.x}set scaled(t){this.setZoom(t,!0)}snapZoom(t){return this.plugins.add("snap-zoom",new vC(this,t)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new ct(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}get right(){return-this.x/this.scale.x+this.worldScreenWidth}set right(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(t){this.x=-t*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(t){this.y=-t*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(t){this._dirty=t}get forceHitArea(){return this._forceHitArea}set forceHitArea(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new pt(0,0,this.worldWidth,this.worldHeight))}drag(t){return this.plugins.add("drag",new uC(this,t)),this}clamp(t){return this.plugins.add("clamp",new nC(this,t)),this}decelerate(t){return this.plugins.add("decelerate",new lC(this,t)),this}bounce(t){return this.plugins.add("bounce",new rC(this,t)),this}pinch(t){return this.plugins.add("pinch",new yC(this,t)),this}snap(t,e,i){return this.plugins.add("snap",new xC(this,t,e,i)),this}follow(t,e){return this.plugins.add("follow",new fC(this,t,e)),this}wheel(t){return this.plugins.add("wheel",new TC(this,t)),this}animate(t){return this.plugins.add("animate",new eC(this,t)),this}clampZoom(t){return this.plugins.add("clamp-zoom",new aC(this,t)),this}mouseEdges(t){return this.plugins.add("mouse-edges",new mC(this,t)),this}get pause(){return!!this._pause}set pause(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}ensureVisible(t,e,i,s,n){n&&(i>this.worldScreenWidth||s>this.worldScreenHeight)&&(this.fit(!0,i,s),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let o=!1;t<this.left?(this.left=t,o=!0):t+i>this.right&&(this.right=t+i,o=!0),e<this.top?(this.top=e,o=!0):e+s>this.bottom&&(this.bottom=e+s,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const _h=1e3,Mg=Symbol.for("constructDateFrom");async function Rg(r,t){const e=await Mt();let i,s=null;async function n(){try{s=await e.fetch(r),t(s)}catch(a){console.error(a)}s&&!s.end_time&&(i=setTimeout(()=>n(),AC(s)))}function o(){clearTimeout(i)}return{start:n,stop:o}}function AC(r){const t=Math.floor(r.nodes.size/_h)*_h;return Math.max(_h,t)}function ir(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Pg(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}/*!
1160
1160
  * GSAP 3.12.5
1161
1161
  * https://gsap.com
1162
1162
  *
@@ -1164,7 +1164,7 @@ void main(void)\r
1164
1164
  * Subject to the terms at https://gsap.com/standard-license or for
1165
1165
  * Club GSAP members, the agreement issued with that membership.
1166
1166
  * @author: Jack Doyle, jack@greensock.com
1167
- */var Ne={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},un={duration:.5,overwrite:!1,delay:0},Au,fe,Dt,Ye=1e8,Pt=1/Ye,Mu=Math.PI*2,MC=Mu/4,RC=0,Lg=Math.sqrt,PC=Math.cos,LC=Math.sin,ae=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},rr=function(t){return typeof t=="number"},Ru=function(t){return typeof t>"u"},Li=function(t){return typeof t=="object"},Te=function(t){return t!==!1},Pu=function(){return typeof window<"u"},vh=function(t){return Vt(t)||ae(t)},Gg=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},pe=Array.isArray,Lu=/(?:-?\.?\d|\.)+/gi,Fg=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,dn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Gu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ng=/[+-]=-?[.\d]+/,kg=/[^,'"\[\]\s]+/gi,GC=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Xt,Gi,Fu,Nu,ke={},wh={},Dg,Og=function(t){return(wh=ms(t,ke))&&Ee},ku=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},mo=function(t,e){return!e&&console.warn(t)},Bg=function(t,e){return t&&(ke[t]=e)&&wh&&(wh[t]=e)||ke},go=function(){return 0},FC={suppressEvents:!0,isStart:!0,kill:!1},Th={suppressEvents:!0,kill:!1},NC={suppressEvents:!0},Du={},Lr=[],Ou={},Ug,De={},Bu={},Xg=30,Sh=[],Uu="",Xu=function(t){var e=t[0],i,s;if(Li(e)||Vt(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(s=Sh.length;s--&&!Sh[s].targetTest(e););i=Sh[s]}for(s=t.length;s--;)t[s]&&(t[s]._gsap||(t[s]._gsap=new gy(t[s],i)))||t.splice(s,1);return t},ps=function(t){return t._gsap||Xu(Je(t))[0]._gsap},Wg=function(t,e,i){return(i=t[e])&&Vt(i)?t[e]():Ru(i)&&t.getAttribute&&t.getAttribute(e)||i},Se=function(t,e){return(t=t.split(",")).forEach(e)||t},Yt=function(t){return Math.round(t*1e5)/1e5||0},he=function(t){return Math.round(t*1e7)/1e7||0},fn=function(t,e){var i=e.charAt(0),s=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+s:i==="-"?t-s:i==="*"?t*s:t/s},kC=function(t,e){for(var i=e.length,s=0;t.indexOf(e[s])<0&&++s<i;);return s<i},Ch=function(){var t=Lr.length,e=Lr.slice(0),i,s;for(Ou={},Lr.length=0,i=0;i<t;i++)s=e[i],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Zg=function(t,e,i,s){Lr.length&&!fe&&Ch(),t.render(e,i,fe&&e<0&&(t._initted||t._startAt)),Lr.length&&!fe&&Ch()},Vg=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(kg).length<2?e:ae(t)?t.trim():t},Hg=function(t){return t},ze=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},DC=function(t){return function(e,i){for(var s in i)s in e||s==="duration"&&t||s==="ease"||(e[s]=i[s])}},ms=function(t,e){for(var i in e)t[i]=e[i];return t},Kg=function r(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=Li(e[i])?r(t[i]||(t[i]={}),e[i]):e[i]);return t},Eh=function(t,e){var i={},s;for(s in t)s in e||(i[s]=t[s]);return i},yo=function(t){var e=t.parent||Xt,i=t.keyframes?DC(pe(t.keyframes)):ze;if(Te(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},OC=function(t,e){for(var i=t.length,s=i===e.length;s&&i--&&t[i]===e[i];);return i<0},Yg=function(t,e,i,s,n){var o=t[s],a;if(n)for(a=e[n];o&&o[n]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[s]=e,e._prev=o,e.parent=e._dp=t,e},Ih=function(t,e,i,s){i===void 0&&(i="_first"),s===void 0&&(s="_last");var n=e._prev,o=e._next;n?n._next=o:t[i]===e&&(t[i]=o),o?o._prev=n:t[s]===e&&(t[s]=n),e._next=e._prev=e.parent=null},Gr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},gs=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},BC=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Wu=function(t,e,i,s){return t._startAt&&(fe?t._startAt.revert(Th):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,s))},UC=function r(t){return!t||t._ts&&r(t.parent)},zg=function(t){return t._repeat?pn(t._tTime,t=t.duration()+t._rDelay)*t:0},pn=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},Ah=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Mh=function(t){return t._end=he(t._start+(t._tDur/Math.abs(t._ts||t._rts||Pt)||0))},Rh=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=he(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Mh(t),i._dirty||gs(i,t)),t},jg=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=Ah(t.rawTime(),e),(!e._dur||xo(0,e.totalDuration(),i)-e._tTime>Pt)&&e.render(i,!0)),gs(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-Pt}},Fi=function(t,e,i,s){return e.parent&&Gr(e),e._start=he((rr(i)?i:i||t!==Xt?je(t,i,e):t._time)+e._delay),e._end=he(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Yg(t,e,"_first","_last",t._sort?"_start":0),Zu(e)||(t._recent=e),s||jg(t,e),t._ts<0&&Rh(t,t._tTime),t},Jg=function(t,e){return(ke.ScrollTrigger||ku("scrollTrigger",e))&&ke.ScrollTrigger.create(e,t)},$g=function(t,e,i,s,n){if(Qu(t,e,n),!t._initted)return 1;if(!i&&t._pt&&!fe&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Ug!==Be.frame)return Lr.push(t),t._lazy=[n,s],1},XC=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Zu=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},WC=function(t,e,i,s){var n=t.ratio,o=e<0||!e&&(!t._start&&XC(t)&&!(!t._initted&&Zu(t))||(t._ts<0||t._dp._ts<0)&&!Zu(t))?0:1,a=t._rDelay,h=0,l,c,u;if(a&&t._repeat&&(h=xo(0,t._tDur,e),c=pn(h,a),t._yoyo&&c&1&&(o=1-o),c!==pn(t._tTime,a)&&(n=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==n||fe||s||t._zTime===Pt||!e&&t._zTime){if(!t._initted&&$g(t,e,s,i,h))return;for(u=t._zTime,t._zTime=e||(i?Pt:0),i||(i=e&&!u),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=h,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&Wu(t,e,i,!0),t._onUpdate&&!i&&Oe(t,"onUpdate"),h&&t._repeat&&!i&&t.parent&&Oe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Gr(t,1),!i&&!fe&&(Oe(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},ZC=function(t,e,i){var s;if(i>e)for(s=t._first;s&&s._start<=i;){if(s.data==="isPause"&&s._start>e)return s;s=s._next}else for(s=t._last;s&&s._start>=i;){if(s.data==="isPause"&&s._start<e)return s;s=s._prev}},mn=function(t,e,i,s){var n=t._repeat,o=he(e)||0,a=t._tTime/t._tDur;return a&&!s&&(t._time*=o/t._dur),t._dur=o,t._tDur=n?n<0?1e10:he(o*(n+1)+t._rDelay*n):o,a>0&&!s&&Rh(t,t._tTime=t._tDur*a),t.parent&&Mh(t),i||gs(t.parent,t),t},Qg=function(t){return t instanceof ve?gs(t):mn(t,t._dur)},VC={_start:0,endTime:go,totalDuration:go},je=function r(t,e,i){var s=t.labels,n=t._recent||VC,o=t.duration()>=Ye?n.endTime(!1):t._dur,a,h,l;return ae(e)&&(isNaN(e)||e in s)?(h=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),h==="<"||h===">"?(a>=0&&(e=e.replace(/=/,"")),(h==="<"?n._start:n.endTime(n._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?n:i).totalDuration()/100:1)):a<0?(e in s||(s[e]=o),s[e]):(h=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&i&&(h=h/100*(pe(i)?i[0]:i).totalDuration()),a>1?r(t,e.substr(0,a-1),i)+h:o+h)):e==null?o:+e},bo=function(t,e,i){var s=rr(e[1]),n=(s?2:1)+(t<2?0:1),o=e[n],a,h;if(s&&(o.duration=e[1]),o.parent=i,t){for(a=o,h=i;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=Te(h.vars.inherit)&&h.parent;o.immediateRender=Te(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[n-1]}return new $t(e[0],o,e[n+1])},Fr=function(t,e){return t||t===0?e(t):e},xo=function(t,e,i){return i<t?t:i>e?e:i},me=function(t,e){return!ae(t)||!(e=GC.exec(t))?"":e[1]},HC=function(t,e,i){return Fr(i,function(s){return xo(t,e,s)})},Vu=[].slice,qg=function(t,e){return t&&Li(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Li(t[0]))&&!t.nodeType&&t!==Gi},KC=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(s){var n;return ae(s)&&!e||qg(s,1)?(n=i).push.apply(n,Je(s)):i.push(s)})||i},Je=function(t,e,i){return Dt&&!e&&Dt.selector?Dt.selector(t):ae(t)&&!i&&(Fu||!yn())?Vu.call((e||Nu).querySelectorAll(t),0):pe(t)?KC(t,i):qg(t)?Vu.call(t,0):t?[t]:[]},Hu=function(t){return t=Je(t)[0]||mo("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return Je(e,i.querySelectorAll?i:i===t?mo("Invalid scope")||Nu.createElement("div"):t)}},ty=function(t){return t.sort(function(){return .5-Math.random()})},ey=function(t){if(Vt(t))return t;var e=Li(t)?t:{each:t},i=ys(e.ease),s=e.from||0,n=parseFloat(e.base)||0,o={},a=s>0&&s<1,h=isNaN(s)||a,l=e.axis,c=s,u=s;return ae(s)?c=u={center:.5,edges:.5,end:1}[s]||0:!a&&h&&(c=s[0],u=s[1]),function(d,f,p){var m=(p||e).length,g=o[m],b,_,x,v,T,C,E,I,R;if(!g){if(R=e.grid==="auto"?0:(e.grid||[1,Ye])[1],!R){for(E=-Ye;E<(E=p[R++].getBoundingClientRect().left)&&R<m;);R<m&&R--}for(g=o[m]=[],b=h?Math.min(R,m)*c-.5:s%R,_=R===Ye?0:h?m*u/R-.5:s/R|0,E=0,I=Ye,C=0;C<m;C++)x=C%R-b,v=_-(C/R|0),g[C]=T=l?Math.abs(l==="y"?v:x):Lg(x*x+v*v),T>E&&(E=T),T<I&&(I=T);s==="random"&&ty(g),g.max=E-I,g.min=I,g.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(R>m?m-1:l?l==="y"?m/R:R:Math.max(R,m/R))||0)*(s==="edges"?-1:1),g.b=m<0?n-m:n,g.u=me(e.amount||e.each)||0,i=i&&m<0?fy(i):i}return m=(g[d]-g.min)/g.max||0,he(g.b+(i?i(m):m)*g.v)+g.u}},Ku=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var s=he(Math.round(parseFloat(i)/t)*t*e);return(s-s%1)/e+(rr(i)?0:me(i))}},iy=function(t,e){var i=pe(t),s,n;return!i&&Li(t)&&(s=i=t.radius||Ye,t.values?(t=Je(t.values),(n=!rr(t[0]))&&(s*=s)):t=Ku(t.increment)),Fr(e,i?Vt(t)?function(o){return n=t(o),Math.abs(n-o)<=s?n:o}:function(o){for(var a=parseFloat(n?o.x:o),h=parseFloat(n?o.y:0),l=Ye,c=0,u=t.length,d,f;u--;)n?(d=t[u].x-a,f=t[u].y-h,d=d*d+f*f):d=Math.abs(t[u]-a),d<l&&(l=d,c=u);return c=!s||l<=s?t[c]:o,n||c===o||rr(o)?c:c+me(o)}:Ku(t))},ry=function(t,e,i,s){return Fr(pe(t)?!e:i===!0?!!(i=0):!s,function(){return pe(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(s=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*s)/s})},YC=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(s){return e.reduce(function(n,o){return o(n)},s)}},zC=function(t,e){return function(i){return t(parseFloat(i))+(e||me(i))}},jC=function(t,e,i){return ny(t,e,0,1,i)},sy=function(t,e,i){return Fr(i,function(s){return t[~~e(s)]})},JC=function r(t,e,i){var s=e-t;return pe(t)?sy(t,r(0,t.length),e):Fr(i,function(n){return(s+(n-t)%s)%s+t})},$C=function r(t,e,i){var s=e-t,n=s*2;return pe(t)?sy(t,r(0,t.length-1),e):Fr(i,function(o){return o=(n+(o-t)%n)%n||0,t+(o>s?n-o:o)})},_o=function(t){for(var e=0,i="",s,n,o,a;~(s=t.indexOf("random(",e));)o=t.indexOf(")",s),a=t.charAt(s+7)==="[",n=t.substr(s+7,o-s-7).match(a?kg:Lu),i+=t.substr(e,s-e)+ry(a?n:+n[0],a?0:+n[1],+n[2]||1e-5),e=o+1;return i+t.substr(e,t.length-e)},ny=function(t,e,i,s,n){var o=e-t,a=s-i;return Fr(n,function(h){return i+((h-t)/o*a||0)})},QC=function r(t,e,i,s){var n=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!n){var o=ae(t),a={},h,l,c,u,d;if(i===!0&&(s=1)&&(i=null),o)t={p:t},e={p:e};else if(pe(t)&&!pe(e)){for(c=[],u=t.length,d=u-2,l=1;l<u;l++)c.push(r(t[l-1],t[l]));u--,n=function(p){p*=u;var m=Math.min(d,~~p);return c[m](p-m)},i=e}else s||(t=ms(pe(t)?[]:{},t));if(!c){for(h in e)Ju.call(a,t,h,"get",e[h]);n=function(p){return ed(p,a)||(o?t.p:t)}}}return Fr(i,n)},oy=function(t,e,i){var s=t.labels,n=Ye,o,a,h;for(o in s)a=s[o]-e,a<0==!!i&&a&&n>(a=Math.abs(a))&&(h=o,n=a);return h},Oe=function(t,e,i){var s=t.vars,n=s[e],o=Dt,a=t._ctx,h,l,c;if(n)return h=s[e+"Params"],l=s.callbackScope||t,i&&Lr.length&&Ch(),a&&(Dt=a),c=h?n.apply(l,h):n.call(l),Dt=o,c},vo=function(t){return Gr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!fe),t.progress()<1&&Oe(t,"onInterrupt"),t},gn,ay=[],hy=function(t){if(t)if(t=!t.name&&t.default||t,Pu()||t.headless){var e=t.name,i=Vt(t),s=e&&!i&&t.init?function(){this._props=[]}:t,n={init:go,render:ed,add:Ju,kill:pE,modifier:fE,rawVars:0},o={targetTest:0,get:0,getSetter:td,aliases:{},register:0};if(yn(),t!==s){if(De[e])return;ze(s,ze(Eh(t,n),o)),ms(s.prototype,ms(n,Eh(t,o))),De[s.prop=e]=s,t.targetTest&&(Sh.push(s),Du[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Bg(e,s),t.register&&t.register(Ee,s,Ce)}else ay.push(t)},Rt=255,wo={aqua:[0,Rt,Rt],lime:[0,Rt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Rt],navy:[0,0,128],white:[Rt,Rt,Rt],olive:[128,128,0],yellow:[Rt,Rt,0],orange:[Rt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Rt,0,0],pink:[Rt,192,203],cyan:[0,Rt,Rt],transparent:[Rt,Rt,Rt,0]},Yu=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*Rt+.5|0},ly=function(t,e,i){var s=t?rr(t)?[t>>16,t>>8&Rt,t&Rt]:0:wo.black,n,o,a,h,l,c,u,d,f,p;if(!s){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),wo[t])s=wo[t];else if(t.charAt(0)==="#"){if(t.length<6&&(n=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+n+n+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return s=parseInt(t.substr(1,6),16),[s>>16,s>>8&Rt,s&Rt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),s=[t>>16,t>>8&Rt,t&Rt]}else if(t.substr(0,3)==="hsl"){if(s=p=t.match(Lu),!e)h=+s[0]%360/360,l=+s[1]/100,c=+s[2]/100,o=c<=.5?c*(l+1):c+l-c*l,n=c*2-o,s.length>3&&(s[3]*=1),s[0]=Yu(h+1/3,n,o),s[1]=Yu(h,n,o),s[2]=Yu(h-1/3,n,o);else if(~t.indexOf("="))return s=t.match(Fg),i&&s.length<4&&(s[3]=1),s}else s=t.match(Lu)||wo.transparent;s=s.map(Number)}return e&&!p&&(n=s[0]/Rt,o=s[1]/Rt,a=s[2]/Rt,u=Math.max(n,o,a),d=Math.min(n,o,a),c=(u+d)/2,u===d?h=l=0:(f=u-d,l=c>.5?f/(2-u-d):f/(u+d),h=u===n?(o-a)/f+(o<a?6:0):u===o?(a-n)/f+2:(n-o)/f+4,h*=60),s[0]=~~(h+.5),s[1]=~~(l*100+.5),s[2]=~~(c*100+.5)),i&&s.length<4&&(s[3]=1),s},cy=function(t){var e=[],i=[],s=-1;return t.split(Nr).forEach(function(n){var o=n.match(dn)||[];e.push.apply(e,o),i.push(s+=o.length+1)}),e.c=i,e},uy=function(t,e,i){var s="",n=(t+s).match(Nr),o=e?"hsla(":"rgba(",a=0,h,l,c,u;if(!n)return t;if(n=n.map(function(d){return(d=ly(d,e,1))&&o+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),i&&(c=cy(t),h=i.c,h.join(s)!==c.c.join(s)))for(l=t.replace(Nr,"1").split(dn),u=l.length-1;a<u;a++)s+=l[a]+(~h.indexOf(a)?n.shift()||o+"0,0,0,0)":(c.length?c:n.length?n:i).shift());if(!l)for(l=t.split(Nr),u=l.length-1;a<u;a++)s+=l[a]+n[a];return s+l[u]},Nr=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in wo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),qC=/hsl[a]?\(/,dy=function(t){var e=t.join(" "),i;if(Nr.lastIndex=0,Nr.test(e))return i=qC.test(e),t[1]=uy(t[1],i),t[0]=uy(t[0],i,cy(t[1])),!0},To,Be=function(){var r=Date.now,t=500,e=33,i=r(),s=i,n=1e3/240,o=n,a=[],h,l,c,u,d,f,p=function m(g){var b=r()-s,_=g===!0,x,v,T,C;if((b>t||b<0)&&(i+=b-e),s+=b,T=s-i,x=T-o,(x>0||_)&&(C=++u.frame,d=T-u.time*1e3,u.time=T=T/1e3,o+=x+(x>=n?4:n-x),v=1),_||(h=l(m)),v)for(f=0;f<a.length;f++)a[f](T,d,C,g)};return u={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(g){return d/(1e3/(g||60))},wake:function(){Dg&&(!Fu&&Pu()&&(Gi=Fu=window,Nu=Gi.document||{},ke.gsap=Ee,(Gi.gsapVersions||(Gi.gsapVersions=[])).push(Ee.version),Og(wh||Gi.GreenSockGlobals||!Gi.gsap&&Gi||{}),ay.forEach(hy)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&u.sleep(),l=c||function(g){return setTimeout(g,o-u.time*1e3+1|0)},To=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),To=0,l=go},lagSmoothing:function(g,b){t=g||1/0,e=Math.min(b||33,t)},fps:function(g){n=1e3/(g||240),o=u.time*1e3+n},add:function(g,b,_){var x=b?function(v,T,C,E){g(v,T,C,E),u.remove(x)}:g;return u.remove(g),a[_?"unshift":"push"](x),yn(),x},remove:function(g,b){~(b=a.indexOf(g))&&a.splice(b,1)&&f>=b&&f--},_listeners:a},u}(),yn=function(){return!To&&Be.wake()},St={},tE=/^[\d.\-M][\d.\-,\s]/,eE=/["']/g,iE=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),s=i[0],n=1,o=i.length,a,h,l;n<o;n++)h=i[n],a=n!==o-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),e[s]=isNaN(l)?l.replace(eE,"").trim():+l,s=h.substr(a+1).trim();return e},rE=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),s=t.indexOf("(",e);return t.substring(e,~s&&s<i?t.indexOf(")",i+1):i)},sE=function(t){var e=(t+"").split("("),i=St[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[iE(e[1])]:rE(t).split(",").map(Vg)):St._CE&&tE.test(t)?St._CE("",t):i},fy=function(t){return function(e){return 1-t(1-e)}},py=function r(t,e){for(var i=t._first,s;i;)i instanceof ve?r(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?r(i.timeline,e):(s=i._ease,i._ease=i._yEase,i._yEase=s,i._yoyo=e)),i=i._next},ys=function(t,e){return t&&(Vt(t)?t:St[t]||sE(t))||e},bs=function(t,e,i,s){i===void 0&&(i=function(h){return 1-e(1-h)}),s===void 0&&(s=function(h){return h<.5?e(h*2)/2:1-e((1-h)*2)/2});var n={easeIn:e,easeOut:i,easeInOut:s},o;return Se(t,function(a){St[a]=ke[a]=n,St[o=a.toLowerCase()]=i;for(var h in n)St[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=St[a+"."+h]=n[h]}),n},my=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},zu=function r(t,e,i){var s=e>=1?e:1,n=(i||(t?.3:.45))/(e<1?e:1),o=n/Mu*(Math.asin(1/s)||0),a=function(c){return c===1?1:s*Math.pow(2,-10*c)*LC((c-o)*n)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:my(a);return n=Mu/n,h.config=function(l,c){return r(t,l,c)},h},ju=function r(t,e){e===void 0&&(e=1.70158);var i=function(o){return o?--o*o*((e+1)*o+e)+1:0},s=t==="out"?i:t==="in"?function(n){return 1-i(1-n)}:my(i);return s.config=function(n){return r(t,n)},s};Se("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;bs(r+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})}),St.Linear.easeNone=St.none=St.Linear.easeIn,bs("Elastic",zu("in"),zu("out"),zu()),function(r,t){var e=1/t,i=2*e,s=2.5*e,n=function(a){return a<e?r*a*a:a<i?r*Math.pow(a-1.5/t,2)+.75:a<s?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};bs("Bounce",function(o){return 1-n(1-o)},n)}(7.5625,2.75),bs("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),bs("Circ",function(r){return-(Lg(1-r*r)-1)}),bs("Sine",function(r){return r===1?1:-PC(r*MC)+1}),bs("Back",ju("in"),ju("out"),ju()),St.SteppedEase=St.steps=ke.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,s=t+(e?0:1),n=e?1:0,o=1-Pt;return function(a){return((s*xo(0,o,a)|0)+n)*i}}},un.ease=St["quad.out"],Se("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Uu+=r+","+r+"Params,"});var gy=function(t,e){this.id=RC++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Wg,this.set=e?e.getSetter:td},So=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,mn(this,+e.duration,1,1),this.data=e.data,Dt&&(this._ctx=Dt,Dt.data.push(this)),To||Be.wake()}var t=r.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,mn(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,s){if(yn(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Rh(this,i),!n._dp||n.parent||jg(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&Fi(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Pt||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),Zg(this,i,s)),this},t.time=function(i,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+zg(this))%(this._dur+this._rDelay)||(i?this._dur:0),s):this._time},t.totalProgress=function(i,s){return arguments.length?this.totalTime(this.totalDuration()*i,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(i,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+zg(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,s){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*n,s):this._repeat?pn(this._tTime,n)+1:1},t.timeScale=function(i,s){if(!arguments.length)return this._rts===-Pt?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?Ah(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-Pt?0:this._rts,this.totalTime(xo(-Math.abs(this._delay),this._tDur,n),s!==!1),Mh(this),BC(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(yn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Pt&&(this._tTime-=Pt)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=i;var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Fi(s,this,i-this._delay),this}return this._start},t.endTime=function(i){return this._start+(Te(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var s=this.parent||this._dp;return s?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ah(s.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=NC);var s=fe;return fe=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),fe=s,this},t.globalTime=function(i){for(var s=this,n=arguments.length?i:s.rawTime();s;)n=s._start+n/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(i):n},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,Qg(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var s=this._time;return this._rDelay=i,Qg(this),s?this.time(s):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,s){return this.totalTime(je(this,i),Te(s))},t.restart=function(i,s){return this.play().totalTime(i?-this._delay:0,Te(s))},t.play=function(i,s){return i!=null&&this.seek(i,s),this.reversed(!1).paused(!1)},t.reverse=function(i,s){return i!=null&&this.seek(i||this.totalDuration(),s),this.reversed(!0).paused(!1)},t.pause=function(i,s){return i!=null&&this.seek(i,s),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-Pt:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Pt,this},t.isActive=function(){var i=this.parent||this._dp,s=this._start,n;return!!(!i||this._ts&&this._initted&&i.isActive()&&(n=i.rawTime(!0))>=s&&n<this.endTime(!0)-Pt)},t.eventCallback=function(i,s,n){var o=this.vars;return arguments.length>1?(s?(o[i]=s,n&&(o[i+"Params"]=n),i==="onUpdate"&&(this._onUpdate=s)):delete o[i],this):o[i]},t.then=function(i){var s=this;return new Promise(function(n){var o=Vt(i)?i:Hg,a=function(){var l=s.then;s.then=null,Vt(o)&&(o=o(s))&&(o.then||o===s)&&(s.then=l),n(o),s.then=l};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?a():s._prom=a})},t.kill=function(){vo(this)},r}();ze(So.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Pt,_prom:0,_ps:!1,_rts:1});var ve=function(r){Pg(t,r);function t(i,s){var n;return i===void 0&&(i={}),n=r.call(this,i)||this,n.labels={},n.smoothChildTiming=!!i.smoothChildTiming,n.autoRemoveChildren=!!i.autoRemoveChildren,n._sort=Te(i.sortChildren),Xt&&Fi(i.parent||Xt,ir(n),s),i.reversed&&n.reverse(),i.paused&&n.paused(!0),i.scrollTrigger&&Jg(ir(n),i.scrollTrigger),n}var e=t.prototype;return e.to=function(s,n,o){return bo(0,arguments,this),this},e.from=function(s,n,o){return bo(1,arguments,this),this},e.fromTo=function(s,n,o,a){return bo(2,arguments,this),this},e.set=function(s,n,o){return n.duration=0,n.parent=this,yo(n).repeatDelay||(n.repeat=0),n.immediateRender=!!n.immediateRender,new $t(s,n,je(this,o),1),this},e.call=function(s,n,o){return Fi(this,$t.delayedCall(0,s,n),o)},e.staggerTo=function(s,n,o,a,h,l,c){return o.duration=n,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=c,o.parent=this,new $t(s,o,je(this,h)),this},e.staggerFrom=function(s,n,o,a,h,l,c){return o.runBackwards=1,yo(o).immediateRender=Te(o.immediateRender),this.staggerTo(s,n,o,a,h,l,c)},e.staggerFromTo=function(s,n,o,a,h,l,c,u){return a.startAt=o,yo(a).immediateRender=Te(a.immediateRender),this.staggerTo(s,n,a,h,l,c,u)},e.render=function(s,n,o){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=s<=0?0:he(s),u=this._zTime<0!=s<0&&(this._initted||!l),d,f,p,m,g,b,_,x,v,T,C,E;if(this!==Xt&&c>h&&s>=0&&(c=h),c!==this._tTime||o||u){if(a!==this._time&&l&&(c+=this._time-a,s+=this._time-a),d=c,v=this._start,x=this._ts,b=!x,u&&(l||(a=this._zTime),(s||!n)&&(this._zTime=s)),this._repeat){if(C=this._yoyo,g=l+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(g*100+s,n,o);if(d=he(c%g),c===h?(m=this._repeat,d=l):(m=~~(c/g),m&&m===c/g&&(d=l,m--),d>l&&(d=l)),T=pn(this._tTime,g),!a&&this._tTime&&T!==m&&this._tTime-T*g-this._dur<=0&&(T=m),C&&m&1&&(d=l-d,E=1),m!==T&&!this._lock){var I=C&&T&1,R=I===(C&&m&1);if(m<T&&(I=!I),a=I?0:c%l?l:c,this._lock=1,this.render(a||(E?0:he(m*g)),n,!l)._lock=0,this._tTime=c,!n&&this.parent&&Oe(this,"onRepeat"),this.vars.repeatRefresh&&!E&&(this.invalidate()._lock=1),a&&a!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,R&&(this._lock=2,a=I?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!E&&this.invalidate()),this._lock=0,!this._ts&&!b)return this;py(this,E)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=ZC(this,he(a),he(d)),_&&(c-=d-(d=_._start))),this._tTime=c,this._time=d,this._act=!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,a=0),!a&&d&&!n&&!m&&(Oe(this,"onStart"),this._tTime!==c))return this;if(d>=a&&s>=0)for(f=this._first;f;){if(p=f._next,(f._act||d>=f._start)&&f._ts&&_!==f){if(f.parent!==this)return this.render(s,n,o);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,n,o),d!==this._time||!this._ts&&!b){_=0,p&&(c+=this._zTime=-Pt);break}}f=p}else{f=this._last;for(var N=s<0?s:d;f;){if(p=f._prev,(f._act||N<=f._end)&&f._ts&&_!==f){if(f.parent!==this)return this.render(s,n,o);if(f.render(f._ts>0?(N-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(N-f._start)*f._ts,n,o||fe&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!b){_=0,p&&(c+=this._zTime=N?-Pt:Pt);break}}f=p}}if(_&&!n&&(this.pause(),_.render(d>=a?0:-Pt)._zTime=d>=a?1:-1,this._ts))return this._start=v,Mh(this),this.render(s,n,o);this._onUpdate&&!n&&Oe(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(v===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((s||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&Gr(this,1),!n&&!(s<0&&!a)&&(c||a||!h)&&(Oe(this,c===h&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(s,n){var o=this;if(rr(n)||(n=je(this,n,s)),!(s instanceof So)){if(pe(s))return s.forEach(function(a){return o.add(a,n)}),this;if(ae(s))return this.addLabel(s,n);if(Vt(s))s=$t.delayedCall(0,s);else return this}return this!==s?Fi(this,s,n):this},e.getChildren=function(s,n,o,a){s===void 0&&(s=!0),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ye);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof $t?n&&h.push(l):(o&&h.push(l),s&&h.push.apply(h,l.getChildren(!0,n,o)))),l=l._next;return h},e.getById=function(s){for(var n=this.getChildren(1,1,1),o=n.length;o--;)if(n[o].vars.id===s)return n[o]},e.remove=function(s){return ae(s)?this.removeLabel(s):Vt(s)?this.killTweensOf(s):(Ih(this,s),s===this._recent&&(this._recent=this._last),gs(this))},e.totalTime=function(s,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=he(Be.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),r.prototype.totalTime.call(this,s,n),this._forcing=0,this):this._tTime},e.addLabel=function(s,n){return this.labels[s]=je(this,n),this},e.removeLabel=function(s){return delete this.labels[s],this},e.addPause=function(s,n,o){var a=$t.delayedCall(0,n||go,o);return a.data="isPause",this._hasPause=1,Fi(this,a,je(this,s))},e.removePause=function(s){var n=this._first;for(s=je(this,s);n;)n._start===s&&n.data==="isPause"&&Gr(n),n=n._next},e.killTweensOf=function(s,n,o){for(var a=this.getTweensOf(s,o),h=a.length;h--;)kr!==a[h]&&a[h].kill(s,n);return this},e.getTweensOf=function(s,n){for(var o=[],a=Je(s),h=this._first,l=rr(n),c;h;)h instanceof $t?kC(h._targets,a)&&(l?(!kr||h._initted&&h._ts)&&h.globalTime(0)<=n&&h.globalTime(h.totalDuration())>n:!n||h.isActive())&&o.push(h):(c=h.getTweensOf(a,n)).length&&o.push.apply(o,c),h=h._next;return o},e.tweenTo=function(s,n){n=n||{};var o=this,a=je(o,s),h=n,l=h.startAt,c=h.onStart,u=h.onStartParams,d=h.immediateRender,f,p=$t.to(o,ze({ease:n.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:n.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||Pt,onStart:function(){if(o.pause(),!f){var g=n.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());p._dur!==g&&mn(p,g,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,u||[])}},n));return d?p.render(0):p},e.tweenFromTo=function(s,n,o){return this.tweenTo(n,ze({startAt:{time:je(this,s)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(s){return s===void 0&&(s=this._time),oy(this,je(this,s))},e.previousLabel=function(s){return s===void 0&&(s=this._time),oy(this,je(this,s),1)},e.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Pt)},e.shiftChildren=function(s,n,o){o===void 0&&(o=0);for(var a=this._first,h=this.labels,l;a;)a._start>=o&&(a._start+=s,a._end+=s),a=a._next;if(n)for(l in h)h[l]>=o&&(h[l]+=s);return gs(this)},e.invalidate=function(s){var n=this._first;for(this._lock=0;n;)n.invalidate(s),n=n._next;return r.prototype.invalidate.call(this,s)},e.clear=function(s){s===void 0&&(s=!0);for(var n=this._first,o;n;)o=n._next,this.remove(n),n=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),gs(this)},e.totalDuration=function(s){var n=0,o=this,a=o._last,h=Ye,l,c,u;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(u=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&o._sort&&a._ts&&!o._lock?(o._lock=1,Fi(o,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(n-=c,(!u&&!o._dp||u&&u.smoothChildTiming)&&(o._start+=c/o._ts,o._time-=c,o._tTime-=c),o.shiftChildren(-c,!1,-1/0),h=0),a._end>n&&a._ts&&(n=a._end),a=l;mn(o,o===Xt&&o._time>n?o._time:n,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(s){if(Xt._ts&&(Zg(Xt,Ah(s,Xt)),Ug=Be.frame),Be.frame>=Xg){Xg+=Ne.autoSleep||120;var n=Xt._first;if((!n||!n._ts)&&Ne.autoSleep&&Be._listeners.length<2){for(;n&&!n._ts;)n=n._next;n||Be.sleep()}}},t}(So);ze(ve.prototype,{_lock:0,_hasPause:0,_forcing:0});var nE=function(t,e,i,s,n,o,a){var h=new Ce(this._pt,t,e,0,1,wy,null,n),l=0,c=0,u,d,f,p,m,g,b,_;for(h.b=i,h.e=s,i+="",s+="",(b=~s.indexOf("random("))&&(s=_o(s)),o&&(_=[i,s],o(_,t,e),i=_[0],s=_[1]),d=i.match(Gu)||[];u=Gu.exec(s);)p=u[0],m=s.substring(l,u.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==d[c++]&&(g=parseFloat(d[c-1])||0,h._pt={_next:h._pt,p:m||c===1?m:",",s:g,c:p.charAt(1)==="="?fn(g,p)-g:parseFloat(p)-g,m:f&&f<4?Math.round:0},l=Gu.lastIndex);return h.c=l<s.length?s.substring(l,s.length):"",h.fp=a,(Ng.test(s)||b)&&(h.e=0),this._pt=h,h},Ju=function(t,e,i,s,n,o,a,h,l,c){Vt(s)&&(s=s(n||0,t,o));var u=t[e],d=i!=="get"?i:Vt(u)?l?t[e.indexOf("set")||!Vt(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():u,f=Vt(u)?l?cE:_y:qu,p;if(ae(s)&&(~s.indexOf("random(")&&(s=_o(s)),s.charAt(1)==="="&&(p=fn(d,s)+(me(d)||0),(p||p===0)&&(s=p))),!c||d!==s||$u)return!isNaN(d*s)&&s!==""?(p=new Ce(this._pt,t,e,+d||0,s-(d||0),typeof u=="boolean"?dE:vy,0,f),l&&(p.fp=l),a&&p.modifier(a,this,t),this._pt=p):(!u&&!(e in t)&&ku(e,s),nE.call(this,t,e,d,s,f,h||Ne.stringFilter,l))},oE=function(t,e,i,s,n){if(Vt(t)&&(t=Co(t,n,e,i,s)),!Li(t)||t.style&&t.nodeType||pe(t)||Gg(t))return ae(t)?Co(t,n,e,i,s):t;var o={},a;for(a in t)o[a]=Co(t[a],n,e,i,s);return o},yy=function(t,e,i,s,n,o){var a,h,l,c;if(De[t]&&(a=new De[t]).init(n,a.rawVars?e[t]:oE(e[t],s,n,o,i),i,s,o)!==!1&&(i._pt=h=new Ce(i._pt,n,t,0,1,a.render,a,0,a.priority),i!==gn))for(l=i._ptLookup[i._targets.indexOf(n)],c=a._props.length;c--;)l[a._props[c]]=h;return a},kr,$u,Qu=function r(t,e,i){var s=t.vars,n=s.ease,o=s.startAt,a=s.immediateRender,h=s.lazy,l=s.onUpdate,c=s.runBackwards,u=s.yoyoEase,d=s.keyframes,f=s.autoRevert,p=t._dur,m=t._startAt,g=t._targets,b=t.parent,_=b&&b.data==="nested"?b.vars.targets:g,x=t._overwrite==="auto"&&!Au,v=t.timeline,T,C,E,I,R,N,F,P,A,G,D,X,B;if(v&&(!d||!n)&&(n="none"),t._ease=ys(n,un.ease),t._yEase=u?fy(ys(u===!0?n:u,un.ease)):0,u&&t._yoyo&&!t._repeat&&(u=t._yEase,t._yEase=t._ease,t._ease=u),t._from=!v&&!!s.runBackwards,!v||d&&!s.stagger){if(P=g[0]?ps(g[0]).harness:0,X=P&&s[P.prop],T=Eh(s,Du),m&&(m._zTime<0&&m.progress(1),e<0&&c&&a&&!f?m.render(-1,!0):m.revert(c&&p?Th:FC),m._lazy=0),o){if(Gr(t._startAt=$t.set(g,ze({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!m&&Te(h),startAt:null,delay:0,onUpdate:l&&function(){return Oe(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(fe||!a&&!f)&&t._startAt.revert(Th),a&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(a=!1),E=ze({overwrite:!1,data:"isFromStart",lazy:a&&!m&&Te(h),immediateRender:a,stagger:0,parent:b},T),X&&(E[P.prop]=X),Gr(t._startAt=$t.set(g,E)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(fe?t._startAt.revert(Th):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,Pt,Pt);else if(!e)return}for(t._pt=t._ptCache=0,h=p&&Te(h)||h&&!p,C=0;C<g.length;C++){if(R=g[C],F=R._gsap||Xu(g)[C]._gsap,t._ptLookup[C]=G={},Ou[F.id]&&Lr.length&&Ch(),D=_===g?C:_.indexOf(R),P&&(A=new P).init(R,X||T,t,D,_)!==!1&&(t._pt=I=new Ce(t._pt,R,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(H){G[H]=I}),A.priority&&(N=1)),!P||X)for(E in T)De[E]&&(A=yy(E,T,t,D,R,_))?A.priority&&(N=1):G[E]=I=Ju.call(t,R,E,"get",T[E],D,_,0,s.stringFilter);t._op&&t._op[C]&&t.kill(R,t._op[C]),x&&t._pt&&(kr=t,Xt.killTweensOf(R,G,t.globalTime(e)),B=!t.parent,kr=0),t._pt&&h&&(Ou[F.id]=1)}N&&Ty(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!B,d&&e<=0&&v.render(Ye,!0,!0)},aE=function(t,e,i,s,n,o,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,u,d,f;if(!l)for(l=t._ptCache[e]=[],d=t._ptLookup,f=t._targets.length;f--;){if(c=d[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return $u=1,t.vars[e]="+=0",Qu(t,a),$u=0,h?mo(e+" not eligible for reset"):1;l.push(c)}for(f=l.length;f--;)u=l[f],c=u._pt||u,c.s=(s||s===0)&&!n?s:c.s+(s||0)+o*c.c,c.c=i-c.s,u.e&&(u.e=Yt(i)+me(u.e)),u.b&&(u.b=c.s+me(u.b))},hE=function(t,e){var i=t[0]?ps(t[0]).harness:0,s=i&&i.aliases,n,o,a,h;if(!s)return e;n=ms({},e);for(o in s)if(o in n)for(h=s[o].split(","),a=h.length;a--;)n[h[a]]=n[o];return n},lE=function(t,e,i,s){var n=e.ease||s||"power1.inOut",o,a;if(pe(e))a=i[t]||(i[t]=[]),e.forEach(function(h,l){return a.push({t:l/(e.length-1)*100,v:h,e:n})});else for(o in e)a=i[o]||(i[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:n})},Co=function(t,e,i,s,n){return Vt(t)?t.call(e,i,s,n):ae(t)&&~t.indexOf("random(")?_o(t):t},by=Uu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",xy={};Se(by+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return xy[r]=1});var $t=function(r){Pg(t,r);function t(i,s,n,o){var a;typeof s=="number"&&(n.duration=s,s=n,n=null),a=r.call(this,o?s:yo(s))||this;var h=a.vars,l=h.duration,c=h.delay,u=h.immediateRender,d=h.stagger,f=h.overwrite,p=h.keyframes,m=h.defaults,g=h.scrollTrigger,b=h.yoyoEase,_=s.parent||Xt,x=(pe(i)||Gg(i)?rr(i[0]):"length"in s)?[i]:Je(i),v,T,C,E,I,R,N,F;if(a._targets=x.length?Xu(x):mo("GSAP target "+i+" not found. https://gsap.com",!Ne.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=f,p||d||vh(l)||vh(c)){if(s=a.vars,v=a.timeline=new ve({data:"nested",defaults:m||{},targets:_&&_.data==="nested"?_.vars.targets:x}),v.kill(),v.parent=v._dp=ir(a),v._start=0,d||vh(l)||vh(c)){if(E=x.length,N=d&&ey(d),Li(d))for(I in d)~by.indexOf(I)&&(F||(F={}),F[I]=d[I]);for(T=0;T<E;T++)C=Eh(s,xy),C.stagger=0,b&&(C.yoyoEase=b),F&&ms(C,F),R=x[T],C.duration=+Co(l,ir(a),T,R,x),C.delay=(+Co(c,ir(a),T,R,x)||0)-a._delay,!d&&E===1&&C.delay&&(a._delay=c=C.delay,a._start+=c,C.delay=0),v.to(R,C,N?N(T,R,x):0),v._ease=St.none;v.duration()?l=c=0:a.timeline=0}else if(p){yo(ze(v.vars.defaults,{ease:"none"})),v._ease=ys(p.ease||s.ease||"none");var P=0,A,G,D;if(pe(p))p.forEach(function(X){return v.to(x,X,">")}),v.duration();else{C={};for(I in p)I==="ease"||I==="easeEach"||lE(I,p[I],C,p.easeEach);for(I in C)for(A=C[I].sort(function(X,B){return X.t-B.t}),P=0,T=0;T<A.length;T++)G=A[T],D={ease:G.e,duration:(G.t-(T?A[T-1].t:0))/100*l},D[I]=G.v,v.to(x,D,P),P+=D.duration;v.duration()<l&&v.to({},{duration:l-v.duration()})}}l||a.duration(l=v.duration())}else a.timeline=0;return f===!0&&!Au&&(kr=ir(a),Xt.killTweensOf(x),kr=0),Fi(_,ir(a),n),s.reversed&&a.reverse(),s.paused&&a.paused(!0),(u||!l&&!p&&a._start===he(_._time)&&Te(u)&&UC(ir(a))&&_.data!=="nested")&&(a._tTime=-Pt,a.render(Math.max(0,-c)||0)),g&&Jg(ir(a),g),a}var e=t.prototype;return e.render=function(s,n,o){var a=this._time,h=this._tDur,l=this._dur,c=s<0,u=s>h-Pt&&!c?h:s<Pt?0:s,d,f,p,m,g,b,_,x,v;if(!l)WC(this,s,n,o);else if(u!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c){if(d=u,x=this.timeline,this._repeat){if(m=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+s,n,o);if(d=he(u%m),u===h?(p=this._repeat,d=l):(p=~~(u/m),p&&p===he(u/m)&&(d=l,p--),d>l&&(d=l)),b=this._yoyo&&p&1,b&&(v=this._yEase,d=l-d),g=pn(this._tTime,m),d===a&&!o&&this._initted&&p===g)return this._tTime=u,this;p!==g&&(x&&this._yEase&&py(x,b),this.vars.repeatRefresh&&!b&&!this._lock&&this._time!==m&&this._initted&&(this._lock=o=1,this.render(he(m*p),!0).invalidate()._lock=0))}if(!this._initted){if($g(this,c?s:d,o,n,u))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&p!==g))return this;if(l!==this._dur)return this.render(s,n,o)}if(this._tTime=u,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(v||this._ease)(d/l),this._from&&(this.ratio=_=1-_),d&&!a&&!n&&!p&&(Oe(this,"onStart"),this._tTime!==u))return this;for(f=this._pt;f;)f.r(_,f.d),f=f._next;x&&x.render(s<0?s:x._dur*x._ease(d/this._dur),n,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!n&&(c&&Wu(this,s,n,o),Oe(this,"onUpdate")),this._repeat&&p!==g&&this.vars.onRepeat&&!n&&this.parent&&Oe(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(c&&!this._onUpdate&&Wu(this,s,!0,!0),(s||!l)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&Gr(this,1),!n&&!(c&&!a)&&(u||a||b)&&(Oe(this,u===h?"onComplete":"onReverseComplete",!0),this._prom&&!(u<h&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),r.prototype.invalidate.call(this,s)},e.resetTo=function(s,n,o,a,h){To||Be.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||Qu(this,l),c=this._ease(l/this._dur),aE(this,s,n,o,a,c,l,h)?this.resetTo(s,n,o,a,1):(Rh(this,0),this.parent||Yg(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(s,n){if(n===void 0&&(n="all"),!s&&(!n||n==="all"))return this._lazy=this._pt=0,this.parent?vo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,n,kr&&kr.vars.overwrite!==!0)._first||vo(this),this.parent&&o!==this.timeline.totalDuration()&&mn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=s?Je(s):a,l=this._ptLookup,c=this._pt,u,d,f,p,m,g,b;if((!n||n==="all")&&OC(a,h))return n==="all"&&(this._pt=0),vo(this);for(u=this._op=this._op||[],n!=="all"&&(ae(n)&&(m={},Se(n,function(_){return m[_]=1}),n=m),n=hE(a,n)),b=a.length;b--;)if(~h.indexOf(a[b])){d=l[b],n==="all"?(u[b]=n,p=d,f={}):(f=u[b]=u[b]||{},p=n);for(m in p)g=d&&d[m],g&&((!("kill"in g.d)||g.d.kill(m)===!0)&&Ih(this,g,"_pt"),delete d[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&vo(this),this},t.to=function(s,n){return new t(s,n,arguments[2])},t.from=function(s,n){return bo(1,arguments)},t.delayedCall=function(s,n,o,a){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:n,onReverseComplete:n,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(s,n,o){return bo(2,arguments)},t.set=function(s,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(s,n)},t.killTweensOf=function(s,n,o){return Xt.killTweensOf(s,n,o)},t}(So);ze($t.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Se("staggerTo,staggerFrom,staggerFromTo",function(r){$t[r]=function(){var t=new ve,e=Vu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var qu=function(t,e,i){return t[e]=i},_y=function(t,e,i){return t[e](i)},cE=function(t,e,i,s){return t[e](s.fp,i)},uE=function(t,e,i){return t.setAttribute(e,i)},td=function(t,e){return Vt(t[e])?_y:Ru(t[e])&&t.setAttribute?uE:qu},vy=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},dE=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},wy=function(t,e){var i=e._pt,s="";if(!t&&e.b)s=e.b;else if(t===1&&e.e)s=e.e;else{for(;i;)s=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+s,i=i._next;s+=e.c}e.set(e.t,e.p,s,e)},ed=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},fE=function(t,e,i,s){for(var n=this._pt,o;n;)o=n._next,n.p===s&&n.modifier(t,e,i),n=o},pE=function(t){for(var e=this._pt,i,s;e;)s=e._next,e.p===t&&!e.op||e.op===t?Ih(this,e,"_pt"):e.dep||(i=1),e=s;return!i},mE=function(t,e,i,s){s.mSet(t,e,s.m.call(s.tween,i,s.mt),s)},Ty=function(t){for(var e=t._pt,i,s,n,o;e;){for(i=e._next,s=n;s&&s.pr>e.pr;)s=s._next;(e._prev=s?s._prev:o)?e._prev._next=e:n=e,(e._next=s)?s._prev=e:o=e,e=i}t._pt=n},Ce=function(){function r(e,i,s,n,o,a,h,l,c){this.t=i,this.s=n,this.c=o,this.p=s,this.r=a||vy,this.d=h||this,this.set=l||qu,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(i,s,n){this.mSet=this.mSet||this.set,this.set=mE,this.m=i,this.mt=n,this.tween=s},r}();Se(Uu+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return Du[r]=1}),ke.TweenMax=ke.TweenLite=$t,ke.TimelineLite=ke.TimelineMax=ve,Xt=new ve({sortChildren:!1,defaults:un,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Ne.stringFilter=dy;var xs=[],Ph={},gE=[],Sy=0,yE=0,id=function(t){return(Ph[t]||gE).map(function(e){return e()})},rd=function(){var t=Date.now(),e=[];t-Sy>2&&(id("matchMediaInit"),xs.forEach(function(i){var s=i.queries,n=i.conditions,o,a,h,l;for(a in s)o=Gi.matchMedia(s[a]).matches,o&&(h=1),o!==n[a]&&(n[a]=o,l=1);l&&(i.revert(),h&&e.push(i))}),id("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(s){return i.add(null,s)})}),Sy=t,id("matchMedia"))},Cy=function(){function r(e,i){this.selector=i&&Hu(i),this.data=[],this._r=[],this.isReverted=!1,this.id=yE++,e&&this.add(e)}var t=r.prototype;return t.add=function(i,s,n){Vt(i)&&(n=s,s=i,i=Vt);var o=this,a=function(){var l=Dt,c=o.selector,u;return l&&l!==o&&l.data.push(o),n&&(o.selector=Hu(n)),Dt=o,u=s.apply(o,arguments),Vt(u)&&o._r.push(u),Dt=l,o.selector=c,o.isReverted=!1,u};return o.last=a,i===Vt?a(o,function(h){return o.add(null,h)}):i?o[i]=a:a},t.ignore=function(i){var s=Dt;Dt=null,i(this),Dt=s},t.getTweens=function(){var i=[];return this.data.forEach(function(s){return s instanceof r?i.push.apply(i,s.getTweens()):s instanceof $t&&!(s.parent&&s.parent.data==="nested")&&i.push(s)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,s){var n=this;if(i?function(){for(var a=n.getTweens(),h=n.data.length,l;h--;)l=n.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,u){return u.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),h=n.data.length;h--;)l=n.data[h],l instanceof ve?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof $t)&&l.revert&&l.revert(i);n._r.forEach(function(c){return c(i,n)}),n.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),s)for(var o=xs.length;o--;)xs[o].id===this.id&&xs.splice(o,1)},t.revert=function(i){this.kill(i||{})},r}(),bE=function(){function r(e){this.contexts=[],this.scope=e,Dt&&Dt.data.push(this)}var t=r.prototype;return t.add=function(i,s,n){Li(i)||(i={matches:i});var o=new Cy(0,n||this.scope),a=o.conditions={},h,l,c;Dt&&!o.selector&&(o.selector=Dt.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=i;for(l in i)l==="all"?c=1:(h=Gi.matchMedia(i[l]),h&&(xs.indexOf(o)<0&&xs.push(o),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(rd):h.addEventListener("change",rd)));return c&&s(o,function(u){return o.add(null,u)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(s){return s.kill(i,!0)})},r}(),Lh={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(s){return hy(s)})},timeline:function(t){return new ve(t)},getTweensOf:function(t,e){return Xt.getTweensOf(t,e)},getProperty:function(t,e,i,s){ae(t)&&(t=Je(t)[0]);var n=ps(t||{}).get,o=i?Hg:Vg;return i==="native"&&(i=""),t&&(e?o((De[e]&&De[e].get||n)(t,e,i,s)):function(a,h,l){return o((De[a]&&De[a].get||n)(t,a,h,l))})},quickSetter:function(t,e,i){if(t=Je(t),t.length>1){var s=t.map(function(c){return Ee.quickSetter(c,e,i)}),n=s.length;return function(c){for(var u=n;u--;)s[u](c)}}t=t[0]||{};var o=De[e],a=ps(t),h=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(c){var u=new o;gn._pt=0,u.init(t,i?c+i:c,gn,0,[t]),u.render(1,u),gn._pt&&ed(1,gn)}:a.set(t,h);return o?l:function(c){return l(t,h,i?c+i:c,a,1)}},quickTo:function(t,e,i){var s,n=Ee.to(t,ms((s={},s[e]="+=0.1",s.paused=!0,s),i||{})),o=function(h,l,c){return n.resetTo(e,h,l,c)};return o.tween=n,o},isTweening:function(t){return Xt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=ys(t.ease,un.ease)),Kg(un,t||{})},config:function(t){return Kg(Ne,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,s=t.plugins,n=t.defaults,o=t.extendTimeline;(s||"").split(",").forEach(function(a){return a&&!De[a]&&!ke[a]&&mo(e+" effect requires "+a+" plugin.")}),Bu[e]=function(a,h,l){return i(Je(a),ze(h||{},n),l)},o&&(ve.prototype[e]=function(a,h,l){return this.add(Bu[e](a,Li(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,e){St[t]=ys(e)},parseEase:function(t,e){return arguments.length?ys(t,e):St},getById:function(t){return Xt.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new ve(t),s,n;for(i.smoothChildTiming=Te(t.smoothChildTiming),Xt.remove(i),i._dp=0,i._time=i._tTime=Xt._time,s=Xt._first;s;)n=s._next,(e||!(!s._dur&&s instanceof $t&&s.vars.onComplete===s._targets[0]))&&Fi(i,s,s._start-s._delay),s=n;return Fi(Xt,i,0),i},context:function(t,e){return t?new Cy(t,e):Dt},matchMedia:function(t){return new bE(t)},matchMediaRefresh:function(){return xs.forEach(function(t){var e=t.conditions,i,s;for(s in e)e[s]&&(e[s]=!1,i=1);i&&t.revert()})||rd()},addEventListener:function(t,e){var i=Ph[t]||(Ph[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=Ph[t],s=i&&i.indexOf(e);s>=0&&i.splice(s,1)},utils:{wrap:JC,wrapYoyo:$C,distribute:ey,random:ry,snap:iy,normalize:jC,getUnit:me,clamp:HC,splitColor:ly,toArray:Je,selector:Hu,mapRange:ny,pipe:YC,unitize:zC,interpolate:QC,shuffle:ty},install:Og,effects:Bu,ticker:Be,updateRoot:ve.updateRoot,plugins:De,globalTimeline:Xt,core:{PropTween:Ce,globals:Bg,Tween:$t,Timeline:ve,Animation:So,getCache:ps,_removeLinkedListItem:Ih,reverting:function(){return fe},context:function(t){return t&&Dt&&(Dt.data.push(t),t._ctx=Dt),Dt},suppressOverwrites:function(t){return Au=t}}};Se("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Lh[r]=$t[r]}),Be.add(ve.updateRoot),gn=Lh.to({},{duration:0});var xE=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},_E=function(t,e){var i=t._targets,s,n,o;for(s in e)for(n=i.length;n--;)o=t._ptLookup[n][s],o&&(o=o.d)&&(o._pt&&(o=xE(o,s)),o&&o.modifier&&o.modifier(e[s],t,i[n],s))},sd=function(t,e){return{name:t,rawVars:1,init:function(s,n,o){o._onInit=function(a){var h,l;if(ae(n)&&(h={},Se(n,function(c){return h[c]=1}),n=h),e){h={};for(l in n)h[l]=e(n[l]);n=h}_E(a,n)}}}},Ee=Lh.registerPlugin({name:"attr",init:function(t,e,i,s,n){var o,a,h;this.tween=i;for(o in e)h=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(h||0)+"",e[o],s,n,0,0,o),a.op=o,a.b=h,this._props.push(o)},render:function(t,e){for(var i=e._pt;i;)fe?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},sd("roundProps",Ku),sd("modifiers"),sd("snap",iy))||Lh;$t.version=ve.version=Ee.version="3.12.5",Dg=1,Pu()&&yn(),St.Power0,St.Power1,St.Power2,St.Power3,St.Power4,St.Linear,St.Quad,St.Cubic,St.Quart,St.Quint,St.Strong,St.Elastic,St.Back,St.SteppedEase,St.Bounce,St.Sine,St.Expo,St.Circ;/*!
1167
+ */var Ne={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},un={duration:.5,overwrite:!1,delay:0},Au,fe,Dt,Ye=1e8,Pt=1/Ye,Mu=Math.PI*2,MC=Mu/4,RC=0,Lg=Math.sqrt,PC=Math.cos,LC=Math.sin,ae=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},rr=function(t){return typeof t=="number"},Ru=function(t){return typeof t>"u"},Li=function(t){return typeof t=="object"},Se=function(t){return t!==!1},Pu=function(){return typeof window<"u"},vh=function(t){return Vt(t)||ae(t)},Gg=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},pe=Array.isArray,Lu=/(?:-?\.?\d|\.)+/gi,Fg=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,dn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Gu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ng=/[+-]=-?[.\d]+/,kg=/[^,'"\[\]\s]+/gi,GC=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Xt,Gi,Fu,Nu,ke={},wh={},Dg,Og=function(t){return(wh=ms(t,ke))&&Ie},ku=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},mo=function(t,e){return!e&&console.warn(t)},Bg=function(t,e){return t&&(ke[t]=e)&&wh&&(wh[t]=e)||ke},go=function(){return 0},FC={suppressEvents:!0,isStart:!0,kill:!1},Th={suppressEvents:!0,kill:!1},NC={suppressEvents:!0},Du={},Lr=[],Ou={},Ug,De={},Bu={},Xg=30,Sh=[],Uu="",Xu=function(t){var e=t[0],i,s;if(Li(e)||Vt(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(s=Sh.length;s--&&!Sh[s].targetTest(e););i=Sh[s]}for(s=t.length;s--;)t[s]&&(t[s]._gsap||(t[s]._gsap=new gy(t[s],i)))||t.splice(s,1);return t},ps=function(t){return t._gsap||Xu(Je(t))[0]._gsap},Wg=function(t,e,i){return(i=t[e])&&Vt(i)?t[e]():Ru(i)&&t.getAttribute&&t.getAttribute(e)||i},Ce=function(t,e){return(t=t.split(",")).forEach(e)||t},Yt=function(t){return Math.round(t*1e5)/1e5||0},he=function(t){return Math.round(t*1e7)/1e7||0},fn=function(t,e){var i=e.charAt(0),s=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+s:i==="-"?t-s:i==="*"?t*s:t/s},kC=function(t,e){for(var i=e.length,s=0;t.indexOf(e[s])<0&&++s<i;);return s<i},Ch=function(){var t=Lr.length,e=Lr.slice(0),i,s;for(Ou={},Lr.length=0,i=0;i<t;i++)s=e[i],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Zg=function(t,e,i,s){Lr.length&&!fe&&Ch(),t.render(e,i,fe&&e<0&&(t._initted||t._startAt)),Lr.length&&!fe&&Ch()},Vg=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(kg).length<2?e:ae(t)?t.trim():t},Hg=function(t){return t},ze=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},DC=function(t){return function(e,i){for(var s in i)s in e||s==="duration"&&t||s==="ease"||(e[s]=i[s])}},ms=function(t,e){for(var i in e)t[i]=e[i];return t},Kg=function r(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=Li(e[i])?r(t[i]||(t[i]={}),e[i]):e[i]);return t},Eh=function(t,e){var i={},s;for(s in t)s in e||(i[s]=t[s]);return i},yo=function(t){var e=t.parent||Xt,i=t.keyframes?DC(pe(t.keyframes)):ze;if(Se(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},OC=function(t,e){for(var i=t.length,s=i===e.length;s&&i--&&t[i]===e[i];);return i<0},Yg=function(t,e,i,s,n){var o=t[s],a;if(n)for(a=e[n];o&&o[n]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[s]=e,e._prev=o,e.parent=e._dp=t,e},Ih=function(t,e,i,s){i===void 0&&(i="_first"),s===void 0&&(s="_last");var n=e._prev,o=e._next;n?n._next=o:t[i]===e&&(t[i]=o),o?o._prev=n:t[s]===e&&(t[s]=n),e._next=e._prev=e.parent=null},Gr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},gs=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},BC=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Wu=function(t,e,i,s){return t._startAt&&(fe?t._startAt.revert(Th):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,s))},UC=function r(t){return!t||t._ts&&r(t.parent)},zg=function(t){return t._repeat?pn(t._tTime,t=t.duration()+t._rDelay)*t:0},pn=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},Ah=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Mh=function(t){return t._end=he(t._start+(t._tDur/Math.abs(t._ts||t._rts||Pt)||0))},Rh=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=he(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Mh(t),i._dirty||gs(i,t)),t},jg=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=Ah(t.rawTime(),e),(!e._dur||xo(0,e.totalDuration(),i)-e._tTime>Pt)&&e.render(i,!0)),gs(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-Pt}},Fi=function(t,e,i,s){return e.parent&&Gr(e),e._start=he((rr(i)?i:i||t!==Xt?je(t,i,e):t._time)+e._delay),e._end=he(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Yg(t,e,"_first","_last",t._sort?"_start":0),Zu(e)||(t._recent=e),s||jg(t,e),t._ts<0&&Rh(t,t._tTime),t},Jg=function(t,e){return(ke.ScrollTrigger||ku("scrollTrigger",e))&&ke.ScrollTrigger.create(e,t)},$g=function(t,e,i,s,n){if(Qu(t,e,n),!t._initted)return 1;if(!i&&t._pt&&!fe&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Ug!==Be.frame)return Lr.push(t),t._lazy=[n,s],1},XC=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Zu=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},WC=function(t,e,i,s){var n=t.ratio,o=e<0||!e&&(!t._start&&XC(t)&&!(!t._initted&&Zu(t))||(t._ts<0||t._dp._ts<0)&&!Zu(t))?0:1,a=t._rDelay,h=0,l,c,u;if(a&&t._repeat&&(h=xo(0,t._tDur,e),c=pn(h,a),t._yoyo&&c&1&&(o=1-o),c!==pn(t._tTime,a)&&(n=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==n||fe||s||t._zTime===Pt||!e&&t._zTime){if(!t._initted&&$g(t,e,s,i,h))return;for(u=t._zTime,t._zTime=e||(i?Pt:0),i||(i=e&&!u),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=h,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&Wu(t,e,i,!0),t._onUpdate&&!i&&Oe(t,"onUpdate"),h&&t._repeat&&!i&&t.parent&&Oe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Gr(t,1),!i&&!fe&&(Oe(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},ZC=function(t,e,i){var s;if(i>e)for(s=t._first;s&&s._start<=i;){if(s.data==="isPause"&&s._start>e)return s;s=s._next}else for(s=t._last;s&&s._start>=i;){if(s.data==="isPause"&&s._start<e)return s;s=s._prev}},mn=function(t,e,i,s){var n=t._repeat,o=he(e)||0,a=t._tTime/t._tDur;return a&&!s&&(t._time*=o/t._dur),t._dur=o,t._tDur=n?n<0?1e10:he(o*(n+1)+t._rDelay*n):o,a>0&&!s&&Rh(t,t._tTime=t._tDur*a),t.parent&&Mh(t),i||gs(t.parent,t),t},Qg=function(t){return t instanceof ve?gs(t):mn(t,t._dur)},VC={_start:0,endTime:go,totalDuration:go},je=function r(t,e,i){var s=t.labels,n=t._recent||VC,o=t.duration()>=Ye?n.endTime(!1):t._dur,a,h,l;return ae(e)&&(isNaN(e)||e in s)?(h=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),h==="<"||h===">"?(a>=0&&(e=e.replace(/=/,"")),(h==="<"?n._start:n.endTime(n._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?n:i).totalDuration()/100:1)):a<0?(e in s||(s[e]=o),s[e]):(h=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&i&&(h=h/100*(pe(i)?i[0]:i).totalDuration()),a>1?r(t,e.substr(0,a-1),i)+h:o+h)):e==null?o:+e},bo=function(t,e,i){var s=rr(e[1]),n=(s?2:1)+(t<2?0:1),o=e[n],a,h;if(s&&(o.duration=e[1]),o.parent=i,t){for(a=o,h=i;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=Se(h.vars.inherit)&&h.parent;o.immediateRender=Se(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[n-1]}return new $t(e[0],o,e[n+1])},Fr=function(t,e){return t||t===0?e(t):e},xo=function(t,e,i){return i<t?t:i>e?e:i},me=function(t,e){return!ae(t)||!(e=GC.exec(t))?"":e[1]},HC=function(t,e,i){return Fr(i,function(s){return xo(t,e,s)})},Vu=[].slice,qg=function(t,e){return t&&Li(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Li(t[0]))&&!t.nodeType&&t!==Gi},KC=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(s){var n;return ae(s)&&!e||qg(s,1)?(n=i).push.apply(n,Je(s)):i.push(s)})||i},Je=function(t,e,i){return Dt&&!e&&Dt.selector?Dt.selector(t):ae(t)&&!i&&(Fu||!yn())?Vu.call((e||Nu).querySelectorAll(t),0):pe(t)?KC(t,i):qg(t)?Vu.call(t,0):t?[t]:[]},Hu=function(t){return t=Je(t)[0]||mo("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return Je(e,i.querySelectorAll?i:i===t?mo("Invalid scope")||Nu.createElement("div"):t)}},ty=function(t){return t.sort(function(){return .5-Math.random()})},ey=function(t){if(Vt(t))return t;var e=Li(t)?t:{each:t},i=ys(e.ease),s=e.from||0,n=parseFloat(e.base)||0,o={},a=s>0&&s<1,h=isNaN(s)||a,l=e.axis,c=s,u=s;return ae(s)?c=u={center:.5,edges:.5,end:1}[s]||0:!a&&h&&(c=s[0],u=s[1]),function(d,f,p){var m=(p||e).length,g=o[m],b,_,x,v,T,C,E,I,R;if(!g){if(R=e.grid==="auto"?0:(e.grid||[1,Ye])[1],!R){for(E=-Ye;E<(E=p[R++].getBoundingClientRect().left)&&R<m;);R<m&&R--}for(g=o[m]=[],b=h?Math.min(R,m)*c-.5:s%R,_=R===Ye?0:h?m*u/R-.5:s/R|0,E=0,I=Ye,C=0;C<m;C++)x=C%R-b,v=_-(C/R|0),g[C]=T=l?Math.abs(l==="y"?v:x):Lg(x*x+v*v),T>E&&(E=T),T<I&&(I=T);s==="random"&&ty(g),g.max=E-I,g.min=I,g.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(R>m?m-1:l?l==="y"?m/R:R:Math.max(R,m/R))||0)*(s==="edges"?-1:1),g.b=m<0?n-m:n,g.u=me(e.amount||e.each)||0,i=i&&m<0?fy(i):i}return m=(g[d]-g.min)/g.max||0,he(g.b+(i?i(m):m)*g.v)+g.u}},Ku=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var s=he(Math.round(parseFloat(i)/t)*t*e);return(s-s%1)/e+(rr(i)?0:me(i))}},iy=function(t,e){var i=pe(t),s,n;return!i&&Li(t)&&(s=i=t.radius||Ye,t.values?(t=Je(t.values),(n=!rr(t[0]))&&(s*=s)):t=Ku(t.increment)),Fr(e,i?Vt(t)?function(o){return n=t(o),Math.abs(n-o)<=s?n:o}:function(o){for(var a=parseFloat(n?o.x:o),h=parseFloat(n?o.y:0),l=Ye,c=0,u=t.length,d,f;u--;)n?(d=t[u].x-a,f=t[u].y-h,d=d*d+f*f):d=Math.abs(t[u]-a),d<l&&(l=d,c=u);return c=!s||l<=s?t[c]:o,n||c===o||rr(o)?c:c+me(o)}:Ku(t))},ry=function(t,e,i,s){return Fr(pe(t)?!e:i===!0?!!(i=0):!s,function(){return pe(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(s=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*s)/s})},YC=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(s){return e.reduce(function(n,o){return o(n)},s)}},zC=function(t,e){return function(i){return t(parseFloat(i))+(e||me(i))}},jC=function(t,e,i){return ny(t,e,0,1,i)},sy=function(t,e,i){return Fr(i,function(s){return t[~~e(s)]})},JC=function r(t,e,i){var s=e-t;return pe(t)?sy(t,r(0,t.length),e):Fr(i,function(n){return(s+(n-t)%s)%s+t})},$C=function r(t,e,i){var s=e-t,n=s*2;return pe(t)?sy(t,r(0,t.length-1),e):Fr(i,function(o){return o=(n+(o-t)%n)%n||0,t+(o>s?n-o:o)})},_o=function(t){for(var e=0,i="",s,n,o,a;~(s=t.indexOf("random(",e));)o=t.indexOf(")",s),a=t.charAt(s+7)==="[",n=t.substr(s+7,o-s-7).match(a?kg:Lu),i+=t.substr(e,s-e)+ry(a?n:+n[0],a?0:+n[1],+n[2]||1e-5),e=o+1;return i+t.substr(e,t.length-e)},ny=function(t,e,i,s,n){var o=e-t,a=s-i;return Fr(n,function(h){return i+((h-t)/o*a||0)})},QC=function r(t,e,i,s){var n=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!n){var o=ae(t),a={},h,l,c,u,d;if(i===!0&&(s=1)&&(i=null),o)t={p:t},e={p:e};else if(pe(t)&&!pe(e)){for(c=[],u=t.length,d=u-2,l=1;l<u;l++)c.push(r(t[l-1],t[l]));u--,n=function(p){p*=u;var m=Math.min(d,~~p);return c[m](p-m)},i=e}else s||(t=ms(pe(t)?[]:{},t));if(!c){for(h in e)Ju.call(a,t,h,"get",e[h]);n=function(p){return ed(p,a)||(o?t.p:t)}}}return Fr(i,n)},oy=function(t,e,i){var s=t.labels,n=Ye,o,a,h;for(o in s)a=s[o]-e,a<0==!!i&&a&&n>(a=Math.abs(a))&&(h=o,n=a);return h},Oe=function(t,e,i){var s=t.vars,n=s[e],o=Dt,a=t._ctx,h,l,c;if(n)return h=s[e+"Params"],l=s.callbackScope||t,i&&Lr.length&&Ch(),a&&(Dt=a),c=h?n.apply(l,h):n.call(l),Dt=o,c},vo=function(t){return Gr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!fe),t.progress()<1&&Oe(t,"onInterrupt"),t},gn,ay=[],hy=function(t){if(t)if(t=!t.name&&t.default||t,Pu()||t.headless){var e=t.name,i=Vt(t),s=e&&!i&&t.init?function(){this._props=[]}:t,n={init:go,render:ed,add:Ju,kill:pE,modifier:fE,rawVars:0},o={targetTest:0,get:0,getSetter:td,aliases:{},register:0};if(yn(),t!==s){if(De[e])return;ze(s,ze(Eh(t,n),o)),ms(s.prototype,ms(n,Eh(t,o))),De[s.prop=e]=s,t.targetTest&&(Sh.push(s),Du[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Bg(e,s),t.register&&t.register(Ie,s,Ee)}else ay.push(t)},Rt=255,wo={aqua:[0,Rt,Rt],lime:[0,Rt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Rt],navy:[0,0,128],white:[Rt,Rt,Rt],olive:[128,128,0],yellow:[Rt,Rt,0],orange:[Rt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Rt,0,0],pink:[Rt,192,203],cyan:[0,Rt,Rt],transparent:[Rt,Rt,Rt,0]},Yu=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*Rt+.5|0},ly=function(t,e,i){var s=t?rr(t)?[t>>16,t>>8&Rt,t&Rt]:0:wo.black,n,o,a,h,l,c,u,d,f,p;if(!s){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),wo[t])s=wo[t];else if(t.charAt(0)==="#"){if(t.length<6&&(n=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+n+n+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return s=parseInt(t.substr(1,6),16),[s>>16,s>>8&Rt,s&Rt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),s=[t>>16,t>>8&Rt,t&Rt]}else if(t.substr(0,3)==="hsl"){if(s=p=t.match(Lu),!e)h=+s[0]%360/360,l=+s[1]/100,c=+s[2]/100,o=c<=.5?c*(l+1):c+l-c*l,n=c*2-o,s.length>3&&(s[3]*=1),s[0]=Yu(h+1/3,n,o),s[1]=Yu(h,n,o),s[2]=Yu(h-1/3,n,o);else if(~t.indexOf("="))return s=t.match(Fg),i&&s.length<4&&(s[3]=1),s}else s=t.match(Lu)||wo.transparent;s=s.map(Number)}return e&&!p&&(n=s[0]/Rt,o=s[1]/Rt,a=s[2]/Rt,u=Math.max(n,o,a),d=Math.min(n,o,a),c=(u+d)/2,u===d?h=l=0:(f=u-d,l=c>.5?f/(2-u-d):f/(u+d),h=u===n?(o-a)/f+(o<a?6:0):u===o?(a-n)/f+2:(n-o)/f+4,h*=60),s[0]=~~(h+.5),s[1]=~~(l*100+.5),s[2]=~~(c*100+.5)),i&&s.length<4&&(s[3]=1),s},cy=function(t){var e=[],i=[],s=-1;return t.split(Nr).forEach(function(n){var o=n.match(dn)||[];e.push.apply(e,o),i.push(s+=o.length+1)}),e.c=i,e},uy=function(t,e,i){var s="",n=(t+s).match(Nr),o=e?"hsla(":"rgba(",a=0,h,l,c,u;if(!n)return t;if(n=n.map(function(d){return(d=ly(d,e,1))&&o+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),i&&(c=cy(t),h=i.c,h.join(s)!==c.c.join(s)))for(l=t.replace(Nr,"1").split(dn),u=l.length-1;a<u;a++)s+=l[a]+(~h.indexOf(a)?n.shift()||o+"0,0,0,0)":(c.length?c:n.length?n:i).shift());if(!l)for(l=t.split(Nr),u=l.length-1;a<u;a++)s+=l[a]+n[a];return s+l[u]},Nr=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in wo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),qC=/hsl[a]?\(/,dy=function(t){var e=t.join(" "),i;if(Nr.lastIndex=0,Nr.test(e))return i=qC.test(e),t[1]=uy(t[1],i),t[0]=uy(t[0],i,cy(t[1])),!0},To,Be=function(){var r=Date.now,t=500,e=33,i=r(),s=i,n=1e3/240,o=n,a=[],h,l,c,u,d,f,p=function m(g){var b=r()-s,_=g===!0,x,v,T,C;if((b>t||b<0)&&(i+=b-e),s+=b,T=s-i,x=T-o,(x>0||_)&&(C=++u.frame,d=T-u.time*1e3,u.time=T=T/1e3,o+=x+(x>=n?4:n-x),v=1),_||(h=l(m)),v)for(f=0;f<a.length;f++)a[f](T,d,C,g)};return u={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(g){return d/(1e3/(g||60))},wake:function(){Dg&&(!Fu&&Pu()&&(Gi=Fu=window,Nu=Gi.document||{},ke.gsap=Ie,(Gi.gsapVersions||(Gi.gsapVersions=[])).push(Ie.version),Og(wh||Gi.GreenSockGlobals||!Gi.gsap&&Gi||{}),ay.forEach(hy)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&u.sleep(),l=c||function(g){return setTimeout(g,o-u.time*1e3+1|0)},To=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),To=0,l=go},lagSmoothing:function(g,b){t=g||1/0,e=Math.min(b||33,t)},fps:function(g){n=1e3/(g||240),o=u.time*1e3+n},add:function(g,b,_){var x=b?function(v,T,C,E){g(v,T,C,E),u.remove(x)}:g;return u.remove(g),a[_?"unshift":"push"](x),yn(),x},remove:function(g,b){~(b=a.indexOf(g))&&a.splice(b,1)&&f>=b&&f--},_listeners:a},u}(),yn=function(){return!To&&Be.wake()},St={},tE=/^[\d.\-M][\d.\-,\s]/,eE=/["']/g,iE=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),s=i[0],n=1,o=i.length,a,h,l;n<o;n++)h=i[n],a=n!==o-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),e[s]=isNaN(l)?l.replace(eE,"").trim():+l,s=h.substr(a+1).trim();return e},rE=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),s=t.indexOf("(",e);return t.substring(e,~s&&s<i?t.indexOf(")",i+1):i)},sE=function(t){var e=(t+"").split("("),i=St[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[iE(e[1])]:rE(t).split(",").map(Vg)):St._CE&&tE.test(t)?St._CE("",t):i},fy=function(t){return function(e){return 1-t(1-e)}},py=function r(t,e){for(var i=t._first,s;i;)i instanceof ve?r(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?r(i.timeline,e):(s=i._ease,i._ease=i._yEase,i._yEase=s,i._yoyo=e)),i=i._next},ys=function(t,e){return t&&(Vt(t)?t:St[t]||sE(t))||e},bs=function(t,e,i,s){i===void 0&&(i=function(h){return 1-e(1-h)}),s===void 0&&(s=function(h){return h<.5?e(h*2)/2:1-e((1-h)*2)/2});var n={easeIn:e,easeOut:i,easeInOut:s},o;return Ce(t,function(a){St[a]=ke[a]=n,St[o=a.toLowerCase()]=i;for(var h in n)St[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=St[a+"."+h]=n[h]}),n},my=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},zu=function r(t,e,i){var s=e>=1?e:1,n=(i||(t?.3:.45))/(e<1?e:1),o=n/Mu*(Math.asin(1/s)||0),a=function(c){return c===1?1:s*Math.pow(2,-10*c)*LC((c-o)*n)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:my(a);return n=Mu/n,h.config=function(l,c){return r(t,l,c)},h},ju=function r(t,e){e===void 0&&(e=1.70158);var i=function(o){return o?--o*o*((e+1)*o+e)+1:0},s=t==="out"?i:t==="in"?function(n){return 1-i(1-n)}:my(i);return s.config=function(n){return r(t,n)},s};Ce("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;bs(r+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})}),St.Linear.easeNone=St.none=St.Linear.easeIn,bs("Elastic",zu("in"),zu("out"),zu()),function(r,t){var e=1/t,i=2*e,s=2.5*e,n=function(a){return a<e?r*a*a:a<i?r*Math.pow(a-1.5/t,2)+.75:a<s?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};bs("Bounce",function(o){return 1-n(1-o)},n)}(7.5625,2.75),bs("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),bs("Circ",function(r){return-(Lg(1-r*r)-1)}),bs("Sine",function(r){return r===1?1:-PC(r*MC)+1}),bs("Back",ju("in"),ju("out"),ju()),St.SteppedEase=St.steps=ke.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,s=t+(e?0:1),n=e?1:0,o=1-Pt;return function(a){return((s*xo(0,o,a)|0)+n)*i}}},un.ease=St["quad.out"],Ce("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Uu+=r+","+r+"Params,"});var gy=function(t,e){this.id=RC++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Wg,this.set=e?e.getSetter:td},So=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,mn(this,+e.duration,1,1),this.data=e.data,Dt&&(this._ctx=Dt,Dt.data.push(this)),To||Be.wake()}var t=r.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,mn(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,s){if(yn(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Rh(this,i),!n._dp||n.parent||jg(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&Fi(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Pt||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),Zg(this,i,s)),this},t.time=function(i,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+zg(this))%(this._dur+this._rDelay)||(i?this._dur:0),s):this._time},t.totalProgress=function(i,s){return arguments.length?this.totalTime(this.totalDuration()*i,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(i,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+zg(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,s){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*n,s):this._repeat?pn(this._tTime,n)+1:1},t.timeScale=function(i,s){if(!arguments.length)return this._rts===-Pt?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?Ah(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-Pt?0:this._rts,this.totalTime(xo(-Math.abs(this._delay),this._tDur,n),s!==!1),Mh(this),BC(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(yn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Pt&&(this._tTime-=Pt)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=i;var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Fi(s,this,i-this._delay),this}return this._start},t.endTime=function(i){return this._start+(Se(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var s=this.parent||this._dp;return s?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ah(s.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=NC);var s=fe;return fe=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),fe=s,this},t.globalTime=function(i){for(var s=this,n=arguments.length?i:s.rawTime();s;)n=s._start+n/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(i):n},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,Qg(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var s=this._time;return this._rDelay=i,Qg(this),s?this.time(s):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,s){return this.totalTime(je(this,i),Se(s))},t.restart=function(i,s){return this.play().totalTime(i?-this._delay:0,Se(s))},t.play=function(i,s){return i!=null&&this.seek(i,s),this.reversed(!1).paused(!1)},t.reverse=function(i,s){return i!=null&&this.seek(i||this.totalDuration(),s),this.reversed(!0).paused(!1)},t.pause=function(i,s){return i!=null&&this.seek(i,s),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-Pt:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Pt,this},t.isActive=function(){var i=this.parent||this._dp,s=this._start,n;return!!(!i||this._ts&&this._initted&&i.isActive()&&(n=i.rawTime(!0))>=s&&n<this.endTime(!0)-Pt)},t.eventCallback=function(i,s,n){var o=this.vars;return arguments.length>1?(s?(o[i]=s,n&&(o[i+"Params"]=n),i==="onUpdate"&&(this._onUpdate=s)):delete o[i],this):o[i]},t.then=function(i){var s=this;return new Promise(function(n){var o=Vt(i)?i:Hg,a=function(){var l=s.then;s.then=null,Vt(o)&&(o=o(s))&&(o.then||o===s)&&(s.then=l),n(o),s.then=l};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?a():s._prom=a})},t.kill=function(){vo(this)},r}();ze(So.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Pt,_prom:0,_ps:!1,_rts:1});var ve=function(r){Pg(t,r);function t(i,s){var n;return i===void 0&&(i={}),n=r.call(this,i)||this,n.labels={},n.smoothChildTiming=!!i.smoothChildTiming,n.autoRemoveChildren=!!i.autoRemoveChildren,n._sort=Se(i.sortChildren),Xt&&Fi(i.parent||Xt,ir(n),s),i.reversed&&n.reverse(),i.paused&&n.paused(!0),i.scrollTrigger&&Jg(ir(n),i.scrollTrigger),n}var e=t.prototype;return e.to=function(s,n,o){return bo(0,arguments,this),this},e.from=function(s,n,o){return bo(1,arguments,this),this},e.fromTo=function(s,n,o,a){return bo(2,arguments,this),this},e.set=function(s,n,o){return n.duration=0,n.parent=this,yo(n).repeatDelay||(n.repeat=0),n.immediateRender=!!n.immediateRender,new $t(s,n,je(this,o),1),this},e.call=function(s,n,o){return Fi(this,$t.delayedCall(0,s,n),o)},e.staggerTo=function(s,n,o,a,h,l,c){return o.duration=n,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=c,o.parent=this,new $t(s,o,je(this,h)),this},e.staggerFrom=function(s,n,o,a,h,l,c){return o.runBackwards=1,yo(o).immediateRender=Se(o.immediateRender),this.staggerTo(s,n,o,a,h,l,c)},e.staggerFromTo=function(s,n,o,a,h,l,c,u){return a.startAt=o,yo(a).immediateRender=Se(a.immediateRender),this.staggerTo(s,n,a,h,l,c,u)},e.render=function(s,n,o){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=s<=0?0:he(s),u=this._zTime<0!=s<0&&(this._initted||!l),d,f,p,m,g,b,_,x,v,T,C,E;if(this!==Xt&&c>h&&s>=0&&(c=h),c!==this._tTime||o||u){if(a!==this._time&&l&&(c+=this._time-a,s+=this._time-a),d=c,v=this._start,x=this._ts,b=!x,u&&(l||(a=this._zTime),(s||!n)&&(this._zTime=s)),this._repeat){if(C=this._yoyo,g=l+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(g*100+s,n,o);if(d=he(c%g),c===h?(m=this._repeat,d=l):(m=~~(c/g),m&&m===c/g&&(d=l,m--),d>l&&(d=l)),T=pn(this._tTime,g),!a&&this._tTime&&T!==m&&this._tTime-T*g-this._dur<=0&&(T=m),C&&m&1&&(d=l-d,E=1),m!==T&&!this._lock){var I=C&&T&1,R=I===(C&&m&1);if(m<T&&(I=!I),a=I?0:c%l?l:c,this._lock=1,this.render(a||(E?0:he(m*g)),n,!l)._lock=0,this._tTime=c,!n&&this.parent&&Oe(this,"onRepeat"),this.vars.repeatRefresh&&!E&&(this.invalidate()._lock=1),a&&a!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,R&&(this._lock=2,a=I?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!E&&this.invalidate()),this._lock=0,!this._ts&&!b)return this;py(this,E)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=ZC(this,he(a),he(d)),_&&(c-=d-(d=_._start))),this._tTime=c,this._time=d,this._act=!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,a=0),!a&&d&&!n&&!m&&(Oe(this,"onStart"),this._tTime!==c))return this;if(d>=a&&s>=0)for(f=this._first;f;){if(p=f._next,(f._act||d>=f._start)&&f._ts&&_!==f){if(f.parent!==this)return this.render(s,n,o);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,n,o),d!==this._time||!this._ts&&!b){_=0,p&&(c+=this._zTime=-Pt);break}}f=p}else{f=this._last;for(var N=s<0?s:d;f;){if(p=f._prev,(f._act||N<=f._end)&&f._ts&&_!==f){if(f.parent!==this)return this.render(s,n,o);if(f.render(f._ts>0?(N-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(N-f._start)*f._ts,n,o||fe&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!b){_=0,p&&(c+=this._zTime=N?-Pt:Pt);break}}f=p}}if(_&&!n&&(this.pause(),_.render(d>=a?0:-Pt)._zTime=d>=a?1:-1,this._ts))return this._start=v,Mh(this),this.render(s,n,o);this._onUpdate&&!n&&Oe(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(v===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((s||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&Gr(this,1),!n&&!(s<0&&!a)&&(c||a||!h)&&(Oe(this,c===h&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(s,n){var o=this;if(rr(n)||(n=je(this,n,s)),!(s instanceof So)){if(pe(s))return s.forEach(function(a){return o.add(a,n)}),this;if(ae(s))return this.addLabel(s,n);if(Vt(s))s=$t.delayedCall(0,s);else return this}return this!==s?Fi(this,s,n):this},e.getChildren=function(s,n,o,a){s===void 0&&(s=!0),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ye);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof $t?n&&h.push(l):(o&&h.push(l),s&&h.push.apply(h,l.getChildren(!0,n,o)))),l=l._next;return h},e.getById=function(s){for(var n=this.getChildren(1,1,1),o=n.length;o--;)if(n[o].vars.id===s)return n[o]},e.remove=function(s){return ae(s)?this.removeLabel(s):Vt(s)?this.killTweensOf(s):(Ih(this,s),s===this._recent&&(this._recent=this._last),gs(this))},e.totalTime=function(s,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=he(Be.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),r.prototype.totalTime.call(this,s,n),this._forcing=0,this):this._tTime},e.addLabel=function(s,n){return this.labels[s]=je(this,n),this},e.removeLabel=function(s){return delete this.labels[s],this},e.addPause=function(s,n,o){var a=$t.delayedCall(0,n||go,o);return a.data="isPause",this._hasPause=1,Fi(this,a,je(this,s))},e.removePause=function(s){var n=this._first;for(s=je(this,s);n;)n._start===s&&n.data==="isPause"&&Gr(n),n=n._next},e.killTweensOf=function(s,n,o){for(var a=this.getTweensOf(s,o),h=a.length;h--;)kr!==a[h]&&a[h].kill(s,n);return this},e.getTweensOf=function(s,n){for(var o=[],a=Je(s),h=this._first,l=rr(n),c;h;)h instanceof $t?kC(h._targets,a)&&(l?(!kr||h._initted&&h._ts)&&h.globalTime(0)<=n&&h.globalTime(h.totalDuration())>n:!n||h.isActive())&&o.push(h):(c=h.getTweensOf(a,n)).length&&o.push.apply(o,c),h=h._next;return o},e.tweenTo=function(s,n){n=n||{};var o=this,a=je(o,s),h=n,l=h.startAt,c=h.onStart,u=h.onStartParams,d=h.immediateRender,f,p=$t.to(o,ze({ease:n.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:n.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||Pt,onStart:function(){if(o.pause(),!f){var g=n.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());p._dur!==g&&mn(p,g,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,u||[])}},n));return d?p.render(0):p},e.tweenFromTo=function(s,n,o){return this.tweenTo(n,ze({startAt:{time:je(this,s)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(s){return s===void 0&&(s=this._time),oy(this,je(this,s))},e.previousLabel=function(s){return s===void 0&&(s=this._time),oy(this,je(this,s),1)},e.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Pt)},e.shiftChildren=function(s,n,o){o===void 0&&(o=0);for(var a=this._first,h=this.labels,l;a;)a._start>=o&&(a._start+=s,a._end+=s),a=a._next;if(n)for(l in h)h[l]>=o&&(h[l]+=s);return gs(this)},e.invalidate=function(s){var n=this._first;for(this._lock=0;n;)n.invalidate(s),n=n._next;return r.prototype.invalidate.call(this,s)},e.clear=function(s){s===void 0&&(s=!0);for(var n=this._first,o;n;)o=n._next,this.remove(n),n=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),gs(this)},e.totalDuration=function(s){var n=0,o=this,a=o._last,h=Ye,l,c,u;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(u=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&o._sort&&a._ts&&!o._lock?(o._lock=1,Fi(o,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(n-=c,(!u&&!o._dp||u&&u.smoothChildTiming)&&(o._start+=c/o._ts,o._time-=c,o._tTime-=c),o.shiftChildren(-c,!1,-1/0),h=0),a._end>n&&a._ts&&(n=a._end),a=l;mn(o,o===Xt&&o._time>n?o._time:n,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(s){if(Xt._ts&&(Zg(Xt,Ah(s,Xt)),Ug=Be.frame),Be.frame>=Xg){Xg+=Ne.autoSleep||120;var n=Xt._first;if((!n||!n._ts)&&Ne.autoSleep&&Be._listeners.length<2){for(;n&&!n._ts;)n=n._next;n||Be.sleep()}}},t}(So);ze(ve.prototype,{_lock:0,_hasPause:0,_forcing:0});var nE=function(t,e,i,s,n,o,a){var h=new Ee(this._pt,t,e,0,1,wy,null,n),l=0,c=0,u,d,f,p,m,g,b,_;for(h.b=i,h.e=s,i+="",s+="",(b=~s.indexOf("random("))&&(s=_o(s)),o&&(_=[i,s],o(_,t,e),i=_[0],s=_[1]),d=i.match(Gu)||[];u=Gu.exec(s);)p=u[0],m=s.substring(l,u.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==d[c++]&&(g=parseFloat(d[c-1])||0,h._pt={_next:h._pt,p:m||c===1?m:",",s:g,c:p.charAt(1)==="="?fn(g,p)-g:parseFloat(p)-g,m:f&&f<4?Math.round:0},l=Gu.lastIndex);return h.c=l<s.length?s.substring(l,s.length):"",h.fp=a,(Ng.test(s)||b)&&(h.e=0),this._pt=h,h},Ju=function(t,e,i,s,n,o,a,h,l,c){Vt(s)&&(s=s(n||0,t,o));var u=t[e],d=i!=="get"?i:Vt(u)?l?t[e.indexOf("set")||!Vt(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():u,f=Vt(u)?l?cE:_y:qu,p;if(ae(s)&&(~s.indexOf("random(")&&(s=_o(s)),s.charAt(1)==="="&&(p=fn(d,s)+(me(d)||0),(p||p===0)&&(s=p))),!c||d!==s||$u)return!isNaN(d*s)&&s!==""?(p=new Ee(this._pt,t,e,+d||0,s-(d||0),typeof u=="boolean"?dE:vy,0,f),l&&(p.fp=l),a&&p.modifier(a,this,t),this._pt=p):(!u&&!(e in t)&&ku(e,s),nE.call(this,t,e,d,s,f,h||Ne.stringFilter,l))},oE=function(t,e,i,s,n){if(Vt(t)&&(t=Co(t,n,e,i,s)),!Li(t)||t.style&&t.nodeType||pe(t)||Gg(t))return ae(t)?Co(t,n,e,i,s):t;var o={},a;for(a in t)o[a]=Co(t[a],n,e,i,s);return o},yy=function(t,e,i,s,n,o){var a,h,l,c;if(De[t]&&(a=new De[t]).init(n,a.rawVars?e[t]:oE(e[t],s,n,o,i),i,s,o)!==!1&&(i._pt=h=new Ee(i._pt,n,t,0,1,a.render,a,0,a.priority),i!==gn))for(l=i._ptLookup[i._targets.indexOf(n)],c=a._props.length;c--;)l[a._props[c]]=h;return a},kr,$u,Qu=function r(t,e,i){var s=t.vars,n=s.ease,o=s.startAt,a=s.immediateRender,h=s.lazy,l=s.onUpdate,c=s.runBackwards,u=s.yoyoEase,d=s.keyframes,f=s.autoRevert,p=t._dur,m=t._startAt,g=t._targets,b=t.parent,_=b&&b.data==="nested"?b.vars.targets:g,x=t._overwrite==="auto"&&!Au,v=t.timeline,T,C,E,I,R,N,F,P,A,G,D,X,B;if(v&&(!d||!n)&&(n="none"),t._ease=ys(n,un.ease),t._yEase=u?fy(ys(u===!0?n:u,un.ease)):0,u&&t._yoyo&&!t._repeat&&(u=t._yEase,t._yEase=t._ease,t._ease=u),t._from=!v&&!!s.runBackwards,!v||d&&!s.stagger){if(P=g[0]?ps(g[0]).harness:0,X=P&&s[P.prop],T=Eh(s,Du),m&&(m._zTime<0&&m.progress(1),e<0&&c&&a&&!f?m.render(-1,!0):m.revert(c&&p?Th:FC),m._lazy=0),o){if(Gr(t._startAt=$t.set(g,ze({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!m&&Se(h),startAt:null,delay:0,onUpdate:l&&function(){return Oe(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(fe||!a&&!f)&&t._startAt.revert(Th),a&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(a=!1),E=ze({overwrite:!1,data:"isFromStart",lazy:a&&!m&&Se(h),immediateRender:a,stagger:0,parent:b},T),X&&(E[P.prop]=X),Gr(t._startAt=$t.set(g,E)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(fe?t._startAt.revert(Th):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,Pt,Pt);else if(!e)return}for(t._pt=t._ptCache=0,h=p&&Se(h)||h&&!p,C=0;C<g.length;C++){if(R=g[C],F=R._gsap||Xu(g)[C]._gsap,t._ptLookup[C]=G={},Ou[F.id]&&Lr.length&&Ch(),D=_===g?C:_.indexOf(R),P&&(A=new P).init(R,X||T,t,D,_)!==!1&&(t._pt=I=new Ee(t._pt,R,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(H){G[H]=I}),A.priority&&(N=1)),!P||X)for(E in T)De[E]&&(A=yy(E,T,t,D,R,_))?A.priority&&(N=1):G[E]=I=Ju.call(t,R,E,"get",T[E],D,_,0,s.stringFilter);t._op&&t._op[C]&&t.kill(R,t._op[C]),x&&t._pt&&(kr=t,Xt.killTweensOf(R,G,t.globalTime(e)),B=!t.parent,kr=0),t._pt&&h&&(Ou[F.id]=1)}N&&Ty(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!B,d&&e<=0&&v.render(Ye,!0,!0)},aE=function(t,e,i,s,n,o,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,u,d,f;if(!l)for(l=t._ptCache[e]=[],d=t._ptLookup,f=t._targets.length;f--;){if(c=d[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return $u=1,t.vars[e]="+=0",Qu(t,a),$u=0,h?mo(e+" not eligible for reset"):1;l.push(c)}for(f=l.length;f--;)u=l[f],c=u._pt||u,c.s=(s||s===0)&&!n?s:c.s+(s||0)+o*c.c,c.c=i-c.s,u.e&&(u.e=Yt(i)+me(u.e)),u.b&&(u.b=c.s+me(u.b))},hE=function(t,e){var i=t[0]?ps(t[0]).harness:0,s=i&&i.aliases,n,o,a,h;if(!s)return e;n=ms({},e);for(o in s)if(o in n)for(h=s[o].split(","),a=h.length;a--;)n[h[a]]=n[o];return n},lE=function(t,e,i,s){var n=e.ease||s||"power1.inOut",o,a;if(pe(e))a=i[t]||(i[t]=[]),e.forEach(function(h,l){return a.push({t:l/(e.length-1)*100,v:h,e:n})});else for(o in e)a=i[o]||(i[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:n})},Co=function(t,e,i,s,n){return Vt(t)?t.call(e,i,s,n):ae(t)&&~t.indexOf("random(")?_o(t):t},by=Uu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",xy={};Ce(by+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return xy[r]=1});var $t=function(r){Pg(t,r);function t(i,s,n,o){var a;typeof s=="number"&&(n.duration=s,s=n,n=null),a=r.call(this,o?s:yo(s))||this;var h=a.vars,l=h.duration,c=h.delay,u=h.immediateRender,d=h.stagger,f=h.overwrite,p=h.keyframes,m=h.defaults,g=h.scrollTrigger,b=h.yoyoEase,_=s.parent||Xt,x=(pe(i)||Gg(i)?rr(i[0]):"length"in s)?[i]:Je(i),v,T,C,E,I,R,N,F;if(a._targets=x.length?Xu(x):mo("GSAP target "+i+" not found. https://gsap.com",!Ne.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=f,p||d||vh(l)||vh(c)){if(s=a.vars,v=a.timeline=new ve({data:"nested",defaults:m||{},targets:_&&_.data==="nested"?_.vars.targets:x}),v.kill(),v.parent=v._dp=ir(a),v._start=0,d||vh(l)||vh(c)){if(E=x.length,N=d&&ey(d),Li(d))for(I in d)~by.indexOf(I)&&(F||(F={}),F[I]=d[I]);for(T=0;T<E;T++)C=Eh(s,xy),C.stagger=0,b&&(C.yoyoEase=b),F&&ms(C,F),R=x[T],C.duration=+Co(l,ir(a),T,R,x),C.delay=(+Co(c,ir(a),T,R,x)||0)-a._delay,!d&&E===1&&C.delay&&(a._delay=c=C.delay,a._start+=c,C.delay=0),v.to(R,C,N?N(T,R,x):0),v._ease=St.none;v.duration()?l=c=0:a.timeline=0}else if(p){yo(ze(v.vars.defaults,{ease:"none"})),v._ease=ys(p.ease||s.ease||"none");var P=0,A,G,D;if(pe(p))p.forEach(function(X){return v.to(x,X,">")}),v.duration();else{C={};for(I in p)I==="ease"||I==="easeEach"||lE(I,p[I],C,p.easeEach);for(I in C)for(A=C[I].sort(function(X,B){return X.t-B.t}),P=0,T=0;T<A.length;T++)G=A[T],D={ease:G.e,duration:(G.t-(T?A[T-1].t:0))/100*l},D[I]=G.v,v.to(x,D,P),P+=D.duration;v.duration()<l&&v.to({},{duration:l-v.duration()})}}l||a.duration(l=v.duration())}else a.timeline=0;return f===!0&&!Au&&(kr=ir(a),Xt.killTweensOf(x),kr=0),Fi(_,ir(a),n),s.reversed&&a.reverse(),s.paused&&a.paused(!0),(u||!l&&!p&&a._start===he(_._time)&&Se(u)&&UC(ir(a))&&_.data!=="nested")&&(a._tTime=-Pt,a.render(Math.max(0,-c)||0)),g&&Jg(ir(a),g),a}var e=t.prototype;return e.render=function(s,n,o){var a=this._time,h=this._tDur,l=this._dur,c=s<0,u=s>h-Pt&&!c?h:s<Pt?0:s,d,f,p,m,g,b,_,x,v;if(!l)WC(this,s,n,o);else if(u!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c){if(d=u,x=this.timeline,this._repeat){if(m=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+s,n,o);if(d=he(u%m),u===h?(p=this._repeat,d=l):(p=~~(u/m),p&&p===he(u/m)&&(d=l,p--),d>l&&(d=l)),b=this._yoyo&&p&1,b&&(v=this._yEase,d=l-d),g=pn(this._tTime,m),d===a&&!o&&this._initted&&p===g)return this._tTime=u,this;p!==g&&(x&&this._yEase&&py(x,b),this.vars.repeatRefresh&&!b&&!this._lock&&this._time!==m&&this._initted&&(this._lock=o=1,this.render(he(m*p),!0).invalidate()._lock=0))}if(!this._initted){if($g(this,c?s:d,o,n,u))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&p!==g))return this;if(l!==this._dur)return this.render(s,n,o)}if(this._tTime=u,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(v||this._ease)(d/l),this._from&&(this.ratio=_=1-_),d&&!a&&!n&&!p&&(Oe(this,"onStart"),this._tTime!==u))return this;for(f=this._pt;f;)f.r(_,f.d),f=f._next;x&&x.render(s<0?s:x._dur*x._ease(d/this._dur),n,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!n&&(c&&Wu(this,s,n,o),Oe(this,"onUpdate")),this._repeat&&p!==g&&this.vars.onRepeat&&!n&&this.parent&&Oe(this,"onRepeat"),(u===this._tDur||!u)&&this._tTime===u&&(c&&!this._onUpdate&&Wu(this,s,!0,!0),(s||!l)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&Gr(this,1),!n&&!(c&&!a)&&(u||a||b)&&(Oe(this,u===h?"onComplete":"onReverseComplete",!0),this._prom&&!(u<h&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),r.prototype.invalidate.call(this,s)},e.resetTo=function(s,n,o,a,h){To||Be.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||Qu(this,l),c=this._ease(l/this._dur),aE(this,s,n,o,a,c,l,h)?this.resetTo(s,n,o,a,1):(Rh(this,0),this.parent||Yg(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(s,n){if(n===void 0&&(n="all"),!s&&(!n||n==="all"))return this._lazy=this._pt=0,this.parent?vo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,n,kr&&kr.vars.overwrite!==!0)._first||vo(this),this.parent&&o!==this.timeline.totalDuration()&&mn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=s?Je(s):a,l=this._ptLookup,c=this._pt,u,d,f,p,m,g,b;if((!n||n==="all")&&OC(a,h))return n==="all"&&(this._pt=0),vo(this);for(u=this._op=this._op||[],n!=="all"&&(ae(n)&&(m={},Ce(n,function(_){return m[_]=1}),n=m),n=hE(a,n)),b=a.length;b--;)if(~h.indexOf(a[b])){d=l[b],n==="all"?(u[b]=n,p=d,f={}):(f=u[b]=u[b]||{},p=n);for(m in p)g=d&&d[m],g&&((!("kill"in g.d)||g.d.kill(m)===!0)&&Ih(this,g,"_pt"),delete d[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&vo(this),this},t.to=function(s,n){return new t(s,n,arguments[2])},t.from=function(s,n){return bo(1,arguments)},t.delayedCall=function(s,n,o,a){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:n,onReverseComplete:n,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(s,n,o){return bo(2,arguments)},t.set=function(s,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(s,n)},t.killTweensOf=function(s,n,o){return Xt.killTweensOf(s,n,o)},t}(So);ze($t.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Ce("staggerTo,staggerFrom,staggerFromTo",function(r){$t[r]=function(){var t=new ve,e=Vu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var qu=function(t,e,i){return t[e]=i},_y=function(t,e,i){return t[e](i)},cE=function(t,e,i,s){return t[e](s.fp,i)},uE=function(t,e,i){return t.setAttribute(e,i)},td=function(t,e){return Vt(t[e])?_y:Ru(t[e])&&t.setAttribute?uE:qu},vy=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},dE=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},wy=function(t,e){var i=e._pt,s="";if(!t&&e.b)s=e.b;else if(t===1&&e.e)s=e.e;else{for(;i;)s=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+s,i=i._next;s+=e.c}e.set(e.t,e.p,s,e)},ed=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},fE=function(t,e,i,s){for(var n=this._pt,o;n;)o=n._next,n.p===s&&n.modifier(t,e,i),n=o},pE=function(t){for(var e=this._pt,i,s;e;)s=e._next,e.p===t&&!e.op||e.op===t?Ih(this,e,"_pt"):e.dep||(i=1),e=s;return!i},mE=function(t,e,i,s){s.mSet(t,e,s.m.call(s.tween,i,s.mt),s)},Ty=function(t){for(var e=t._pt,i,s,n,o;e;){for(i=e._next,s=n;s&&s.pr>e.pr;)s=s._next;(e._prev=s?s._prev:o)?e._prev._next=e:n=e,(e._next=s)?s._prev=e:o=e,e=i}t._pt=n},Ee=function(){function r(e,i,s,n,o,a,h,l,c){this.t=i,this.s=n,this.c=o,this.p=s,this.r=a||vy,this.d=h||this,this.set=l||qu,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(i,s,n){this.mSet=this.mSet||this.set,this.set=mE,this.m=i,this.mt=n,this.tween=s},r}();Ce(Uu+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return Du[r]=1}),ke.TweenMax=ke.TweenLite=$t,ke.TimelineLite=ke.TimelineMax=ve,Xt=new ve({sortChildren:!1,defaults:un,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Ne.stringFilter=dy;var xs=[],Ph={},gE=[],Sy=0,yE=0,id=function(t){return(Ph[t]||gE).map(function(e){return e()})},rd=function(){var t=Date.now(),e=[];t-Sy>2&&(id("matchMediaInit"),xs.forEach(function(i){var s=i.queries,n=i.conditions,o,a,h,l;for(a in s)o=Gi.matchMedia(s[a]).matches,o&&(h=1),o!==n[a]&&(n[a]=o,l=1);l&&(i.revert(),h&&e.push(i))}),id("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(s){return i.add(null,s)})}),Sy=t,id("matchMedia"))},Cy=function(){function r(e,i){this.selector=i&&Hu(i),this.data=[],this._r=[],this.isReverted=!1,this.id=yE++,e&&this.add(e)}var t=r.prototype;return t.add=function(i,s,n){Vt(i)&&(n=s,s=i,i=Vt);var o=this,a=function(){var l=Dt,c=o.selector,u;return l&&l!==o&&l.data.push(o),n&&(o.selector=Hu(n)),Dt=o,u=s.apply(o,arguments),Vt(u)&&o._r.push(u),Dt=l,o.selector=c,o.isReverted=!1,u};return o.last=a,i===Vt?a(o,function(h){return o.add(null,h)}):i?o[i]=a:a},t.ignore=function(i){var s=Dt;Dt=null,i(this),Dt=s},t.getTweens=function(){var i=[];return this.data.forEach(function(s){return s instanceof r?i.push.apply(i,s.getTweens()):s instanceof $t&&!(s.parent&&s.parent.data==="nested")&&i.push(s)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,s){var n=this;if(i?function(){for(var a=n.getTweens(),h=n.data.length,l;h--;)l=n.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,u){return u.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),h=n.data.length;h--;)l=n.data[h],l instanceof ve?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof $t)&&l.revert&&l.revert(i);n._r.forEach(function(c){return c(i,n)}),n.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),s)for(var o=xs.length;o--;)xs[o].id===this.id&&xs.splice(o,1)},t.revert=function(i){this.kill(i||{})},r}(),bE=function(){function r(e){this.contexts=[],this.scope=e,Dt&&Dt.data.push(this)}var t=r.prototype;return t.add=function(i,s,n){Li(i)||(i={matches:i});var o=new Cy(0,n||this.scope),a=o.conditions={},h,l,c;Dt&&!o.selector&&(o.selector=Dt.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=i;for(l in i)l==="all"?c=1:(h=Gi.matchMedia(i[l]),h&&(xs.indexOf(o)<0&&xs.push(o),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(rd):h.addEventListener("change",rd)));return c&&s(o,function(u){return o.add(null,u)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(s){return s.kill(i,!0)})},r}(),Lh={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(s){return hy(s)})},timeline:function(t){return new ve(t)},getTweensOf:function(t,e){return Xt.getTweensOf(t,e)},getProperty:function(t,e,i,s){ae(t)&&(t=Je(t)[0]);var n=ps(t||{}).get,o=i?Hg:Vg;return i==="native"&&(i=""),t&&(e?o((De[e]&&De[e].get||n)(t,e,i,s)):function(a,h,l){return o((De[a]&&De[a].get||n)(t,a,h,l))})},quickSetter:function(t,e,i){if(t=Je(t),t.length>1){var s=t.map(function(c){return Ie.quickSetter(c,e,i)}),n=s.length;return function(c){for(var u=n;u--;)s[u](c)}}t=t[0]||{};var o=De[e],a=ps(t),h=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(c){var u=new o;gn._pt=0,u.init(t,i?c+i:c,gn,0,[t]),u.render(1,u),gn._pt&&ed(1,gn)}:a.set(t,h);return o?l:function(c){return l(t,h,i?c+i:c,a,1)}},quickTo:function(t,e,i){var s,n=Ie.to(t,ms((s={},s[e]="+=0.1",s.paused=!0,s),i||{})),o=function(h,l,c){return n.resetTo(e,h,l,c)};return o.tween=n,o},isTweening:function(t){return Xt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=ys(t.ease,un.ease)),Kg(un,t||{})},config:function(t){return Kg(Ne,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,s=t.plugins,n=t.defaults,o=t.extendTimeline;(s||"").split(",").forEach(function(a){return a&&!De[a]&&!ke[a]&&mo(e+" effect requires "+a+" plugin.")}),Bu[e]=function(a,h,l){return i(Je(a),ze(h||{},n),l)},o&&(ve.prototype[e]=function(a,h,l){return this.add(Bu[e](a,Li(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,e){St[t]=ys(e)},parseEase:function(t,e){return arguments.length?ys(t,e):St},getById:function(t){return Xt.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new ve(t),s,n;for(i.smoothChildTiming=Se(t.smoothChildTiming),Xt.remove(i),i._dp=0,i._time=i._tTime=Xt._time,s=Xt._first;s;)n=s._next,(e||!(!s._dur&&s instanceof $t&&s.vars.onComplete===s._targets[0]))&&Fi(i,s,s._start-s._delay),s=n;return Fi(Xt,i,0),i},context:function(t,e){return t?new Cy(t,e):Dt},matchMedia:function(t){return new bE(t)},matchMediaRefresh:function(){return xs.forEach(function(t){var e=t.conditions,i,s;for(s in e)e[s]&&(e[s]=!1,i=1);i&&t.revert()})||rd()},addEventListener:function(t,e){var i=Ph[t]||(Ph[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=Ph[t],s=i&&i.indexOf(e);s>=0&&i.splice(s,1)},utils:{wrap:JC,wrapYoyo:$C,distribute:ey,random:ry,snap:iy,normalize:jC,getUnit:me,clamp:HC,splitColor:ly,toArray:Je,selector:Hu,mapRange:ny,pipe:YC,unitize:zC,interpolate:QC,shuffle:ty},install:Og,effects:Bu,ticker:Be,updateRoot:ve.updateRoot,plugins:De,globalTimeline:Xt,core:{PropTween:Ee,globals:Bg,Tween:$t,Timeline:ve,Animation:So,getCache:ps,_removeLinkedListItem:Ih,reverting:function(){return fe},context:function(t){return t&&Dt&&(Dt.data.push(t),t._ctx=Dt),Dt},suppressOverwrites:function(t){return Au=t}}};Ce("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return Lh[r]=$t[r]}),Be.add(ve.updateRoot),gn=Lh.to({},{duration:0});var xE=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},_E=function(t,e){var i=t._targets,s,n,o;for(s in e)for(n=i.length;n--;)o=t._ptLookup[n][s],o&&(o=o.d)&&(o._pt&&(o=xE(o,s)),o&&o.modifier&&o.modifier(e[s],t,i[n],s))},sd=function(t,e){return{name:t,rawVars:1,init:function(s,n,o){o._onInit=function(a){var h,l;if(ae(n)&&(h={},Ce(n,function(c){return h[c]=1}),n=h),e){h={};for(l in n)h[l]=e(n[l]);n=h}_E(a,n)}}}},Ie=Lh.registerPlugin({name:"attr",init:function(t,e,i,s,n){var o,a,h;this.tween=i;for(o in e)h=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(h||0)+"",e[o],s,n,0,0,o),a.op=o,a.b=h,this._props.push(o)},render:function(t,e){for(var i=e._pt;i;)fe?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},sd("roundProps",Ku),sd("modifiers"),sd("snap",iy))||Lh;$t.version=ve.version=Ie.version="3.12.5",Dg=1,Pu()&&yn(),St.Power0,St.Power1,St.Power2,St.Power3,St.Power4,St.Linear,St.Quad,St.Cubic,St.Quart,St.Quint,St.Strong,St.Elastic,St.Back,St.SteppedEase,St.Bounce,St.Sine,St.Expo,St.Circ;/*!
1168
1168
  * CSSPlugin 3.12.5
1169
1169
  * https://gsap.com
1170
1170
  *
@@ -1172,6 +1172,6 @@ void main(void)\r
1172
1172
  * Subject to the terms at https://gsap.com/standard-license or for
1173
1173
  * Club GSAP members, the agreement issued with that membership.
1174
1174
  * @author: Jack Doyle, jack@greensock.com
1175
- */var Ey,Dr,bn,nd,_s,Iy,od,vE=function(){return typeof window<"u"},sr={},vs=180/Math.PI,xn=Math.PI/180,_n=Math.atan2,Ay=1e8,ad=/([A-Z])/g,wE=/(left|right|width|margin|padding|x)/i,TE=/[\s,\(]\S/,Ni={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},hd=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},SE=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},CE=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},EE=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},My=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Ry=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},IE=function(t,e,i){return t.style[e]=i},AE=function(t,e,i){return t.style.setProperty(e,i)},ME=function(t,e,i){return t._gsap[e]=i},RE=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},PE=function(t,e,i,s,n){var o=t._gsap;o.scaleX=o.scaleY=i,o.renderTransform(n,o)},LE=function(t,e,i,s,n){var o=t._gsap;o[e]=i,o.renderTransform(n,o)},Wt="transform",Ie=Wt+"Origin",GE=function r(t,e){var i=this,s=this.target,n=s.style,o=s._gsap;if(t in sr&&n){if(this.tfm=this.tfm||{},t!=="transform")t=Ni[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return i.tfm[a]=nr(s,a)}):this.tfm[t]=o.x?o[t]:nr(s,t),t===Ie&&(this.tfm.zOrigin=o.zOrigin);else return Ni.transform.split(",").forEach(function(a){return r.call(i,a,e)});if(this.props.indexOf(Wt)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Ie,e,"")),t=Wt}(n||e)&&this.props.push(t,e,n[t])},Py=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},FE=function(){var t=this.props,e=this.target,i=e.style,s=e._gsap,n,o;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(ad,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=od(),(!n||!n.isStart)&&!i[Wt]&&(Py(i),s.zOrigin&&i[Ie]&&(i[Ie]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},Ly=function(t,e){var i={target:t,props:[],revert:FE,save:GE};return t._gsap||Ee.core.getCache(t),e&&e.split(",").forEach(function(s){return i.save(s)}),i},Gy,ld=function(t,e){var i=Dr.createElementNS?Dr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Dr.createElement(t);return i&&i.style?i:Dr.createElement(t)},ki=function r(t,e,i){var s=getComputedStyle(t);return s[e]||s.getPropertyValue(e.replace(ad,"-$1").toLowerCase())||s.getPropertyValue(e)||!i&&r(t,vn(e)||e,1)||""},Fy="O,Moz,ms,Ms,Webkit".split(","),vn=function(t,e,i){var s=e||_s,n=s.style,o=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Fy[o]+t in n););return o<0?null:(o===3?"ms":o>=0?Fy[o]:"")+t},cd=function(){vE()&&window.document&&(Ey=window,Dr=Ey.document,bn=Dr.documentElement,_s=ld("div")||{style:{}},ld("div"),Wt=vn(Wt),Ie=Wt+"Origin",_s.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Gy=!!vn("perspective"),od=Ee.core.reverting,nd=1)},ud=function r(t){var e=ld("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,s=this.nextSibling,n=this.style.cssText,o;if(bn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(s?i.insertBefore(this,s):i.appendChild(this)),bn.removeChild(e),this.style.cssText=n,o},Ny=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},ky=function(t){var e;try{e=t.getBBox()}catch{e=ud.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===ud||(e=ud.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Ny(t,["x","cx","x1"])||0,y:+Ny(t,["y","cy","y1"])||0,width:0,height:0}:e},Dy=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ky(t))},ws=function(t,e){if(e){var i=t.style,s;e in sr&&e!==Ie&&(e=Wt),i.removeProperty?(s=e.substr(0,2),(s==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(s==="--"?e:e.replace(ad,"-$1").toLowerCase())):i.removeAttribute(e)}},Or=function(t,e,i,s,n,o){var a=new Ce(t._pt,e,i,0,1,o?Ry:My);return t._pt=a,a.b=s,a.e=n,t._props.push(i),a},Oy={deg:1,rad:1,turn:1},NE={grid:1,flex:1},Br=function r(t,e,i,s){var n=parseFloat(i)||0,o=(i+"").trim().substr((n+"").length)||"px",a=_s.style,h=wE.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),u=100,d=s==="px",f=s==="%",p,m,g,b;if(s===o||!n||Oy[s]||Oy[o])return n;if(o!=="px"&&!d&&(n=r(t,e,i,"px")),b=t.getCTM&&Dy(t),(f||o==="%")&&(sr[e]||~e.indexOf("adius")))return p=b?t.getBBox()[h?"width":"height"]:t[c],Yt(f?n/p*u:n/100*p);if(a[h?"width":"height"]=u+(d?o:s),m=~e.indexOf("adius")||s==="em"&&t.appendChild&&!l?t:t.parentNode,b&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===Dr||!m.appendChild)&&(m=Dr.body),g=m._gsap,g&&f&&g.width&&h&&g.time===Be.time&&!g.uncache)return Yt(n/g.width*u);if(f&&(e==="height"||e==="width")){var _=t.style[e];t.style[e]=u+s,p=t[c],_?t.style[e]=_:ws(t,e)}else(f||o==="%")&&!NE[ki(m,"display")]&&(a.position=ki(t,"position")),m===t&&(a.position="static"),m.appendChild(_s),p=_s[c],m.removeChild(_s),a.position="absolute";return h&&f&&(g=ps(m),g.time=Be.time,g.width=m[c]),Yt(d?p*n/u:p&&n?u/p*n:0)},nr=function(t,e,i,s){var n;return nd||cd(),e in Ni&&e!=="transform"&&(e=Ni[e],~e.indexOf(",")&&(e=e.split(",")[0])),sr[e]&&e!=="transform"?(n=Io(t,s),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:Fh(ki(t,Ie))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||s||~(n+"").indexOf("calc("))&&(n=Gh[e]&&Gh[e](t,e,i)||ki(t,e)||Wg(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?Br(t,e,n,i)+i:n},kE=function(t,e,i,s){if(!i||i==="none"){var n=vn(e,t,1),o=n&&ki(t,n,1);o&&o!==i?(e=n,i=o):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var a=new Ce(this._pt,t.style,e,0,1,wy),h=0,l=0,c,u,d,f,p,m,g,b,_,x,v,T;if(a.b=i,a.e=s,i+="",s+="",s==="auto"&&(m=t.style[e],t.style[e]=s,s=ki(t,e)||s,m?t.style[e]=m:ws(t,e)),c=[i,s],dy(c),i=c[0],s=c[1],d=i.match(dn)||[],T=s.match(dn)||[],T.length){for(;u=dn.exec(s);)g=u[0],_=s.substring(h,u.index),p?p=(p+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(p=1),g!==(m=d[l++]||"")&&(f=parseFloat(m)||0,v=m.substr((f+"").length),g.charAt(1)==="="&&(g=fn(f,g)+v),b=parseFloat(g),x=g.substr((b+"").length),h=dn.lastIndex-x.length,x||(x=x||Ne.units[e]||v,h===s.length&&(s+=x,a.e+=x)),v!==x&&(f=Br(t,e,m,x)||0),a._pt={_next:a._pt,p:_||l===1?_:",",s:f,c:b-f,m:p&&p<4||e==="zIndex"?Math.round:0});a.c=h<s.length?s.substring(h,s.length):""}else a.r=e==="display"&&s==="none"?Ry:My;return Ng.test(s)&&(a.e=0),this._pt=a,a},By={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},DE=function(t){var e=t.split(" "),i=e[0],s=e[1]||"50%";return(i==="top"||i==="bottom"||s==="left"||s==="right")&&(t=i,i=s,s=t),e[0]=By[i]||i,e[1]=By[s]||s,e.join(" ")},OE=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,s=i.style,n=e.u,o=i._gsap,a,h,l;if(n==="all"||n===!0)s.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)a=n[l],sr[a]&&(h=1,a=a==="transformOrigin"?Ie:Wt),ws(i,a);h&&(ws(i,Wt),o&&(o.svg&&i.removeAttribute("transform"),Io(i,1),o.uncache=1,Py(s)))}},Gh={clearProps:function(t,e,i,s,n){if(n.data!=="isFromStart"){var o=t._pt=new Ce(t._pt,e,i,0,0,OE);return o.u=s,o.pr=-10,o.tween=n,t._props.push(i),1}}},Eo=[1,0,0,1,0,0],Uy={},Xy=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Wy=function(t){var e=ki(t,Wt);return Xy(e)?Eo:e.substr(7).match(Fg).map(Yt)},dd=function(t,e){var i=t._gsap||ps(t),s=t.style,n=Wy(t),o,a,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?Eo:n):(n===Eo&&!t.offsetParent&&t!==bn&&!i.svg&&(h=s.display,s.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,bn.appendChild(t)),n=Wy(t),h?s.display=h:ws(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):bn.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},fd=function(t,e,i,s,n,o){var a=t._gsap,h=n||dd(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,u=a.xOffset||0,d=a.yOffset||0,f=h[0],p=h[1],m=h[2],g=h[3],b=h[4],_=h[5],x=e.split(" "),v=parseFloat(x[0])||0,T=parseFloat(x[1])||0,C,E,I,R;i?h!==Eo&&(E=f*g-p*m)&&(I=v*(g/E)+T*(-m/E)+(m*_-g*b)/E,R=v*(-p/E)+T*(f/E)-(f*_-p*b)/E,v=I,T=R):(C=ky(t),v=C.x+(~x[0].indexOf("%")?v/100*C.width:v),T=C.y+(~(x[1]||x[0]).indexOf("%")?T/100*C.height:T)),s||s!==!1&&a.smooth?(b=v-l,_=T-c,a.xOffset=u+(b*f+_*m)-b,a.yOffset=d+(b*p+_*g)-_):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=T,a.smooth=!!s,a.origin=e,a.originIsAbsolute=!!i,t.style[Ie]="0px 0px",o&&(Or(o,a,"xOrigin",l,v),Or(o,a,"yOrigin",c,T),Or(o,a,"xOffset",u,a.xOffset),Or(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+T)},Io=function(t,e){var i=t._gsap||new gy(t);if("x"in i&&!e&&!i.uncache)return i;var s=t.style,n=i.scaleX<0,o="px",a="deg",h=getComputedStyle(t),l=ki(t,Ie)||"0",c,u,d,f,p,m,g,b,_,x,v,T,C,E,I,R,N,F,P,A,G,D,X,B,H,lt,W,L,O,U,tt,Q;return c=u=d=m=g=b=_=x=v=0,f=p=1,i.svg=!!(t.getCTM&&Dy(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(s[Wt]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Wt]!=="none"?h[Wt]:"")),s.scale=s.rotate=s.translate="none"),E=dd(t,i.svg),i.svg&&(i.uncache?(H=t.getBBox(),l=i.xOrigin-H.x+"px "+(i.yOrigin-H.y)+"px",B=""):B=!e&&t.getAttribute("data-svg-origin"),fd(t,B||l,!!B||i.originIsAbsolute,i.smooth!==!1,E)),T=i.xOrigin||0,C=i.yOrigin||0,E!==Eo&&(F=E[0],P=E[1],A=E[2],G=E[3],c=D=E[4],u=X=E[5],E.length===6?(f=Math.sqrt(F*F+P*P),p=Math.sqrt(G*G+A*A),m=F||P?_n(P,F)*vs:0,_=A||G?_n(A,G)*vs+m:0,_&&(p*=Math.abs(Math.cos(_*xn))),i.svg&&(c-=T-(T*F+C*A),u-=C-(T*P+C*G))):(Q=E[6],U=E[7],W=E[8],L=E[9],O=E[10],tt=E[11],c=E[12],u=E[13],d=E[14],I=_n(Q,O),g=I*vs,I&&(R=Math.cos(-I),N=Math.sin(-I),B=D*R+W*N,H=X*R+L*N,lt=Q*R+O*N,W=D*-N+W*R,L=X*-N+L*R,O=Q*-N+O*R,tt=U*-N+tt*R,D=B,X=H,Q=lt),I=_n(-A,O),b=I*vs,I&&(R=Math.cos(-I),N=Math.sin(-I),B=F*R-W*N,H=P*R-L*N,lt=A*R-O*N,tt=G*N+tt*R,F=B,P=H,A=lt),I=_n(P,F),m=I*vs,I&&(R=Math.cos(I),N=Math.sin(I),B=F*R+P*N,H=D*R+X*N,P=P*R-F*N,X=X*R-D*N,F=B,D=H),g&&Math.abs(g)+Math.abs(m)>359.9&&(g=m=0,b=180-b),f=Yt(Math.sqrt(F*F+P*P+A*A)),p=Yt(Math.sqrt(X*X+Q*Q)),I=_n(D,X),_=Math.abs(I)>2e-4?I*vs:0,v=tt?1/(tt<0?-tt:tt):0),i.svg&&(B=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Xy(ki(t,Wt)),B&&t.setAttribute("transform",B))),Math.abs(_)>90&&Math.abs(_)<270&&(n?(f*=-1,_+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,_+=_<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+o,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+o,i.z=d+o,i.scaleX=Yt(f),i.scaleY=Yt(p),i.rotation=Yt(m)+a,i.rotationX=Yt(g)+a,i.rotationY=Yt(b)+a,i.skewX=_+a,i.skewY=x+a,i.transformPerspective=v+o,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(s[Ie]=Fh(l)),i.xOffset=i.yOffset=0,i.force3D=Ne.force3D,i.renderTransform=i.svg?UE:Gy?Zy:BE,i.uncache=0,i},Fh=function(t){return(t=t.split(" "))[0]+" "+t[1]},pd=function(t,e,i){var s=me(e);return Yt(parseFloat(e)+parseFloat(Br(t,"x",i+"px",s)))+s},BE=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Zy(t,e)},Ts="0deg",Ao="0px",Ss=") ",Zy=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.z,l=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,g=i.transformPerspective,b=i.force3D,_=i.target,x=i.zOrigin,v="",T=b==="auto"&&t&&t!==1||b===!0;if(x&&(u!==Ts||c!==Ts)){var C=parseFloat(c)*xn,E=Math.sin(C),I=Math.cos(C),R;C=parseFloat(u)*xn,R=Math.cos(C),o=pd(_,o,E*R*-x),a=pd(_,a,-Math.sin(C)*-x),h=pd(_,h,I*R*-x+x)}g!==Ao&&(v+="perspective("+g+Ss),(s||n)&&(v+="translate("+s+"%, "+n+"%) "),(T||o!==Ao||a!==Ao||h!==Ao)&&(v+=h!==Ao||T?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Ss),l!==Ts&&(v+="rotate("+l+Ss),c!==Ts&&(v+="rotateY("+c+Ss),u!==Ts&&(v+="rotateX("+u+Ss),(d!==Ts||f!==Ts)&&(v+="skew("+d+", "+f+Ss),(p!==1||m!==1)&&(v+="scale("+p+", "+m+Ss),_.style[Wt]=v||"translate(0, 0)"},UE=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.rotation,l=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,g=i.xOffset,b=i.yOffset,_=i.forceCSS,x=parseFloat(o),v=parseFloat(a),T,C,E,I,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=xn,l*=xn,T=Math.cos(h)*u,C=Math.sin(h)*u,E=Math.sin(h-l)*-d,I=Math.cos(h-l)*d,l&&(c*=xn,R=Math.tan(l-c),R=Math.sqrt(1+R*R),E*=R,I*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),T*=R,C*=R)),T=Yt(T),C=Yt(C),E=Yt(E),I=Yt(I)):(T=u,I=d,C=E=0),(x&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(x=Br(f,"x",o,"px"),v=Br(f,"y",a,"px")),(p||m||g||b)&&(x=Yt(x+p-(p*T+m*E)+g),v=Yt(v+m-(p*C+m*I)+b)),(s||n)&&(R=f.getBBox(),x=Yt(x+s/100*R.width),v=Yt(v+n/100*R.height)),R="matrix("+T+","+C+","+E+","+I+","+x+","+v+")",f.setAttribute("transform",R),_&&(f.style[Wt]=R)},XE=function(t,e,i,s,n){var o=360,a=ae(n),h=parseFloat(n)*(a&&~n.indexOf("rad")?vs:1),l=h-s,c=s+l+"deg",u,d;return a&&(u=n.split("_")[1],u==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),u==="cw"&&l<0?l=(l+o*Ay)%o-~~(l/o)*o:u==="ccw"&&l>0&&(l=(l-o*Ay)%o-~~(l/o)*o)),t._pt=d=new Ce(t._pt,e,i,s,l,SE),d.e=c,d.u="deg",t._props.push(i),d},Vy=function(t,e){for(var i in e)t[i]=e[i];return t},WE=function(t,e,i){var s=Vy({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,l,c,u,d,f,p;s.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),o[Wt]=e,a=Io(i,1),ws(i,Wt),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Wt],o[Wt]=e,a=Io(i,1),o[Wt]=l);for(h in sr)l=s[h],c=a[h],l!==c&&n.indexOf(h)<0&&(f=me(l),p=me(c),u=f!==p?Br(i,h,l,p):parseFloat(l),d=parseFloat(c),t._pt=new Ce(t._pt,a,h,u,d-u,hd),t._pt.u=p||0,t._props.push(h));Vy(a,s)};Se("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",s="Bottom",n="Left",o=(t<3?[e,i,s,n]:[e+n,e+i,s+i,s+n]).map(function(a){return t<2?r+a:"border"+a+r});Gh[t>1?"border"+r:r]=function(a,h,l,c,u){var d,f;if(arguments.length<4)return d=o.map(function(p){return nr(a,p,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},o.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),a.init(h,f,u)}});var Hy={name:"css",register:cd,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,s,n){var o=this._props,a=t.style,h=i.vars.startAt,l,c,u,d,f,p,m,g,b,_,x,v,T,C,E,I;nd||cd(),this.styles=this.styles||Ly(t),I=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(De[m]&&yy(m,e,i,s,t,n)))){if(f=typeof c,p=Gh[m],f==="function"&&(c=c.call(i,s,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=_o(c)),p)p(this,t,m,c,i)&&(E=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",Nr.lastIndex=0,Nr.test(l)||(g=me(l),b=me(c)),b?g!==b&&(l=Br(t,m,l,b)+b):g&&(c+=g),this.add(a,"setProperty",l,c,s,n,0,0,m),o.push(m),I.push(m,0,a[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,s,t,n):h[m],ae(l)&&~l.indexOf("random(")&&(l=_o(l)),me(l+"")||l==="auto"||(l+=Ne.units[m]||me(nr(t,m))||""),(l+"").charAt(1)==="="&&(l=nr(t,m))):l=nr(t,m),d=parseFloat(l),_=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),_&&(c=c.substr(2)),u=parseFloat(c),m in Ni&&(m==="autoAlpha"&&(d===1&&nr(t,"visibility")==="hidden"&&u&&(d=0),I.push("visibility",0,a.visibility),Or(this,a,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=Ni[m],~m.indexOf(",")&&(m=m.split(",")[0]))),x=m in sr,x){if(this.styles.save(m),v||(T=t._gsap,T.renderTransform&&!e.parseTransform||Io(t,e.parseTransform),C=e.smoothOrigin!==!1&&T.smooth,v=this._pt=new Ce(this._pt,a,Wt,0,1,T.renderTransform,T,0,-1),v.dep=1),m==="scale")this._pt=new Ce(this._pt,T,"scaleY",T.scaleY,(_?fn(T.scaleY,_+u):u)-T.scaleY||0,hd),this._pt.u=0,o.push("scaleY",m),m+="X";else if(m==="transformOrigin"){I.push(Ie,0,a[Ie]),c=DE(c),T.svg?fd(t,c,0,C,0,this):(b=parseFloat(c.split(" ")[2])||0,b!==T.zOrigin&&Or(this,T,"zOrigin",T.zOrigin,b),Or(this,a,m,Fh(l),Fh(c)));continue}else if(m==="svgOrigin"){fd(t,c,1,C,0,this);continue}else if(m in Uy){XE(this,T,m,d,_?fn(d,_+c):c);continue}else if(m==="smoothOrigin"){Or(this,T,"smooth",T.smooth,c);continue}else if(m==="force3D"){T[m]=c;continue}else if(m==="transform"){WE(this,c,t);continue}}else m in a||(m=vn(m)||m);if(x||(u||u===0)&&(d||d===0)&&!TE.test(c)&&m in a)g=(l+"").substr((d+"").length),u||(u=0),b=me(c)||(m in Ne.units?Ne.units[m]:g),g!==b&&(d=Br(t,m,l,b)),this._pt=new Ce(this._pt,x?T:a,m,d,(_?fn(d,_+u):u)-d,!x&&(b==="px"||m==="zIndex")&&e.autoRound!==!1?EE:hd),this._pt.u=b||0,g!==b&&b!=="%"&&(this._pt.b=l,this._pt.r=CE);else if(m in a)kE.call(this,t,m,l,_?_+c:c);else if(m in t)this.add(t,m,l||t[m],_?_+c:c,s,n);else if(m!=="parseTransform"){ku(m,c);continue}x||(m in a?I.push(m,0,a[m]):I.push(m,1,l||t[m])),o.push(m)}}E&&Ty(this)},render:function(t,e){if(e.tween._time||!od())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:nr,aliases:Ni,getSetter:function(t,e,i){var s=Ni[e];return s&&s.indexOf(",")<0&&(e=s),e in sr&&e!==Ie&&(t._gsap.x||nr(t,"x"))?i&&Iy===i?e==="scale"?RE:ME:(Iy=i||{})&&(e==="scale"?PE:LE):t.style&&!Ru(t.style[e])?IE:~e.indexOf("-")?AE:td(t,e)},core:{_removeProperty:ws,_getMatrix:dd}};Ee.utils.checkPrefix=vn,Ee.core.getStyleSaver=Ly,function(r,t,e,i){var s=Se(r+","+t+","+e,function(n){sr[n]=1});Se(t,function(n){Ne.units[n]="deg",Uy[n]=1}),Ni[s[13]]=r+","+t,Se(i,function(n){var o=n.split(":");Ni[o[1]]=s[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Se("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Ne.units[r]="px"}),Ee.registerPlugin(Hy);var Ky=Ee.registerPlugin(Hy)||Ee;Ky.core.Tween;function Yy(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&Mg in r?r[Mg](t):r instanceof Date?new r.constructor(t):new Date(t)}function md(r,t){return Yy(r,r)}function ZE(r,t,e){return Yy(r,+md(r)+t)}function VE(r,t,e){return ZE(r,t*1e3)}function HE(r){return t=>{const e=Math.trunc,i=e(t);return i===0?0:i}}function zy(r,t){return+md(r)-+md(t)}function KE(r,t,e){const i=zy(r,t)/1e3;return HE()(i)}function YE(r){let t=0;for(const[,{children:e}]of r)t+=e.length;return t}function zE({start_time:r,end_time:t,nodes:e},i,s){const n=Math.max(KE(t??new Date,r),1),o=i.styles.nodeHeight+i.styles.rowGap;return(e.size>0?e.size*o*.5:o*4)*s/(n*Cl)}async function jE(){const r=await Bi(),t=await Mt(),e=await Jt(),i=e.view.width/e.view.height,s=zE(r,t,i);yd(s,!0),r.nodes.size>t.disableAnimationsThreshold&&(st.disableAnimations=!0),YE(r.nodes)>t.disableEdgesThreshold&&(st.disableEdges=!0)}function JE(){st.horizontal="temporal",st.vertical="nearest-parent",st.horizontalScaleMultiplierDefault=0,st.horizontalScaleMultiplier=0,st.disableAnimations=!1,st.disableGuides=!1,st.disableEdges=!1,st.disableArtifacts=!1,st.disableEvents=!1}const st={horizontal:"temporal",vertical:"nearest-parent",horizontalScaleMultiplierDefault:0,horizontalScaleMultiplier:0,disableAnimations:!1,disableGuides:!1,disableEdges:!1,disableArtifacts:!1,disableEvents:!1,isTemporal(){return this.horizontal==="temporal"},isDependency(){return this.horizontal==="dependency"},isWaterfall(){return this.vertical==="waterfall"},isNearestParent(){return this.vertical==="nearest-parent"},isLeftAligned(){return this.horizontal==="left-aligned"}};async function Qt(){return bd()?st:await Ge("layoutSettingsCreated")}function gd(){return st.isDependency()?Qf:Cl*st.horizontalScaleMultiplier}function $E(){return[0,gd()]}function QE(r){if(st.isDependency())return[0,1];const t=r,e=VE(t,$f);return[t,e]}function yd(r,t=!1){if(st.horizontalScaleMultiplier===r)return;const e=wn();st.horizontalScaleMultiplier=r,t&&(st.horizontalScaleMultiplierDefault=r),e()}function qE(){yd(st.horizontalScaleMultiplierDefault)}function tI(r){if(st.horizontal===r)return;const t=wn();st.horizontal=r,st.disableGuides=st.isDependency()||st.isLeftAligned(),t()}function eI(r){if(st.vertical===r)return;const t=wn();st.vertical=r,t()}function iI(r){if(st.disableEdges===r)return;const t=wn();st.disableEdges=r,t()}function rI(r){if(st.disableArtifacts===r)return;const t=wn();st.disableArtifacts=r,t()}function sI(r){if(st.disableEvents===r)return;const t=wn();st.disableEvents=r,t()}function wn(){const r=bd()?"layoutSettingsUpdated":"layoutSettingsCreated",{horizontal:t,vertical:e}=st;return()=>{bd()&&$.emit(r,st),(t!==st.horizontal||e!==st.vertical)&&$.emit("layoutUpdated")}}function bd(){return st.horizontalScaleMultiplier!==0}async function jy(){const r=await Qt(),t=await Mt();function e(i,s,n){const a=r.disableAnimations||n?0:t.animationDuration/1e3;return Ky.to(i,{...s,duration:a,ease:"power1.out",onUpdate:()=>{Zo()}})}return{animate:e}}async function nI({size:r,stroke:t=1,radius:e=0}){const i=await Jt(),s=new Ir;return s.lineStyle(t,"#fff",1,0),s.drawRoundedRect(0,0,r*2,r*2,e),i.renderer.generateTexture(s,{region:new pt(0,0,r,r),resolution:10})}async function Mo(r){return await fo(nI,[r])}var Nh=(r=>(r[r.Up=0]="Up",r[r.Down=180]="Down",r[r.Left=270]="Left",r[r.Right=90]="Right",r))(Nh||{});function Jy(){const r=new jt;async function t(e){const{rotate:i=0}=e,s={size:e.size,radius:e.radius,stroke:e.stroke},n=await Mo(s);return r.texture=n,r.anchor.set(.5,.5),r.angle=45+i,r}return{element:r,render:t}}async function oI(){const r=await Jt(),t=new Ir;return t.beginFill("#fff"),t.drawRect(0,0,1,1),t.endFill(),r.renderer.generateTexture(t,{wrapMode:_i.REPEAT})}async function xd(){return await fo(oI,[])}function _d(r,t){return Array.from({length:r},(e,i)=>t(i))}const aI=8,hI=2;async function lI(){const r=await Mt(),t=await wb(),e=await HR(),{animate:i}=await jy(),s=new Tt,{element:n,render:o}=await Jy(),a=await xd(),h=_d(Al,()=>new ct),l=new nS(a,h);let c=!1;s.name=Jf,s.addChild(n),s.addChild(l),t.addAll([n,l]),e.add(s);async function u(){return await o({size:10,rotate:Nh.Right}),n.tint=r.styles.edgeColor,l.tint=r.styles.edgeColor,s}async function d(p,m){const g=f(m);c||await u();for(const[b,_]of h.entries()){const{x,y:v}=g[b];i(_,{x,y:v},!c)}i(s,{x:p.x,y:p.y},!c),i(n,{x:m.x-aI,y:m.y},!c),c=!0}function f({x:p,y:m}){const g=[],b={x:0,y:0},_={x:p-hI,y:m},x={x:$y(b.x,{source:b,target:_}),y:b.y},v={x:$y(_.x,{source:b,target:_},!0),y:_.y};for(const[T]of h.entries()){if(T===h.length-1){g[T]=_;continue}const C=cI(T,{source:b,target:_,sourceBezier:x,targetBezier:v});g[T]=C}return g}return{element:s,render:u,setPosition:d}}function $y(r,{source:t,target:e},i){const s=(e.x-t.x)/2;return r+(s>Ml?s:Ml)*(i?-1:1)}function cI(r,t){const e=r/Al,{source:i,target:s,sourceBezier:n,targetBezier:o}=t,a=i.x+(n.x-i.x)*e,h=i.y+(n.y-i.y)*e,l=n.x+(o.x-n.x)*e,c=n.y+(o.y-n.y)*e,u=o.x+(s.x-o.x)*e,d=o.y+(s.y-o.y)*e,f=a+(l-a)*e,p=h+(c-h)*e,m=l+(u-l)*e,g=c+(d-c)*e,b=f+(m-f)*e,_=p+(g-p)*e;return{x:b,y:_}}async function uI({height:r,radius:t}){const e=await Jt(),i=new Ir;return i.beginFill("#fff"),i.drawRoundedRect(0,0,t*2,r,t),i.endFill(),e.renderer.generateTexture(i,{region:new pt(0,0,t,r),resolution:El})}async function dI(r){return await fo(uI,[r])}function fI(){const r=new jt,t=new jt;async function e(i){const s=await dI(i);return r.texture=s,t.texture=s,t.anchor.x=1,t.scale.x=-1,{left:r,right:t}}return{left:r,right:t,render:e}}async function or(){const r=await xd();return new jt(r)}async function vd(){const r=new Tt,t=await or(),{left:e,right:i,render:s}=await fI();r.addChild(t),r.addChild(e),r.addChild(i);async function n(h){const{width:l,x:c,visible:u}=a(h);return await s({height:h.height,radius:h.radius}),t.visible=u,t.width=l,t.height=h.height,t.x=c,e.visible=o(h.capLeft,h.radius),i.visible=o(h.capRight,h.radius),i.x=h.radius+l,t.tint=h.background,e.tint=h.background,i.tint=h.background,r}function o(h,l){return l===0?!1:h??!0}function a(h){const l=o(h.capLeft,h.radius),c=o(h.capRight,h.radius);let u=0;l&&(u+=h.radius),c&&(u+=h.radius);const d=Math.max(h.width-u,0),f=d>0,p=l?h.radius:0;return{width:d,visible:f,x:p}}return{element:r,render:n}}function kh(){const r=new Tt,t=new jt,e=new jt,i=new jt,s=new jt,n=new jt,o=new jt,a=new jt,h=new jt;t.name="border-corner-top-left",e.name="border-corner-top-right",i.name="border-corner-bottom-left",s.name="border-corner-bottom-right",n.name="border-corner-left",o.name="border-corner-right",a.name="border-corner-top",h.name="border-corner-bottom",e.anchor.x=1,e.scale.x=-1,i.anchor.y=1,i.scale.y=-1,s.anchor.x=1,s.scale.x=-1,s.anchor.y=1,s.scale.y=-1,r.addChild(t),r.addChild(e),r.addChild(i),r.addChild(s),r.addChild(n),r.addChild(o),r.addChild(a),r.addChild(h);async function l(p){const{radius:m=0,color:g="#fff",stroke:b,width:_,height:x}=p,v=typeof m=="number",T={topLeft:c(v?m:m[0],_,x),topRight:c(v?m:m[1],_,x),bottomLeft:c(v?m:m[2],_,x),bottomRight:c(v?m:m[3],_,x)};return await u({width:_,height:x,stroke:b,cornerSizes:T}),await d({width:_,height:x,stroke:b,cornerSizes:T}),f(g),r}function c(p,m,g){const b=Math.min(m,g);return{size:p*2>b?b/2:p,radius:p}}async function u({width:p,height:m,stroke:g,cornerSizes:b}){const{topLeft:_,topRight:x,bottomLeft:v,bottomRight:T}=b,[C,E,I,R]=await Promise.all([Mo({..._,stroke:g}),Mo({...x,stroke:g}),Mo({...v,stroke:g}),Mo({...T,stroke:g})]);t.texture=C,e.texture=E,i.texture=R,s.texture=I,t.position.set(0,0),e.position.set(p-x.size,0),i.position.set(0,m-v.size),s.position.set(p-T.size,m-T.size)}async function d({width:p,height:m,stroke:g,cornerSizes:b}){const _=await xd(),{topLeft:x,topRight:v,bottomLeft:T,bottomRight:C}=b;a.texture=_,n.texture=_,o.texture=_,h.texture=_,n.position.set(0,x.size),n.height=Math.max(m-x.size-T.size,0),n.width=g,o.position.set(p-g,v.size),o.height=Math.max(m-v.size-C.size,0),o.width=g,a.position.set(x.size,0),a.width=Math.max(p-x.size-v.size,0),a.height=g,h.position.set(T.size,m-g),h.width=Math.max(p-T.size-C.size,0),h.height=g}function f(p){t.tint=p,e.tint=p,i.tint=p,s.tint=p,a.tint=p,n.tint=p,o.tint=p,h.tint=p}return{element:r,render:l}}async function Dh(){const r=await Mt(),t=new Tt,{element:e,render:i}=await kh();async function s({selected:n,width:o,height:a}){if(!n)return t.removeChild(e),t;const{selectedBorderColor:h,selectedBorderWidth:l,selectedBorderOffset:c,selectedBorderRadius:u}=r.styles;return e.position.set(-c,-c),t.addChild(e),await i({stroke:l,radius:u,width:o+c*2,height:a+c*2,color:h}),t}return{element:t,render:s}}async function pI(){const r=await Mt(),t=new Tt,{element:e,render:i}=await vd(),{element:s,render:n}=await Dh();t.addChild(e),t.addChild(s);async function o({selected:a,width:h,height:l}){const{artifactBgColor:c,artifactBorderRadius:u}=r.styles,d={width:h,height:l,background:c,radius:u,capLeft:!0,capRight:!0};return await Promise.all([i(d),n({selected:a,width:h,height:l})]),t}return{element:t,render:o}}var mI=Object.defineProperty,gI=(r,t,e)=>t in r?mI(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ro=(r,t,e)=>(gI(r,typeof t!="symbol"?t+"":t,e),e);class yI extends Tt{constructor(t){super(),Ro(this,"_progress",0),Ro(this,"options"),Ro(this,"bgCircle",new Ir),Ro(this,"fillCircle",new Ir),Ro(this,"innerView",new Tt),this.options=t,this.addChild(this.innerView),this.innerView.addChild(this.bgCircle,this.fillCircle),this.addBackground(),t.value&&(this.progress=t.value)}addBackground(){const{backgroundColor:t,lineWidth:e,radius:i,backgroundAlpha:s}=this.options;let n=1;s>0&&(n=s),t===void 0&&(n=1e-6),this.bgCircle.lineStyle({width:e,color:t,alpha:n}).drawCircle(0,0,i)}set progress(t){t>100&&(t=100),t<0&&(t=0),this._progress=t;const{lineWidth:e,radius:i,fillColor:s,fillAlpha:n,cap:o}=this.options;if(t===0&&n===0){this.fillCircle.clear();return}const a=0,h=360/100*t;this.fillCircle.clear().lineStyle({width:e,color:s,cap:o,alpha:n}).arc(0,0,i,(-90+a)*Nc,(-90+a+h)*Nc)}get progress(){return this._progress}}async function bI(r={}){const t=await Sb(),e=new yI({fillColor:16777215,cullAtZoomThreshold:!0,backgroundColor:0,backgroundAlpha:1,value:50,cap:"round",fillAlpha:1,lineWidth:20,radius:50,...r});r.cullAtZoomThreshold&&t.add(e);function i(s){e.progress=s.value??0;const n=(s.radius+s.lineWidth)*2;return e.width=n,e.height=n,e.position.set(n/2),e}return{element:e,render:i}}const xI=Object.freeze(Object.defineProperty({__proto__:null,Artifact:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_19)'%3e%3cmask%20id='mask0_7_19'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_19)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.68182%205.63634C5.68182%205.15937%206.06849%204.77271%206.54546%204.77271H13.4546C13.9316%204.77271%2014.3182%205.15937%2014.3182%205.63634V14.2512C14.3182%2014.8932%2013.6426%2015.3108%2013.0683%2015.0237L11.8182%2014.3986L10.3863%2015.1146C10.1431%2015.2362%209.85691%2015.2362%209.61373%2015.1146L8.18182%2014.3986L6.93169%2015.0237C6.35746%2015.3108%205.68182%2014.8932%205.68182%2014.2512V5.63634ZM7.04546%206.13634V13.4423L7.7956%2013.0672C8.03873%2012.9456%208.32491%2012.9456%208.5681%2013.0672L10%2013.7832L11.4319%2013.0672C11.6751%2012.9456%2011.9613%2012.9456%2012.2045%2013.0672L12.9546%2013.4423V6.13634H7.04546Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%208.63631C6.36365%208.38531%206.56716%208.18176%206.81819%208.18176H6.98566C7.23669%208.18176%207.4402%208.38531%207.4402%208.63631C7.4402%208.88731%207.23669%209.09085%206.98566%209.09085H6.81819C6.56716%209.09085%206.36365%208.88731%206.36365%208.63631ZM7.78709%208.63631C7.78709%208.38531%207.9906%208.18176%208.24165%208.18176H8.57656C8.82765%208.18176%209.0311%208.38531%209.0311%208.63631C9.0311%208.88731%208.82765%209.09085%208.57656%209.09085H8.24165C7.9906%209.09085%207.78709%208.88731%207.78709%208.63631ZM9.37801%208.63631C9.37801%208.38531%209.58147%208.18176%209.83256%208.18176H10.1675C10.4186%208.18176%2010.622%208.38531%2010.622%208.63631C10.622%208.88731%2010.4186%209.09085%2010.1675%209.09085H9.83256C9.58147%209.09085%209.37801%208.88731%209.37801%208.63631ZM10.9689%208.63631C10.9689%208.38531%2011.1724%208.18176%2011.4235%208.18176H11.7584C12.0095%208.18176%2012.2129%208.38531%2012.2129%208.63631C12.2129%208.88731%2012.0095%209.09085%2011.7584%209.09085H11.4235C11.1724%209.09085%2010.9689%208.88731%2010.9689%208.63631ZM12.5598%208.63631C12.5598%208.38531%2012.7633%208.18176%2013.0144%208.18176H13.1818C13.4328%208.18176%2013.6364%208.38531%2013.6364%208.63631C13.6364%208.88731%2013.4328%209.09085%2013.1818%209.09085H13.0144C12.7633%209.09085%2012.5598%208.88731%2012.5598%208.63631Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_19'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactImage:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_36)'%3e%3cmask%20id='mask0_7_36'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_36)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.4718%2010.0244C11.2567%209.97354%2011.0304%2010.0028%2010.8353%2010.1067L2.29995%2014.6522C1.8568%2014.8882%201.68886%2015.4387%201.92486%2015.8818C2.16086%2016.325%202.71143%2016.4929%203.15458%2016.2569L11.3872%2011.8727L17.9726%2013.4302C18.4612%2013.5457%2018.951%2013.2433%2019.0665%2012.7546C19.1821%2012.2661%2018.8796%2011.7764%2018.3911%2011.6607L11.4718%2010.0244Z'%20fill='white'/%3e%3cpath%20d='M6.07329%209.09092C5.32016%209.09092%204.70966%208.48037%204.70966%207.72728C4.70966%206.97417%205.32016%206.36365%206.07329%206.36365C6.82643%206.36365%207.43693%206.97417%207.43693%207.72728C7.43693%208.48037%206.82643%209.09092%206.07329%209.09092Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_36'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactMarkdown:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_27)'%3e%3cmask%20id='mask0_7_27'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_27)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%2010C6.36365%209.49794%206.77067%209.09094%207.27274%209.09094H12.7273C13.2294%209.09094%2013.6364%209.49794%2013.6364%2010C13.6364%2010.5021%2013.2294%2010.9091%2012.7273%2010.9091H7.27274C6.77067%2010.9091%206.36365%2010.5021%206.36365%2010Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%2013.6364C6.36365%2013.1343%206.77067%2012.7273%207.27274%2012.7273H9.09092C9.59301%2012.7273%2010%2013.1343%2010%2013.6364C10%2014.1385%209.59301%2014.5455%209.09092%2014.5455H7.27274C6.77067%2014.5455%206.36365%2014.1385%206.36365%2013.6364Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%206.36368C6.36365%205.86161%206.77067%205.45459%207.27274%205.45459H11.8182C12.3203%205.45459%2012.7273%205.86161%2012.7273%206.36368C12.7273%206.86575%2012.3203%207.27277%2011.8182%207.27277H7.27274C6.77067%207.27277%206.36365%206.86575%206.36365%206.36368Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_27'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactProgress:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_2)'%3e%3cmask%20id='mask0_7_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_2)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.04937%200.190318C8.681%200.0653727%209.33327%200%2010%200C10.6667%200%2011.319%200.0653727%2011.9506%200.190318L11.5978%201.97394C11.0817%201.87185%2010.5475%201.81818%2010%201.81818C9.45245%201.81818%208.91827%201.87185%208.40218%201.97394L8.04937%200.190318ZM15.5568%201.68489C16.6469%202.41471%2017.5853%203.35308%2018.3151%204.4432L16.8043%205.45469C16.2066%204.56206%2015.4379%203.79335%2014.5453%203.19574L15.5568%201.68489ZM1.68489%204.4432C2.41471%203.35308%203.35308%202.41471%204.4432%201.68489L5.45469%203.19574C4.56206%203.79335%203.79335%204.56206%203.19574%205.45469L1.68489%204.4432ZM19.8096%208.04937C19.9346%208.681%2020%209.33327%2020%2010C20%2010.6667%2019.9346%2011.319%2019.8096%2011.9506L18.0261%2011.5978C18.1282%2011.0817%2018.1818%2010.5475%2018.1818%2010C18.1818%209.45245%2018.1282%208.91827%2018.0261%208.40218L19.8096%208.04937ZM0%2010C0%209.33327%200.0653727%208.681%200.190318%208.04937L1.97394%208.40218C1.87185%208.91827%201.81818%209.45245%201.81818%2010C1.81818%2010.5475%201.87185%2011.0817%201.97394%2011.5978L0.190318%2011.9506C0.0653727%2011.319%200%2010.6667%200%2010ZM18.3151%2015.5568C17.5853%2016.6469%2016.6469%2017.5853%2015.5568%2018.3151L14.5453%2016.8043C15.4379%2016.2066%2016.2066%2015.4379%2016.8043%2014.5453L18.3151%2015.5568ZM4.4432%2018.3151C3.35308%2017.5853%202.41471%2016.6469%201.68489%2015.5568L3.19574%2014.5453C3.79335%2015.4379%204.56206%2016.2066%205.45469%2016.8043L4.4432%2018.3151ZM10%2020C9.33327%2020%208.681%2019.9346%208.04937%2019.8096L8.40218%2018.0261C8.91827%2018.1282%209.45245%2018.1818%2010%2018.1818C10.5475%2018.1818%2011.0817%2018.1282%2011.5978%2018.0261L11.9506%2019.8096C11.319%2019.9346%2010.6667%2020%2010%2020Z'%20fill='white'/%3e%3cpath%20d='M10%2011.8181C8.99582%2011.8181%208.18182%2011.0041%208.18182%209.99994C8.18182%208.99576%208.99582%208.18176%2010%208.18176C11.0042%208.18176%2011.8182%208.99576%2011.8182%209.99994C11.8182%2011.0041%2011.0042%2011.8181%2010%2011.8181Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_2'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactResult:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_19)'%3e%3cmask%20id='mask0_7_19'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_19)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.68182%205.63634C5.68182%205.15937%206.06849%204.77271%206.54546%204.77271H13.4546C13.9316%204.77271%2014.3182%205.15937%2014.3182%205.63634V14.2512C14.3182%2014.8932%2013.6426%2015.3108%2013.0683%2015.0237L11.8182%2014.3986L10.3863%2015.1146C10.1431%2015.2362%209.85691%2015.2362%209.61373%2015.1146L8.18182%2014.3986L6.93169%2015.0237C6.35746%2015.3108%205.68182%2014.8932%205.68182%2014.2512V5.63634ZM7.04546%206.13634V13.4423L7.7956%2013.0672C8.03873%2012.9456%208.32491%2012.9456%208.5681%2013.0672L10%2013.7832L11.4319%2013.0672C11.6751%2012.9456%2011.9613%2012.9456%2012.2045%2013.0672L12.9546%2013.4423V6.13634H7.04546Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%208.63631C6.36365%208.38531%206.56716%208.18176%206.81819%208.18176H6.98566C7.23669%208.18176%207.4402%208.38531%207.4402%208.63631C7.4402%208.88731%207.23669%209.09085%206.98566%209.09085H6.81819C6.56716%209.09085%206.36365%208.88731%206.36365%208.63631ZM7.78709%208.63631C7.78709%208.38531%207.9906%208.18176%208.24165%208.18176H8.57656C8.82765%208.18176%209.0311%208.38531%209.0311%208.63631C9.0311%208.88731%208.82765%209.09085%208.57656%209.09085H8.24165C7.9906%209.09085%207.78709%208.88731%207.78709%208.63631ZM9.37801%208.63631C9.37801%208.38531%209.58147%208.18176%209.83256%208.18176H10.1675C10.4186%208.18176%2010.622%208.38531%2010.622%208.63631C10.622%208.88731%2010.4186%209.09085%2010.1675%209.09085H9.83256C9.58147%209.09085%209.37801%208.88731%209.37801%208.63631ZM10.9689%208.63631C10.9689%208.38531%2011.1724%208.18176%2011.4235%208.18176H11.7584C12.0095%208.18176%2012.2129%208.38531%2012.2129%208.63631C12.2129%208.88731%2012.0095%209.09085%2011.7584%209.09085H11.4235C11.1724%209.09085%2010.9689%208.88731%2010.9689%208.63631ZM12.5598%208.63631C12.5598%208.38531%2012.7633%208.18176%2013.0144%208.18176H13.1818C13.4328%208.18176%2013.6364%208.38531%2013.6364%208.63631C13.6364%208.88731%2013.4328%209.09085%2013.1818%209.09085H13.0144C12.7633%209.09085%2012.5598%208.88731%2012.5598%208.63631Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_19'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactTable:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_9)'%3e%3cmask%20id='mask0_7_9'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_9)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20d='M8.18183%205.45459H6.36365C5.86157%205.45459%205.45456%205.8616%205.45456%206.36368V8.18186C5.45456%208.68394%205.86157%209.09095%206.36365%209.09095H8.18183C8.68391%209.09095%209.09092%208.68394%209.09092%208.18186V6.36368C9.09092%205.8616%208.68391%205.45459%208.18183%205.45459Z'%20fill='white'/%3e%3cpath%20d='M13.6364%205.45459H11.8182C11.3161%205.45459%2010.9091%205.8616%2010.9091%206.36368V8.18186C10.9091%208.68394%2011.3161%209.09095%2011.8182%209.09095H13.6364C14.1384%209.09095%2014.5455%208.68394%2014.5455%208.18186V6.36368C14.5455%205.8616%2014.1384%205.45459%2013.6364%205.45459Z'%20fill='white'/%3e%3cpath%20d='M13.6364%2010.9091H11.8182C11.3161%2010.9091%2010.9091%2011.3161%2010.9091%2011.8181V13.6363C10.9091%2014.1384%2011.3161%2014.5454%2011.8182%2014.5454H13.6364C14.1384%2014.5454%2014.5455%2014.1384%2014.5455%2013.6363V11.8181C14.5455%2011.3161%2014.1384%2010.9091%2013.6364%2010.9091Z'%20fill='white'/%3e%3cpath%20d='M8.18183%2010.9091H6.36365C5.86157%2010.9091%205.45456%2011.3161%205.45456%2011.8181V13.6363C5.45456%2014.1384%205.86157%2014.5454%206.36365%2014.5454H8.18183C8.68391%2014.5454%209.09092%2014.1384%209.09092%2013.6363V11.8181C9.09092%2011.3161%208.68391%2010.9091%208.18183%2010.9091Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_9'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"}));function _I(r){const t={resolution:Il};return ot.from(xI[r],t)}async function vI(r){return await fo(_I,[r])}async function wI({cullAtZoomThreshold:r=!0}={}){const t=await Sb(),e=new jt;r&&t.add(e);async function i(s){const n=await vI(s);return e.texture=n,e}return{element:e,render:i}}var Qy={exports:{}};(function(r){(function(){function t(m,g){document.addEventListener?m.addEventListener("scroll",g,!1):m.attachEvent("scroll",g)}function e(m){document.body?m():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),m()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),m())})}function i(m){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(m)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function s(m,g){m.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+g+";"}function n(m){var g=m.g.offsetWidth,b=g+100;return m.j.style.width=b+"px",m.i.scrollLeft=b,m.h.scrollLeft=m.h.scrollWidth+100,m.l!==g?(m.l=g,!0):!1}function o(m,g){function b(){var x=_;n(x)&&x.g.parentNode!==null&&g(x.l)}var _=m;t(m.h,b),t(m.i,b),n(m)}function a(m,g,b){g=g||{},b=b||window,this.family=m,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=b}var h=null,l=null,c=null,u=null;function d(m){return l===null&&(f(m)&&/Apple/.test(window.navigator.vendor)?(m=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!m&&603>parseInt(m[1],10)):l=!1),l}function f(m){return u===null&&(u=!!m.document.fonts),u}function p(m,g){var b=m.style,_=m.weight;if(c===null){var x=document.createElement("div");try{x.style.font="condensed 100px sans-serif"}catch{}c=x.style.font!==""}return[b,_,c?m.stretch:"","100px",g].join(" ")}a.prototype.load=function(m,g){var b=this,_=m||"BESbswy",x=0,v=g||3e3,T=new Date().getTime();return new Promise(function(C,E){if(f(b.context)&&!d(b.context)){var I=new Promise(function(N,F){function P(){new Date().getTime()-T>=v?F(Error(""+v+"ms timeout exceeded")):b.context.document.fonts.load(p(b,'"'+b.family+'"'),_).then(function(A){1<=A.length?N():setTimeout(P,25)},F)}P()}),R=new Promise(function(N,F){x=setTimeout(function(){F(Error(""+v+"ms timeout exceeded"))},v)});Promise.race([R,I]).then(function(){clearTimeout(x),C(b)},E)}else e(function(){function N(){var O;(O=D!=-1&&X!=-1||D!=-1&&B!=-1||X!=-1&&B!=-1)&&((O=D!=X&&D!=B&&X!=B)||(h===null&&(O=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!O&&(536>parseInt(O[1],10)||parseInt(O[1],10)===536&&11>=parseInt(O[2],10))),O=h&&(D==H&&X==H&&B==H||D==lt&&X==lt&&B==lt||D==W&&X==W&&B==W)),O=!O),O&&(L.parentNode!==null&&L.parentNode.removeChild(L),clearTimeout(x),C(b))}function F(){if(new Date().getTime()-T>=v)L.parentNode!==null&&L.parentNode.removeChild(L),E(Error(""+v+"ms timeout exceeded"));else{var O=b.context.document.hidden;(O===!0||O===void 0)&&(D=P.g.offsetWidth,X=A.g.offsetWidth,B=G.g.offsetWidth,N()),x=setTimeout(F,50)}}var P=new i(_),A=new i(_),G=new i(_),D=-1,X=-1,B=-1,H=-1,lt=-1,W=-1,L=document.createElement("div");L.dir="ltr",s(P,p(b,"sans-serif")),s(A,p(b,"serif")),s(G,p(b,"monospace")),L.appendChild(P.g),L.appendChild(A.g),L.appendChild(G.g),b.context.document.body.appendChild(L),H=P.g.offsetWidth,lt=A.g.offsetWidth,W=G.g.offsetWidth,F(),o(P,function(O){D=O,N()}),s(P,p(b,'"'+b.family+'",sans-serif')),o(A,function(O){X=O,N()}),s(A,p(b,'"'+b.family+'",serif')),o(G,function(O){B=O,N()}),s(G,p(b,'"'+b.family+'",monospace'))})})},r.exports=a})()})(Qy);var TI=Qy.exports;const SI=Zs(TI),qy={inter:{fontFamily:"Inter Variable",fontSize:16,lineHeight:20,fill:16777215}},t1={resolution:Il,chars:li.ASCII},e1="sans-serif",i1={inter:AI(qy.inter)};let wd=!1;async function CI(){const r=Object.values(qy);await Promise.all(r.map(t=>EI(t))),wd=!0,$.emit("fontsLoaded",i1)}async function EI(r){const{fontFamily:t,...e}=r,i=new SI(t);try{await i.load()}catch(s){console.error(s),console.warn(`fonts: font ${t} failed to load, falling back to ${e1}`),li.from(t,{fontFamily:e1,...e},t1);return}li.from(t,r,t1)}function II(){wd=!1}async function r1(){return wd?i1:await Ge("fontsLoaded")}function AI(r){const{fontFamily:t,...e}=r,i={fontName:t,...e};return s=>new GS(s,i)}async function Oh({cullAtZoomThreshold:r=!0}={}){const{inter:t}=await r1(),e=await Tb(),i=t("");r&&e.add(i);async function s(n){return i.text=n,await i}return{element:i,render:s}}async function s1({cullAtZoomThreshold:r}){const t=await Mt(),e=new Tt,i=new Tt,{element:s,render:n}=await wI({cullAtZoomThreshold:r}),{element:o,render:a}=await bI(),{element:h,render:l}=await Oh({cullAtZoomThreshold:r}),{element:c,render:u}=await pI();let d=!1,f=null,p;i.addChild(h),e.addChild(c),e.addChild(i);async function m(v){const{selected:T,name:C,type:E}=v;return d=T??d,f=C??f,p=E,p==="progress"?i.addChild(o):i.addChild(s),v.type==="progress"?await Promise.all([b(v.data),_()]):await Promise.all([g(),_()]),await x(),e}async function g(){if(p==="progress")return s;const v=Yr[p],{artifactIconSize:T,artifactIconColor:C,artifactPaddingLeft:E,artifactPaddingY:I}=t.styles,R=await n(v);return R.position={x:E,y:I},R.width=T,R.height=T,R.tint=C,R}async function b(v){const{artifactPaddingLeft:T,artifactPaddingRight:C,artifactPaddingY:E,artifactIconSize:I}=t.styles,R=20,N=(I-R*2)/2,F=a({value:v,radius:N,lineWidth:R});return f?F.position.x+=T:F.position.x+=(T+C)/2,F.position.y+=E,o}async function _(){if(!f)return h.visible=!1,h;await l(f);const{artifactPaddingLeft:v,artifactPaddingY:T,artifactTextColor:C,artifactIconSize:E,artifactContentGap:I}=t.styles,R=f?I:0,N=v+E+R,F=T;return h.tint=C,h.scale.set(.75),h.position={x:N,y:F},h.visible=!0,h}async function x(){const{artifactPaddingLeft:v,artifactPaddingRight:T,artifactPaddingY:C}=t.styles,E={selected:d,width:i.width+v+T,height:i.height+C*2};return await u(E)}return{element:e,render:m}}let Zt=null,Bh=!1;async function MI(){const r=await qt();r.on("click",()=>Di(null)),r.on("drag-start",()=>{Bh=!0}),r.on("drag-end",()=>{setTimeout(()=>{Bh=!1})})}function RI(){Zt=null,Bh=!1}function Di(r){if(!Bh&&!(!r&&!Zt||r&&ar(r))){if(Zt=r,r===null){$.emit("itemSelected",null);return}$.emit("itemSelected",r)}}function ar(r){if(Zt===null)return!1;const{kind:t}=r;switch(t){case"task-run":return ua(Zt)&&Zt.id===r.id;case"flow-run":return ua(Zt)&&Zt.id===r.id;case"artifact":return Vf(Zt)&&Zt.id===r.id;case"artifacts":return Hf(Zt)&&Zt.ids.length===r.ids.length&&Zt.ids.every(i=>r.ids.includes(i));case"state":return Kf(Zt)&&Zt.id===r.id;case"event":return Yf(Zt)&&Zt.id===r.id;case"events":return zf(Zt)&&Zt.ids.length===r.ids.length&&Zt.ids.every(i=>r.ids.includes(i));default:const e=t;throw new Error(`switch does not have case for value: ${e}`)}}function PI(){return Zt&&ua(Zt)?Zt:null}async function Td(r,{cullAtZoomThreshold:t=!0,enableLocalClickHandling:e=!1}={}){const{element:i,render:s}=await s1({cullAtZoomThreshold:t});let n=!1,o=r;i.eventMode="static",i.cursor="pointer",e&&i.on("click",u=>{u.stopPropagation(),Di({kind:"artifact",id:o.id})}),$.on("itemSelected",()=>{const u=ar({kind:"artifact",id:o.id});u!==n&&(n=u,a(o))});async function a(u){o=u,await s({selected:n,name:o.key,...o})}function h(){return n}function l(){return o.created}function c(){return o.id}return{isArtifact:!0,element:i,render:a,getSelected:h,getDate:l,getId:c}}function n1(r){return r.isArtifact===!0}function LI(r){return typeof r=="function"}function Uh(r){return LI(r)?r():r}async function o1(r,t){const e=await Bi(),i=await Mt();let s,n=null;async function o(){try{n=await i.fetchEvents(Uh(r)),t(n)}catch(h){console.error(h)}e.end_time||(s=setTimeout(()=>o(),i.fetchEventsInterval))}function a(){clearTimeout(s)}return{start:o,stop:a}}async function a1(){const r=await Mt(),t=await Tb(),e=new Tt,{element:i,render:s}=await Jy(),{element:n,render:o}=await vd(),{element:a,render:h}=await kh();t.add(e);let l=!1;e.eventMode="static",e.cursor="pointer",e.addChild(n),e.addChild(i),e.addChild(a),e.on("mouseover",u),e.on("mouseout",d);async function c({inside:f,isOpen:p}){l=f;const m={size:10,stroke:2,rotate:p?Nh.Up:Nh.Down},g=await s(m),b={width:r.styles.nodeToggleSize,height:r.styles.nodeToggleSize,background:r.styles.nodeToggleBgColor,radius:r.styles.nodeToggleBorderRadius},_=await o(b);_.alpha=f?0:.5;const x=await h({width:b.width,height:b.height,radius:b.radius,stroke:1,color:r.styles.nodeToggleBorderColor});x.alpha=f?0:1;const v={y:_.height/2,x:_.width/2},T=m.size/4;return g.x=v.x,g.y=p?v.y+T:v.y-T,e}function u(){n.alpha=l?.5:1}function d(){n.alpha=l?0:.5}return{element:e,render:c}}async function h1(){const r=await Mt(),t=await Qt(),e=new Tt,{element:i,render:s}=await vd(),{element:n,render:o}=await Dh();e.addChild(i),e.addChild(n);async function a(l){const{background:c="#fff"}=r.styles.node(l),{nodeHeight:u,nodeRadius:d}=r.styles,f=ar({kind:l.kind,id:l.id}),p=h(l,d),m=l.state_type!=="RUNNING"||t.isDependency();return await Promise.all([s({width:p,height:u,radius:d,background:c,capRight:m}),o({selected:f,width:p,height:u})]),i}function h(l,c){const u=gd();if(st.isTemporal()||st.isLeftAligned()){const d=l.start_time,f=l.end_time??new Date,m=zy(f,d)/_h*u;return Math.max(m,c*2)}return u}return{element:e,render:a}}var l1="Expected a function",c1=NaN,GI="[object Symbol]",FI=/^\s+|\s+$/g,NI=/^[-+]0x[0-9a-f]+$/i,kI=/^0b[01]+$/i,DI=/^0o[0-7]+$/i,OI=parseInt,BI=typeof be=="object"&&be&&be.Object===Object&&be,UI=typeof self=="object"&&self&&self.Object===Object&&self,XI=BI||UI||Function("return this")(),WI=Object.prototype,ZI=WI.toString,VI=Math.max,HI=Math.min,Sd=function(){return XI.Date.now()};function KI(r,t,e){var i,s,n,o,a,h,l=0,c=!1,u=!1,d=!0;if(typeof r!="function")throw new TypeError(l1);t=u1(t)||0,Xh(e)&&(c=!!e.leading,u="maxWait"in e,n=u?VI(u1(e.maxWait)||0,t):n,d="trailing"in e?!!e.trailing:d);function f(C){var E=i,I=s;return i=s=void 0,l=C,o=r.apply(I,E),o}function p(C){return l=C,a=setTimeout(b,t),c?f(C):o}function m(C){var E=C-h,I=C-l,R=t-E;return u?HI(R,n-I):R}function g(C){var E=C-h,I=C-l;return h===void 0||E>=t||E<0||u&&I>=n}function b(){var C=Sd();if(g(C))return _(C);a=setTimeout(b,m(C))}function _(C){return a=void 0,d&&i?f(C):(i=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),l=0,i=h=s=a=void 0}function v(){return a===void 0?o:_(Sd())}function T(){var C=Sd(),E=g(C);if(i=arguments,s=this,h=C,E){if(a===void 0)return p(h);if(u)return a=setTimeout(b,t),f(h)}return a===void 0&&(a=setTimeout(b,t)),o}return T.cancel=x,T.flush=v,T}function YI(r,t,e){var i=!0,s=!0;if(typeof r!="function")throw new TypeError(l1);return Xh(e)&&(i="leading"in e?!!e.leading:i,s="trailing"in e?!!e.trailing:s),KI(r,t,{leading:i,maxWait:t,trailing:s})}function Xh(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function zI(r){return!!r&&typeof r=="object"}function jI(r){return typeof r=="symbol"||zI(r)&&ZI.call(r)==GI}function u1(r){if(typeof r=="number")return r;if(jI(r))return c1;if(Xh(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Xh(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(FI,"");var e=kI.test(r);return e||DI.test(r)?OI(r.slice(2),e?2:8):NI.test(r)?c1:+r}var JI=YI;const d1=Zs(JI);async function f1(){const{element:r,render:t}=await s1({cullAtZoomThreshold:!1});let e=null,i=[],s=!1;r.eventMode="static",r.cursor="pointer",$.on("itemSelected",()=>{const l=ar({kind:"artifacts",ids:i});l!==s&&e&&(s=l,n({ids:i,date:e}))});async function n(l){if(!l){e=null,i=[],r.visible=!1;return}const{ids:c,date:u}=l;e=u,i=c,await t({selected:s,type:"unknown",name:c.length.toString()}),r.visible=!0}function o(){return s}function a(){return e}function h(){return i}return{isArtifactCluster:!0,element:r,render:n,getSelected:o,getDate:a,getIds:h,isCluster:!0}}async function $I({radius:r}){const t=await Jt(),e=new Ir;return e.beginFill("#fff"),e.drawCircle(0,0,r),e.endFill(),t.renderer.generateTexture(e,{resolution:El})}async function QI(r){return await fo($I,[r])}async function p1(r){const t=await QI(r);return new jt(t)}async function m1(r){const t=new Tt,e=await Mt(),i=await or(),s=await p1({radius:e.styles.eventRadiusDefault}),{element:n,render:o}=await Dh();let a=!1;t.addChild(i),t.addChild(s),t.addChild(n),t.eventMode="static",t.cursor="pointer",t.on("mouseenter",()=>{a||s.scale.set(1.5)}),t.on("mouseleave",()=>{a||s.scale.set(1)}),$.on("itemSelected",()=>{const u=ar({kind:"event",id:r.id,occurred:r.occurred});u!==a&&(a=u,s.scale.set(u?1.5:1),h())});function h(){const{eventColor:u,eventTargetSize:d,eventSelectedBorderInset:f}=e.styles;i.alpha=0,i.width=d,i.height=d,s.tint=u,s.anchor.set(.5),s.position.set(d/2,d/2),n.position.set(f,f),o({selected:a,width:d-f*2,height:d-f*2})}function l(){return r.id}function c(){return r.occurred}return{element:t,render:h,getId:l,getDate:c}}async function g1(){const r=new Tt,t=await Mt(),e=await or(),i=await p1({radius:t.styles.eventClusterRadiusDefault}),{element:s,render:n}=await Dh(),{element:o,render:a}=await Oh({cullAtZoomThreshold:!1});let h=null,l=[],c=!1;r.addChild(e),r.addChild(i),r.addChild(o),r.addChild(s),r.eventMode="static",r.cursor="pointer",r.on("mouseenter",()=>{c||i.scale.set(1.5)}),r.on("mouseleave",()=>{c||i.scale.set(1)}),$.on("itemSelected",()=>{const _=ar({kind:"events",occurred:h,ids:l});_!==c&&(c=_,i.scale.set(_?1.5:1),h&&u({ids:l,date:h}))});async function u(_){if(!_){h=null,l=[],r.visible=!1;return}const{ids:x,date:v}=_;h=v,l=x,d(),f(),m(),await p(x.length.toString()),r.visible=!0}function d(){const{eventTargetSize:_}=t.styles;e.alpha=0,e.width=_,e.height=_}function f(){const{eventClusterColor:_,eventTargetSize:x}=t.styles;i.tint=_,i.anchor.set(.5),i.position.set(x/2,x/2)}async function p(_){if(l.length<2)return;const{eventTargetSize:x}=t.styles,v=-1;o.scale.set(.6),o.anchor.set(.5),o.position.set(x/2,x/2+v),await a(_)}function m(){const{eventSelectedBorderInset:_,eventTargetSize:x}=t.styles;s.position.set(_,_),n({selected:c,width:x-_*2,height:x-_*2})}function g(){return l}function b(){return h}return{element:r,render:u,getIds:g,getDate:b}}function Wh(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function qI(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Cd(r){let t,e,i;r.length!==2?(t=Wh,e=(a,h)=>Wh(r(a),h),i=(a,h)=>r(a)-h):(t=r===Wh||r===qI?r:tA,e=r,i=r);function s(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<0?l=u+1:c=u}while(l<c)}return l}function n(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<=0?l=u+1:c=u}while(l<c)}return l}function o(a,h,l=0,c=a.length){const u=s(a,h,l,c-1);return u>l&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:s,center:o,right:n}}function tA(){return 0}function eA(r){return r===null?NaN:+r}const iA=Cd(Wh).right;Cd(eA).center;const rA=Math.sqrt(50),sA=Math.sqrt(10),nA=Math.sqrt(2);function Zh(r,t,e){const i=(t-r)/Math.max(0,e),s=Math.floor(Math.log10(i)),n=i/Math.pow(10,s),o=n>=rA?10:n>=sA?5:n>=nA?2:1;let a,h,l;return s<0?(l=Math.pow(10,-s)/o,a=Math.round(r*l),h=Math.round(t*l),a/l<r&&++a,h/l>t&&--h,l=-l):(l=Math.pow(10,s)*o,a=Math.round(r/l),h=Math.round(t/l),a*l<r&&++a,h*l>t&&--h),h<a&&.5<=e&&e<2?Zh(r,t,e*2):[a,h,l]}function oA(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];const i=t<r,[s,n,o]=i?Zh(t,r,e):Zh(r,t,e);if(!(n>=s))return[];const a=n-s+1,h=new Array(a);if(i)if(o<0)for(let l=0;l<a;++l)h[l]=(n-l)/-o;else for(let l=0;l<a;++l)h[l]=(n-l)*o;else if(o<0)for(let l=0;l<a;++l)h[l]=(s+l)/-o;else for(let l=0;l<a;++l)h[l]=(s+l)*o;return h}function Ed(r,t,e){return t=+t,r=+r,e=+e,Zh(r,t,e)[2]}function Id(r,t,e){t=+t,r=+r,e=+e;const i=t<r,s=i?Ed(t,r,e):Ed(r,t,e);return(i?-1:1)*(s<0?1/-s:s)}function Ad(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function y1(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function Po(){}var Lo=.7,Vh=1/Lo,Tn="\\s*([+-]?\\d+)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aA=/^#([0-9a-f]{3,8})$/,hA=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),lA=new RegExp(`^rgb\\(${Oi},${Oi},${Oi}\\)$`),cA=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${Go}\\)$`),uA=new RegExp(`^rgba\\(${Oi},${Oi},${Oi},${Go}\\)$`),dA=new RegExp(`^hsl\\(${Go},${Oi},${Oi}\\)$`),fA=new RegExp(`^hsla\\(${Go},${Oi},${Oi},${Go}\\)$`),b1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ad(Po,Fo,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:x1,formatHex:x1,formatHex8:pA,formatHsl:mA,formatRgb:_1,toString:_1});function x1(){return this.rgb().formatHex()}function pA(){return this.rgb().formatHex8()}function mA(){return C1(this).formatHsl()}function _1(){return this.rgb().formatRgb()}function Fo(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=aA.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?v1(t):e===3?new Ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Hh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Hh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hA.exec(r))?new Ae(t[1],t[2],t[3],1):(t=lA.exec(r))?new Ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cA.exec(r))?Hh(t[1],t[2],t[3],t[4]):(t=uA.exec(r))?Hh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dA.exec(r))?S1(t[1],t[2]/100,t[3]/100,1):(t=fA.exec(r))?S1(t[1],t[2]/100,t[3]/100,t[4]):b1.hasOwnProperty(r)?v1(b1[r]):r==="transparent"?new Ae(NaN,NaN,NaN,0):null}function v1(r){return new Ae(r>>16&255,r>>8&255,r&255,1)}function Hh(r,t,e,i){return i<=0&&(r=t=e=NaN),new Ae(r,t,e,i)}function gA(r){return r instanceof Po||(r=Fo(r)),r?(r=r.rgb(),new Ae(r.r,r.g,r.b,r.opacity)):new Ae}function Md(r,t,e,i){return arguments.length===1?gA(r):new Ae(r,t,e,i??1)}function Ae(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}Ad(Ae,Md,y1(Po,{brighter(r){return r=r==null?Vh:Math.pow(Vh,r),new Ae(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Lo:Math.pow(Lo,r),new Ae(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Ae(Cs(this.r),Cs(this.g),Cs(this.b),Kh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w1,formatHex:w1,formatHex8:yA,formatRgb:T1,toString:T1}));function w1(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function yA(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function T1(){const r=Kh(this.opacity);return`${r===1?"rgb(":"rgba("}${Cs(this.r)}, ${Cs(this.g)}, ${Cs(this.b)}${r===1?")":`, ${r})`}`}function Kh(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function Cs(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Es(r){return r=Cs(r),(r<16?"0":"")+r.toString(16)}function S1(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new ci(r,t,e,i)}function C1(r){if(r instanceof ci)return new ci(r.h,r.s,r.l,r.opacity);if(r instanceof Po||(r=Fo(r)),!r)return new ci;if(r instanceof ci)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,s=Math.min(t,e,i),n=Math.max(t,e,i),o=NaN,a=n-s,h=(n+s)/2;return a?(t===n?o=(e-i)/a+(e<i)*6:e===n?o=(i-t)/a+2:o=(t-e)/a+4,a/=h<.5?n+s:2-n-s,o*=60):a=h>0&&h<1?0:o,new ci(o,a,h,r.opacity)}function bA(r,t,e,i){return arguments.length===1?C1(r):new ci(r,t,e,i??1)}function ci(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}Ad(ci,bA,y1(Po,{brighter(r){return r=r==null?Vh:Math.pow(Vh,r),new ci(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Lo:Math.pow(Lo,r),new ci(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,s=2*e-i;return new Ae(Rd(r>=240?r-240:r+120,s,i),Rd(r,s,i),Rd(r<120?r+240:r-120,s,i),this.opacity)},clamp(){return new ci(E1(this.h),Yh(this.s),Yh(this.l),Kh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Kh(this.opacity);return`${r===1?"hsl(":"hsla("}${E1(this.h)}, ${Yh(this.s)*100}%, ${Yh(this.l)*100}%${r===1?")":`, ${r})`}`}}));function E1(r){return r=(r||0)%360,r<0?r+360:r}function Yh(r){return Math.max(0,Math.min(1,r||0))}function Rd(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const Pd=r=>()=>r;function xA(r,t){return function(e){return r+e*t}}function _A(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function vA(r){return(r=+r)==1?I1:function(t,e){return e-t?_A(t,e,r):Pd(isNaN(t)?e:t)}}function I1(r,t){var e=t-r;return e?xA(r,e):Pd(isNaN(r)?t:r)}const A1=function r(t){var e=vA(t);function i(s,n){var o=e((s=Md(s)).r,(n=Md(n)).r),a=e(s.g,n.g),h=e(s.b,n.b),l=I1(s.opacity,n.opacity);return function(c){return s.r=o(c),s.g=a(c),s.b=h(c),s.opacity=l(c),s+""}}return i.gamma=r,i}(1);function wA(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),s;return function(n){for(s=0;s<e;++s)i[s]=r[s]*(1-n)+t[s]*n;return i}}function TA(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function SA(r,t){var e=t?t.length:0,i=r?Math.min(e,r.length):0,s=new Array(i),n=new Array(e),o;for(o=0;o<i;++o)s[o]=Fd(r[o],t[o]);for(;o<e;++o)n[o]=t[o];return function(a){for(o=0;o<i;++o)n[o]=s[o](a);return n}}function CA(r,t){var e=new Date;return r=+r,t=+t,function(i){return e.setTime(r*(1-i)+t*i),e}}function zh(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function EA(r,t){var e={},i={},s;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in r?e[s]=Fd(r[s],t[s]):i[s]=t[s];return function(n){for(s in e)i[s]=e[s](n);return i}}var Ld=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gd=new RegExp(Ld.source,"g");function IA(r){return function(){return r}}function AA(r){return function(t){return r(t)+""}}function MA(r,t){var e=Ld.lastIndex=Gd.lastIndex=0,i,s,n,o=-1,a=[],h=[];for(r=r+"",t=t+"";(i=Ld.exec(r))&&(s=Gd.exec(t));)(n=s.index)>e&&(n=t.slice(e,n),a[o]?a[o]+=n:a[++o]=n),(i=i[0])===(s=s[0])?a[o]?a[o]+=s:a[++o]=s:(a[++o]=null,h.push({i:o,x:zh(i,s)})),e=Gd.lastIndex;return e<t.length&&(n=t.slice(e),a[o]?a[o]+=n:a[++o]=n),a.length<2?h[0]?AA(h[0].x):IA(t):(t=h.length,function(l){for(var c=0,u;c<t;++c)a[(u=h[c]).i]=u.x(l);return a.join("")})}function Fd(r,t){var e=typeof t,i;return t==null||e==="boolean"?Pd(t):(e==="number"?zh:e==="string"?(i=Fo(t))?(t=i,A1):MA:t instanceof Fo?A1:t instanceof Date?CA:TA(t)?wA:Array.isArray(t)?SA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?EA:zh)(r,t)}function RA(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function PA(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function jh(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Sn(r){return r=jh(Math.abs(r)),r?r[1]:NaN}function LA(r,t){return function(e,i){for(var s=e.length,n=[],o=0,a=r[0],h=0;s>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),n.push(e.substring(s-=a,s+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return n.reverse().join(t)}}function GA(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var FA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jh(r){if(!(t=FA.exec(r)))throw new Error("invalid format: "+r);var t;return new Nd({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jh.prototype=Nd.prototype;function Nd(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}Nd.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function NA(r){t:for(var t=r.length,e=1,i=-1,s;e<t;++e)switch(r[e]){case".":i=s=e;break;case"0":i===0&&(i=e),s=e;break;default:if(!+r[e])break t;i>0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(s+1):r}var M1;function kA(r,t){var e=jh(r,t);if(!e)return r+"";var i=e[0],s=e[1],n=s-(M1=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=i.length;return n===o?i:n>o?i+new Array(n-o+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+new Array(1-n).join("0")+jh(r,Math.max(0,t+n-1))[0]}function R1(r,t){var e=jh(r,t);if(!e)return r+"";var i=e[0],s=e[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const P1={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:PA,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>R1(r*100,t),r:R1,s:kA,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function L1(r){return r}var G1=Array.prototype.map,F1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DA(r){var t=r.grouping===void 0||r.thousands===void 0?L1:LA(G1.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",s=r.decimal===void 0?".":r.decimal+"",n=r.numerals===void 0?L1:GA(G1.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=Jh(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,b=u.width,_=u.comma,x=u.precision,v=u.trim,T=u.type;T==="n"?(_=!0,T="g"):P1[T]||(x===void 0&&(x=12),v=!0,T="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var C=m==="$"?e:m==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",E=m==="$"?i:/[%p]/.test(T)?o:"",I=P1[T],R=/[defgprs%]/.test(T);x=x===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function N(F){var P=C,A=E,G,D,X;if(T==="c")A=I(F)+A,F="";else{F=+F;var B=F<0||1/F<0;if(F=isNaN(F)?h:I(Math.abs(F),x),v&&(F=NA(F)),B&&+F==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:a:p==="-"||p==="("?"":p)+P,A=(T==="s"?F1[8+M1/3]:"")+A+(B&&p==="("?")":""),R){for(G=-1,D=F.length;++G<D;)if(X=F.charCodeAt(G),48>X||X>57){A=(X===46?s+F.slice(G+1):F.slice(G))+A,F=F.slice(0,G);break}}}_&&!g&&(F=t(F,1/0));var H=P.length+F.length+A.length,lt=H<b?new Array(b-H+1).join(d):"";switch(_&&g&&(F=t(lt+F,lt.length?b-A.length:1/0),lt=""),f){case"<":F=P+F+A+lt;break;case"=":F=P+lt+F+A;break;case"^":F=lt.slice(0,H=lt.length>>1)+P+F+A+lt.slice(H);break;default:F=lt+P+F+A;break}return n(F)}return N.toString=function(){return u+""},N}function c(u,d){var f=l((u=Jh(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Sn(d)/3)))*3,m=Math.pow(10,-p),g=F1[8+p/3];return function(b){return f(m*b)+g}}return{format:l,formatPrefix:c}}var $h,N1,k1;OA({thousands:",",grouping:[3],currency:["$",""]});function OA(r){return $h=DA(r),N1=$h.format,k1=$h.formatPrefix,$h}function BA(r){return Math.max(0,-Sn(Math.abs(r)))}function UA(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sn(t)/3)))*3-Sn(Math.abs(r)))}function XA(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Sn(t)-Sn(r))+1}function D1(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}function WA(r){return function(){return r}}function ZA(r){return+r}var O1=[0,1];function Cn(r){return r}function kd(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:WA(isNaN(t)?NaN:.5)}function VA(r,t){var e;return r>t&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function HA(r,t,e){var i=r[0],s=r[1],n=t[0],o=t[1];return s<i?(i=kd(s,i),n=e(o,n)):(i=kd(i,s),n=e(n,o)),function(a){return n(i(a))}}function KA(r,t,e){var i=Math.min(r.length,t.length)-1,s=new Array(i),n=new Array(i),o=-1;for(r[i]<r[0]&&(r=r.slice().reverse(),t=t.slice().reverse());++o<i;)s[o]=kd(r[o],r[o+1]),n[o]=e(t[o],t[o+1]);return function(a){var h=iA(r,a,1,i)-1;return n[h](s[h](a))}}function B1(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function YA(){var r=O1,t=O1,e=Fd,i,s,n,o=Cn,a,h,l;function c(){var d=Math.min(r.length,t.length);return o!==Cn&&(o=VA(r[0],r[d-1])),a=d>2?KA:HA,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?n:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(s((l||(l=a(t,r.map(i),zh)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,ZA),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=RA,c()},u.clamp=function(d){return arguments.length?(o=d?!0:Cn,c()):o!==Cn},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(n=d,u):n},function(d,f){return i=d,s=f,c()}}function U1(){return YA()(Cn,Cn)}function zA(r,t,e,i){var s=Id(r,t,e),n;switch(i=Jh(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(n=UA(s,o))&&(i.precision=n),k1(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(n=XA(s,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=n-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(n=BA(s))&&(i.precision=n-(i.type==="%")*2);break}}return N1(i)}function jA(r){var t=r.domain;return r.ticks=function(e){var i=t();return oA(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var s=t();return zA(s[0],s[s.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),s=0,n=i.length-1,o=i[s],a=i[n],h,l,c=10;for(a<o&&(l=o,o=a,a=l,l=s,s=n,n=l);c-- >0;){if(l=Ed(o,a,e),l===h)return i[s]=o,i[n]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function X1(){var r=U1();return r.copy=function(){return B1(r,X1())},D1.apply(r,arguments),jA(r)}function JA(r,t){r=r.slice();var e=0,i=r.length-1,s=r[e],n=r[i],o;return n<s&&(o=e,e=i,i=o,o=s,s=n,n=o),r[e]=t.floor(s),r[i]=t.ceil(n),r}const Dd=new Date,Od=new Date;function ie(r,t,e,i){function s(n){return r(n=arguments.length===0?new Date:new Date(+n)),n}return s.floor=n=>(r(n=new Date(+n)),n),s.ceil=n=>(r(n=new Date(n-1)),t(n,1),r(n),n),s.round=n=>{const o=s(n),a=s.ceil(n);return n-o<a-n?o:a},s.offset=(n,o)=>(t(n=new Date(+n),o==null?1:Math.floor(o)),n),s.range=(n,o,a)=>{const h=[];if(n=s.ceil(n),a=a==null?1:Math.floor(a),!(n<o)||!(a>0))return h;let l;do h.push(l=new Date(+n)),t(n,a),r(n);while(l<n&&n<o);return h},s.filter=n=>ie(o=>{if(o>=o)for(;r(o),!n(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!n(o););else for(;--a>=0;)for(;t(o,1),!n(o););}),e&&(s.count=(n,o)=>(Dd.setTime(+n),Od.setTime(+o),r(Dd),r(Od),Math.floor(e(Dd,Od))),s.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?s.filter(i?o=>i(o)%n===0:o=>s.count(0,o)%n===0):s)),s}const Qh=ie(()=>{},(r,t)=>{r.setTime(+r+t)},(r,t)=>t-r);Qh.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?ie(t=>{t.setTime(Math.floor(t/r)*r)},(t,e)=>{t.setTime(+t+e*r)},(t,e)=>(e-t)/r):Qh),Qh.range;const hr=1e3,$e=hr*60,lr=$e*60,cr=lr*24,Bd=cr*7,W1=cr*30,Ud=cr*365,En=ie(r=>{r.setTime(r-r.getMilliseconds())},(r,t)=>{r.setTime(+r+t*hr)},(r,t)=>(t-r)/hr,r=>r.getUTCSeconds());En.range;const Xd=ie(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*hr)},(r,t)=>{r.setTime(+r+t*$e)},(r,t)=>(t-r)/$e,r=>r.getMinutes());Xd.range,ie(r=>{r.setUTCSeconds(0,0)},(r,t)=>{r.setTime(+r+t*$e)},(r,t)=>(t-r)/$e,r=>r.getUTCMinutes()).range;const Wd=ie(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*hr-r.getMinutes()*$e)},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getHours());Wd.range,ie(r=>{r.setUTCMinutes(0,0,0)},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getUTCHours()).range;const No=ie(r=>r.setHours(0,0,0,0),(r,t)=>r.setDate(r.getDate()+t),(r,t)=>(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*$e)/cr,r=>r.getDate()-1);No.range;const Zd=ie(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/cr,r=>r.getUTCDate()-1);Zd.range,ie(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/cr,r=>Math.floor(r/cr)).range;function Is(r){return ie(t=>{t.setDate(t.getDate()-(t.getDay()+7-r)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*$e)/Bd)}const qh=Is(0),tl=Is(1),$A=Is(2),QA=Is(3),In=Is(4),qA=Is(5),tM=Is(6);qh.range,tl.range,$A.range,QA.range,In.range,qA.range,tM.range;function As(r){return ie(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-r)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/Bd)}const Z1=As(0),el=As(1),eM=As(2),iM=As(3),An=As(4),rM=As(5),sM=As(6);Z1.range,el.range,eM.range,iM.range,An.range,rM.range,sM.range;const Vd=ie(r=>{r.setDate(1),r.setHours(0,0,0,0)},(r,t)=>{r.setMonth(r.getMonth()+t)},(r,t)=>t.getMonth()-r.getMonth()+(t.getFullYear()-r.getFullYear())*12,r=>r.getMonth());Vd.range,ie(r=>{r.setUTCDate(1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCMonth(r.getUTCMonth()+t)},(r,t)=>t.getUTCMonth()-r.getUTCMonth()+(t.getUTCFullYear()-r.getUTCFullYear())*12,r=>r.getUTCMonth()).range;const ur=ie(r=>{r.setMonth(0,1),r.setHours(0,0,0,0)},(r,t)=>{r.setFullYear(r.getFullYear()+t)},(r,t)=>t.getFullYear()-r.getFullYear(),r=>r.getFullYear());ur.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:ie(t=>{t.setFullYear(Math.floor(t.getFullYear()/r)*r),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*r)}),ur.range;const Ms=ie(r=>{r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCFullYear(r.getUTCFullYear()+t)},(r,t)=>t.getUTCFullYear()-r.getUTCFullYear(),r=>r.getUTCFullYear());Ms.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:ie(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/r)*r),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*r)}),Ms.range;function nM(r,t,e,i,s,n){const o=[[En,1,hr],[En,5,5*hr],[En,15,15*hr],[En,30,30*hr],[n,1,$e],[n,5,5*$e],[n,15,15*$e],[n,30,30*$e],[s,1,lr],[s,3,3*lr],[s,6,6*lr],[s,12,12*lr],[i,1,cr],[i,2,2*cr],[e,1,Bd],[t,1,W1],[t,3,3*W1],[r,1,Ud]];function a(l,c,u){const d=c<l;d&&([l,c]=[c,l]);const f=u&&typeof u.range=="function"?u:h(l,c,u),p=f?f.range(l,+c+1):[];return d?p.reverse():p}function h(l,c,u){const d=Math.abs(c-l)/u,f=Cd(([,,g])=>g).right(o,d);if(f===o.length)return r.every(Id(l/Ud,c/Ud,u));if(f===0)return Qh.every(Math.max(Id(l,c,u),1));const[p,m]=o[d/o[f-1][2]<o[f][2]/d?f-1:f];return p.every(m)}return[a,h]}const[oM,aM]=nM(ur,Vd,qh,No,Wd,Xd);function Hd(r){if(0<=r.y&&r.y<100){var t=new Date(-1,r.m,r.d,r.H,r.M,r.S,r.L);return t.setFullYear(r.y),t}return new Date(r.y,r.m,r.d,r.H,r.M,r.S,r.L)}function Kd(r){if(0<=r.y&&r.y<100){var t=new Date(Date.UTC(-1,r.m,r.d,r.H,r.M,r.S,r.L));return t.setUTCFullYear(r.y),t}return new Date(Date.UTC(r.y,r.m,r.d,r.H,r.M,r.S,r.L))}function ko(r,t,e){return{y:r,m:t,d:e,H:0,M:0,S:0,L:0}}function hM(r){var t=r.dateTime,e=r.date,i=r.time,s=r.periods,n=r.days,o=r.shortDays,a=r.months,h=r.shortMonths,l=Do(s),c=Oo(s),u=Do(n),d=Oo(n),f=Do(o),p=Oo(o),m=Do(a),g=Oo(a),b=Do(h),_=Oo(h),x={a:B,A:H,b:lt,B:W,c:null,d:j1,e:j1,f:PM,g:XM,G:ZM,H:AM,I:MM,j:RM,L:J1,m:LM,M:GM,p:L,q:O,Q:ib,s:rb,S:FM,u:NM,U:kM,V:DM,w:OM,W:BM,x:null,X:null,y:UM,Y:WM,Z:VM,"%":eb},v={a:U,A:tt,b:Q,B:xt,c:null,d:Q1,e:Q1,f:zM,g:sR,G:oR,H:HM,I:KM,j:YM,L:q1,m:jM,M:JM,p:Ct,q,Q:ib,s:rb,S:$M,u:QM,U:qM,V:tR,w:eR,W:iR,x:null,X:null,y:rR,Y:nR,Z:aR,"%":eb},T={a:N,A:F,b:P,B:A,c:G,d:Y1,e:Y1,f:SM,g:K1,G:H1,H:z1,I:z1,j:_M,L:TM,m:xM,M:vM,p:R,q:bM,Q:EM,s:IM,S:wM,u:fM,U:pM,V:mM,w:dM,W:gM,x:D,X,y:K1,Y:H1,Z:yM,"%":CM};x.x=C(e,x),x.X=C(i,x),x.c=C(t,x),v.x=C(e,v),v.X=C(i,v),v.c=C(t,v);function C(Z,Y){return function(z){var k=[],ut=-1,gt=0,At=Z.length,Ft,Re,Ue;for(z instanceof Date||(z=new Date(+z));++ut<At;)Z.charCodeAt(ut)===37&&(k.push(Z.slice(gt,ut)),(Re=V1[Ft=Z.charAt(++ut)])!=null?Ft=Z.charAt(++ut):Re=Ft==="e"?" ":"0",(Ue=Y[Ft])&&(Ft=Ue(z,Re)),k.push(Ft),gt=ut+1);return k.push(Z.slice(gt,ut)),k.join("")}}function E(Z,Y){return function(z){var k=ko(1900,void 0,1),ut=I(k,Z,z+="",0),gt,At;if(ut!=z.length)return null;if("Q"in k)return new Date(k.Q);if("s"in k)return new Date(k.s*1e3+("L"in k?k.L:0));if(Y&&!("Z"in k)&&(k.Z=0),"p"in k&&(k.H=k.H%12+k.p*12),k.m===void 0&&(k.m="q"in k?k.q:0),"V"in k){if(k.V<1||k.V>53)return null;"w"in k||(k.w=1),"Z"in k?(gt=Kd(ko(k.y,0,1)),At=gt.getUTCDay(),gt=At>4||At===0?el.ceil(gt):el(gt),gt=Zd.offset(gt,(k.V-1)*7),k.y=gt.getUTCFullYear(),k.m=gt.getUTCMonth(),k.d=gt.getUTCDate()+(k.w+6)%7):(gt=Hd(ko(k.y,0,1)),At=gt.getDay(),gt=At>4||At===0?tl.ceil(gt):tl(gt),gt=No.offset(gt,(k.V-1)*7),k.y=gt.getFullYear(),k.m=gt.getMonth(),k.d=gt.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),At="Z"in k?Kd(ko(k.y,0,1)).getUTCDay():Hd(ko(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(At+5)%7:k.w+k.U*7-(At+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,Kd(k)):Hd(k)}}function I(Z,Y,z,k){for(var ut=0,gt=Y.length,At=z.length,Ft,Re;ut<gt;){if(k>=At)return-1;if(Ft=Y.charCodeAt(ut++),Ft===37){if(Ft=Y.charAt(ut++),Re=T[Ft in V1?Y.charAt(ut++):Ft],!Re||(k=Re(Z,z,k))<0)return-1}else if(Ft!=z.charCodeAt(k++))return-1}return k}function R(Z,Y,z){var k=l.exec(Y.slice(z));return k?(Z.p=c.get(k[0].toLowerCase()),z+k[0].length):-1}function N(Z,Y,z){var k=f.exec(Y.slice(z));return k?(Z.w=p.get(k[0].toLowerCase()),z+k[0].length):-1}function F(Z,Y,z){var k=u.exec(Y.slice(z));return k?(Z.w=d.get(k[0].toLowerCase()),z+k[0].length):-1}function P(Z,Y,z){var k=b.exec(Y.slice(z));return k?(Z.m=_.get(k[0].toLowerCase()),z+k[0].length):-1}function A(Z,Y,z){var k=m.exec(Y.slice(z));return k?(Z.m=g.get(k[0].toLowerCase()),z+k[0].length):-1}function G(Z,Y,z){return I(Z,t,Y,z)}function D(Z,Y,z){return I(Z,e,Y,z)}function X(Z,Y,z){return I(Z,i,Y,z)}function B(Z){return o[Z.getDay()]}function H(Z){return n[Z.getDay()]}function lt(Z){return h[Z.getMonth()]}function W(Z){return a[Z.getMonth()]}function L(Z){return s[+(Z.getHours()>=12)]}function O(Z){return 1+~~(Z.getMonth()/3)}function U(Z){return o[Z.getUTCDay()]}function tt(Z){return n[Z.getUTCDay()]}function Q(Z){return h[Z.getUTCMonth()]}function xt(Z){return a[Z.getUTCMonth()]}function Ct(Z){return s[+(Z.getUTCHours()>=12)]}function q(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var Y=C(Z+="",x);return Y.toString=function(){return Z},Y},parse:function(Z){var Y=E(Z+="",!1);return Y.toString=function(){return Z},Y},utcFormat:function(Z){var Y=C(Z+="",v);return Y.toString=function(){return Z},Y},utcParse:function(Z){var Y=E(Z+="",!0);return Y.toString=function(){return Z},Y}}}var V1={"-":"",_:" ",0:"0"},le=/^\s*\d+/,lM=/^%/,cM=/[\\^$*+?|[\]().{}]/g;function It(r,t,e){var i=r<0?"-":"",s=(i?-r:r)+"",n=s.length;return i+(n<e?new Array(e-n+1).join(t)+s:s)}function uM(r){return r.replace(cM,"\\$&")}function Do(r){return new RegExp("^(?:"+r.map(uM).join("|")+")","i")}function Oo(r){return new Map(r.map((t,e)=>[t.toLowerCase(),e]))}function dM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.w=+i[0],e+i[0].length):-1}function fM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.u=+i[0],e+i[0].length):-1}function pM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.U=+i[0],e+i[0].length):-1}function mM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.V=+i[0],e+i[0].length):-1}function gM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.W=+i[0],e+i[0].length):-1}function H1(r,t,e){var i=le.exec(t.slice(e,e+4));return i?(r.y=+i[0],e+i[0].length):-1}function K1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function yM(r,t,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return i?(r.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function bM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.q=i[0]*3-3,e+i[0].length):-1}function xM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.m=i[0]-1,e+i[0].length):-1}function Y1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.d=+i[0],e+i[0].length):-1}function _M(r,t,e){var i=le.exec(t.slice(e,e+3));return i?(r.m=0,r.d=+i[0],e+i[0].length):-1}function z1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.H=+i[0],e+i[0].length):-1}function vM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.M=+i[0],e+i[0].length):-1}function wM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.S=+i[0],e+i[0].length):-1}function TM(r,t,e){var i=le.exec(t.slice(e,e+3));return i?(r.L=+i[0],e+i[0].length):-1}function SM(r,t,e){var i=le.exec(t.slice(e,e+6));return i?(r.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function CM(r,t,e){var i=lM.exec(t.slice(e,e+1));return i?e+i[0].length:-1}function EM(r,t,e){var i=le.exec(t.slice(e));return i?(r.Q=+i[0],e+i[0].length):-1}function IM(r,t,e){var i=le.exec(t.slice(e));return i?(r.s=+i[0],e+i[0].length):-1}function j1(r,t){return It(r.getDate(),t,2)}function AM(r,t){return It(r.getHours(),t,2)}function MM(r,t){return It(r.getHours()%12||12,t,2)}function RM(r,t){return It(1+No.count(ur(r),r),t,3)}function J1(r,t){return It(r.getMilliseconds(),t,3)}function PM(r,t){return J1(r,t)+"000"}function LM(r,t){return It(r.getMonth()+1,t,2)}function GM(r,t){return It(r.getMinutes(),t,2)}function FM(r,t){return It(r.getSeconds(),t,2)}function NM(r){var t=r.getDay();return t===0?7:t}function kM(r,t){return It(qh.count(ur(r)-1,r),t,2)}function $1(r){var t=r.getDay();return t>=4||t===0?In(r):In.ceil(r)}function DM(r,t){return r=$1(r),It(In.count(ur(r),r)+(ur(r).getDay()===4),t,2)}function OM(r){return r.getDay()}function BM(r,t){return It(tl.count(ur(r)-1,r),t,2)}function UM(r,t){return It(r.getFullYear()%100,t,2)}function XM(r,t){return r=$1(r),It(r.getFullYear()%100,t,2)}function WM(r,t){return It(r.getFullYear()%1e4,t,4)}function ZM(r,t){var e=r.getDay();return r=e>=4||e===0?In(r):In.ceil(r),It(r.getFullYear()%1e4,t,4)}function VM(r){var t=r.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+It(t/60|0,"0",2)+It(t%60,"0",2)}function Q1(r,t){return It(r.getUTCDate(),t,2)}function HM(r,t){return It(r.getUTCHours(),t,2)}function KM(r,t){return It(r.getUTCHours()%12||12,t,2)}function YM(r,t){return It(1+Zd.count(Ms(r),r),t,3)}function q1(r,t){return It(r.getUTCMilliseconds(),t,3)}function zM(r,t){return q1(r,t)+"000"}function jM(r,t){return It(r.getUTCMonth()+1,t,2)}function JM(r,t){return It(r.getUTCMinutes(),t,2)}function $M(r,t){return It(r.getUTCSeconds(),t,2)}function QM(r){var t=r.getUTCDay();return t===0?7:t}function qM(r,t){return It(Z1.count(Ms(r)-1,r),t,2)}function tb(r){var t=r.getUTCDay();return t>=4||t===0?An(r):An.ceil(r)}function tR(r,t){return r=tb(r),It(An.count(Ms(r),r)+(Ms(r).getUTCDay()===4),t,2)}function eR(r){return r.getUTCDay()}function iR(r,t){return It(el.count(Ms(r)-1,r),t,2)}function rR(r,t){return It(r.getUTCFullYear()%100,t,2)}function sR(r,t){return r=tb(r),It(r.getUTCFullYear()%100,t,2)}function nR(r,t){return It(r.getUTCFullYear()%1e4,t,4)}function oR(r,t){var e=r.getUTCDay();return r=e>=4||e===0?An(r):An.ceil(r),It(r.getUTCFullYear()%1e4,t,4)}function aR(){return"+0000"}function eb(){return"%"}function ib(r){return+r}function rb(r){return Math.floor(+r/1e3)}var Mn,sb;hR({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hR(r){return Mn=hM(r),sb=Mn.format,Mn.parse,Mn.utcFormat,Mn.utcParse,Mn}function lR(r){return new Date(r)}function cR(r){return r instanceof Date?+r:+new Date(+r)}function nb(r,t,e,i,s,n,o,a,h,l){var c=U1(),u=c.invert,d=c.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),b=l("%a %d"),_=l("%b %d"),x=l("%B"),v=l("%Y");function T(C){return(h(C)<C?f:a(C)<C?p:o(C)<C?m:n(C)<C?g:i(C)<C?s(C)<C?b:_:e(C)<C?x:v)(C)}return c.invert=function(C){return new Date(u(C))},c.domain=function(C){return arguments.length?d(Array.from(C,cR)):d().map(lR)},c.ticks=function(C){var E=d();return r(E[0],E[E.length-1],C??10)},c.tickFormat=function(C,E){return E==null?T:l(E)},c.nice=function(C){var E=d();return(!C||typeof C.range!="function")&&(C=t(E[0],E[E.length-1],C??10)),C?d(JA(E,C)):c},c.copy=function(){return B1(c,nb(r,t,e,i,s,n,o,a,h,l))},c}function uR(){return D1.apply(nb(oM,aM,ur,Vd,qh,No,Wd,Xd,En,sb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Bo(r,t,e){this.k=r,this.x=t,this.y=e}Bo.prototype={constructor:Bo,scale:function(r){return r===1?this:new Bo(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new Bo(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Bo.prototype;function ob(r){return r.mode==="temporal"||r.mode==="left-aligned"?dR(r):fR(r)}function dR({domain:r,range:t}){return uR().domain(r).range(t)}function fR({domain:r,range:t}){return X1().domain(r).range(t)}function Yd(r){return{mode:st.horizontal,range:$E(),domain:QE(r)}}function pR(){return{mode:st.vertical}}let Rn=null;async function mR(){const r=await Bi();ab(r.start_time),$.on("layoutSettingsUpdated",()=>ab(r.start_time))}function gR(){Rn=null}async function Qe(){return Rn||await Ge("scaleCreated")}async function ab(r){await Qt();const t=Rn?"scaleUpdated":"scaleCreated",e=Yd(r);Rn=ob(e),$.emit(t,Rn)}function Ur(r){return"getIds"in r}async function hb({items:r,createCluster:t}){const e=[...r.values()].sort((o,a)=>o.element.x-a.element.x);async function i(o){let a,h=null,l=null;for(let c=o??0;c<e.length;c++){const u=e[c],d=u.element.x;if(u.element.visible=!0,h!==null&&a&&d<a){l=c;break}h=c,a=d+u.element.width}if(l!==null&&h!==null){const c=e[h],u=e[l];c.element.visible=!1,u.element.visible=!1;const d=await s(c,u);d&&(e.splice(h,1,d),e.splice(l,1)),i(h)}}async function s(o,a){const h=o.getDate(),l=a.getDate(),c=Ur(o)?o.getIds():[o.getId()],u=Ur(a)?a.getIds():[a.getId()];if(!h||!l)return console.error("flowRunArtifacts: visible item is missing date"),null;let d;Ur(o)?d=o:Ur(a)?d=a:d=await t();const f=[...c,...u],p=n(f);return await d.render({ids:f,date:p}),d}function n(o){const a=o.reduce((c,u)=>{const d=r.get(u),f=d==null?void 0:d.getDate();return f&&c.push(f.getTime()),c},[]),h=Math.min(...a),l=Math.max(...a);return new Date((h+l)/2)}await i()}async function lb(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Qt();let n=await Qe();const o=await h();o.element.on("click",c=>{c.stopPropagation();const{element:u}=o,d={x:u.position.x,y:u.position.y,width:u.width,height:u.height},f=Ur(o)?{kind:"events",ids:o.getIds(),occurred:o.getDate(),position:d}:{kind:"event",id:o.getId(),occurred:o.getDate(),position:d};Di(f)}),$.on("scaleUpdated",c=>{n=c,l()}),$.on("viewportMoved",()=>l());async function a(c){await o.render(c),l()}async function h(){return r.type==="event"?await m1(r.event):await g1()}function l(){const c=o.getDate();if(!c||s.disableEvents||!st.isTemporal())return;const{element:u}=o,f=n(c)*e.scale._x+e.worldTransform.tx-u.width/2,p=t.screen.height-u.height-i.styles.eventBottomMargin;u.position.set(f,p)}return{...o,render:a}}async function cb(r){const t=await qt(),e=await Qt();let i=await Qe();const s=await o();s.element.on("click",h=>{h.stopPropagation();const{element:l}=s,c=l.getGlobalPosition(),u={x:c.x,y:c.y,width:l.width*t.scale.x,height:l.height*t.scale.y},d=Ur(s)?{kind:"events",ids:s.getIds(),occurred:s.getDate(),position:u}:{kind:"event",id:s.getId(),occurred:s.getDate(),position:u};Di(d)}),$.on("scaleUpdated",h=>{i=h,a()});async function n(h){await s.render(h),a()}async function o(){return r.type==="event"?await m1(r.event):await g1()}function a(){const h=s.getDate(),{parentStartDate:l}=r;if(!h||e.disableEvents||!st.isTemporal()||!l)return;const{element:c}=s,d=i(h)-i(l)-c.width/2,f=-c.height;c.position.set(d,f)}return{...s,render:n}}async function ub({isRoot:r,parentStartDate:t}={}){const e=await Qt(),i=new Map,s=new Map,n=[];let o=[];const a=new Tt;let h=null;$.on("scaleUpdated",()=>u());async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render();if(s.has(p.id))return await s.get(p.id);const m=(async()=>{const g=r?await lb({type:"event",event:p}):await cb({type:"event",event:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render()}function u(){e.disableEvents||!st.isTemporal()||d()}const d=d1(async()=>{o=[...n],await hb({items:i,createCluster:f});for(const p of o)p.render()},Pl);async function f(){if(o.length>0)return o.pop();const p=r?await lb({type:"cluster"}):await cb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}let Uo=null,Pn=null;async function yR(){const r=await Jt(),t=await Mt(),e=await Qt(),i=await Bi(),{element:s,render:n,update:o}=await ub({isRoot:!0});s.zIndex=np;async function a(l){if(!st.isTemporal()||e.disableEvents){r.stage.removeChild(s);return}r.stage.addChild(s),await n(l)}const h=await o1(()=>({nodeId:t.runId,since:i.start_time,until:i.end_time??new Date}),l=>{const c=Pn?"eventDataUpdated":"eventDataCreated";Pn=l,$.emit(c,Pn),a(l)});$.on("configUpdated",()=>a()),$.on("viewportMoved",()=>o()),$.on("layoutSettingsUpdated",()=>a()),Uo=h.stop,h.start()}function bR(){Uo==null||Uo(),Uo=null,Pn=null}async function xR(){return Pn||await Ge("eventDataCreated")}async function db(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Qt(),n=await xR();let o=await Qe(),a=n&&n.length>0;const h=await c();h.element.on("click",d=>{d.stopPropagation();const{element:f}=h,p=f.getGlobalPosition(),m={x:p.x,y:p.y,width:f.width,height:f.height},g=Ur(h)?{kind:"artifacts",ids:h.getIds(),position:m}:{kind:"artifact",id:h.getId()};Di(g)}),$.on("scaleUpdated",d=>{o=d,u()}),$.on("viewportMoved",()=>u()),$.on("eventDataCreated",d=>{a=d.length>0,u()}),$.on("eventDataUpdated",d=>{a=d.length>0,u()});async function l(d){if(n1(h)){if(r.type!=="artifact")throw new Error(`ArtifactFactory attempted to render a ${r.type}`);await h.render(r.artifact)}else await h.render(d);u()}async function c(){return r.type==="artifact"?await Td(r.artifact,{cullAtZoomThreshold:!1}):await f1()}function u(){const d=h.getDate();if(!d||!st.isTemporal()||s.disableArtifacts)return;const f=h.getSelected(),{element:p}=h,{eventTargetSize:m,flowStateSelectedBarHeight:g}=i.styles;let b=0;if(f){const{selectedBorderOffset:C,selectedBorderWidth:E}=i.styles;b=C+E*2}const x=o(d)*e.scale._x+e.worldTransform.tx-(p.width-b)/2,v=a&&!s.disableEvents?m:g,T=t.screen.height-(p.height-b)-v;p.position.set(x,T)}return{...h,render:l}}async function fb(r){const t=await qt(),e=await Mt(),i=await Qt();let s=await Qe();const n=await a();n.element.on("click",l=>{l.stopPropagation();const{element:c}=n,u=c.getGlobalPosition(),d={x:u.x,y:u.y,width:c.width*t.scale.x,height:c.height*t.scale.y},f=Ur(n)?{kind:"artifacts",ids:n.getIds(),position:d}:{kind:"artifact",id:n.getId()};Di(f)}),$.on("scaleUpdated",l=>{s=l,h()});async function o(l){if(n1(n)){if(r.type!=="artifact")throw new Error(`ArtifactFactory attempted to render a ${r.type}`);await n.render(r.artifact)}else await n.render(l);h()}async function a(){return r.type==="artifact"?await Td(r.artifact):await f1()}function h(){const l=n.getDate(),{parentStartDate:c}=r;if(!l||!st.isTemporal()||i.disableArtifacts||!c)return;const u=n.getSelected(),{element:d}=n;let f=0;if(u){const{selectedBorderOffset:b,selectedBorderWidth:_}=e.styles;f=b+_*2}const m=s(l)-s(c)-(d.width-f)/2,g=-(d.height-f);d.position.set(m,g)}return{...n,render:o}}async function pb({isRoot:r,parentStartDate:t}={}){const e=await Qt(),i=new Map,s=new Map,n=[];let o=[];const a=new Tt;let h=null;async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render(p);s.has(p.id)&&await s.get(p.id);const m=(async()=>{const g=r?await db({type:"artifact",artifact:p}):await fb({type:"artifact",artifact:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render(p)}function u(){if(!(e.disableArtifacts||!st.isTemporal())){if(!st.isTemporal()){a.visible=!1;return}a.visible=!0,a.position.x=0,d()}}const d=d1(async()=>{o=[...n],await hb({items:i,createCluster:f});for(const p of o)p.render()},Pl);async function f(){if(o.length>0)return o.pop();const p=r?await db({type:"cluster"}):await fb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}async function _R(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Bi();let n=await Qe();const o=new Tt,a=await or(),h=await or();let l=null,c=!1,u=!1;t.stage.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{c=!0,d()}),a.on("mouseleave",()=>{c=!1,d()}),a.on("click",()=>{const x={x:a.position.x,y:a.position.y,width:a.width,height:a.height};Di({...r,kind:"state",position:x})}),$.on("viewportMoved",()=>d()),$.on("scaleUpdated",x=>{n=x,d()}),$.on("itemSelected",()=>{const x=ar({kind:"state",...r});x!==u&&(u=x,c=!1,d())}),r.type==="RUNNING"&&!s.end_time&&g();function d(x){const{end:v}=x??{};if(v&&(l=v),s.end_time&&b(),!st.isTemporal()){h.visible=!1,o.visible=!1;return}const T=f();p(T),m(T),h.visible=!0,o.visible=!0}function f(){const{background:x="#fff"}=i.styles.state(r),v=Math.max(n(r.timestamp)*e.scale._x+e.worldTransform.tx,0);let T=0;return r.type==="RUNNING"&&!s.end_time?T=n(new Date)*e.scale._x+e.worldTransform.tx-v:l?T=n(l)*e.scale._x+e.worldTransform.tx-v:T=t.screen.width-v,{x:v,width:Math.max(T,0),background:x}}function p({x,width:v,background:T}){const{flowStateBarHeight:C,flowStateSelectedBarHeight:E}=i.styles,I=c||u?E:C;a.x=x,a.y=t.screen.height-I,a.width=v,a.height=I,a.tint=T}function m({x,width:v,background:T}){if(r.type==="RUNNING"){h.visible=!1;return}const{flowStateBarHeight:C,flowStateAreaAlpha:E}=i.styles;h.x=x,h.y=0,h.width=v,h.height=t.screen.height-C,h.tint=T,h.alpha=E}function g(){t.ticker.add(_)}function b(){t.ticker.remove(_)}function _(){d()}return{element:o,render:d}}function vR(r){return"isNodesFlowRunStateFactory"in r}async function wR(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Bi();let n=await Qe();const o=new Tt,a=await or(),h=await or();let l=null,c=null,u=0,d=0,f=!1,p=!1;o.visible=!1,o.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{f=!0,m()}),a.on("mouseleave",()=>{f=!1,m()}),a.on("click",C=>{C.stopPropagation();const E=a.getGlobalPosition(),I={x:E.x,y:E.y,width:a.width*e.scale.x,height:a.height*e.scale.y};Di({...r,kind:"state",position:I})}),h.eventMode="none",h.cursor="default",$.on("scaleUpdated",C=>{n=C,m()}),$.on("itemSelected",()=>{const C=ar({kind:"state",...r});C!==p&&(p=C,f=!1,m())}),r.type==="RUNNING"&&!s.end_time&&x();function m(C){const{end:E,parentStartDate:I,width:R,height:N}=C??{};if(E&&(l=E),I&&(c=I),R&&(u=R),N&&(d=N),s.end_time&&v(),!st.isTemporal()){o.visible=!1;return}if(!c||u<=0){o.visible=!1;return}const F=g();if(F.width<=0){o.visible=!1;return}b(F),_(F),o.visible=!0}function g(){const{background:C="#fff"}=i.styles.state(r);if(!c)return{x:0,width:0,background:C};const E=n(c);let I=n(r.timestamp)-E;if(I>=u)return{x:u,width:0,background:C};I<0&&(I=0);let R=n(l??new Date)-E;R>u&&(R=u);const N=Math.max(R-I,0);return{x:I,width:N,background:C}}function b({x:C,width:E,background:I}){const{flowStateBarHeight:R,flowStateSelectedBarHeight:N}=i.styles,F=f||p?N:R;a.x=C,a.y=d-F,a.width=E,a.height=F,a.tint=I}function _({x:C,width:E,background:I}){const{flowStateBarHeight:R,flowStateAreaAlpha:N,nodeHeight:F}=i.styles,P=F/2;h.x=C,h.y=P,h.width=E,h.height=d-R-P,h.tint=I,h.alpha=N}function x(){t.ticker.add(T)}function v(){t.ticker.remove(T)}function T(){m()}return{element:o,render:m,isNodesFlowRunStateFactory:!0}}function mb({isRoot:r}={}){const t=new Tt,e=new Map,i=new Map;let s=null;async function n(a,h){if(a&&(s=a),!s)return;const l=[];for(let c=0;c<s.length;c++)l.push(o(s[c],c,h));await Promise.all(l)}async function o(a,h,l){const c=s&&s.length>=h+1&&s[h+1],u=c?c.timestamp:void 0;let d;if(i.has(a.id)&&await i.get(a.id),e.has(a.id))d=e.get(a.id);else{const f=(async()=>{const p=r?await _R(a):await wR(a);e.set(a.id,p),t.addChild(p.element)})();i.set(a.id,f),await f,i.delete(a.id),d=e.get(a.id)}vR(d)?await d.render({end:u,...l}):await d.render(u?{end:u}:void 0)}return{element:t,render:n}}class gb extends Tt{updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t)this.children[t].updateTransform()}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(const t of this.children)if(t.calculateBounds(),t._mask){const e=t._mask.isMaskData?t._mask.maskObject:t._mask;e?(e.calculateBounds(),this._bounds.addBoundsMask(t._bounds,e._bounds)):this._bounds.addBounds(t._bounds)}else t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds);this._bounds.updateID=this._boundsID}}async function TR(r){const t=new gb,e=await Mt(),i=await Qt(),{element:s,render:n}=await h1(),{element:o,render:a}=await Oh(),{element:h,render:l}=await a1(),{element:c,render:u}=await kh(),{element:d,render:f,getSize:p,stopWorker:m}=await zd(),{element:g,render:b}=await mb(),{element:_,render:x,update:v}=await ub({parentStartDate:r.start_time}),{element:T,render:C,update:E}=await pb({parentStartDate:r.start_time});let I=!1,R=!1,N=r,F=!1;t.sortableChildren=!0,c.zIndex=Ll,s.zIndex=Fl,o.zIndex=Kn,h.zIndex=Kn,d.zIndex=Gl,_.zIndex=hp,g.zIndex=lp,T.zIndex=cp,c.eventMode="none",c.cursor="default";const{start:P,stop:A}=await Rg(N.id,q=>{R=!!q.artifacts&&q.artifacts.length>0,f(q),lt(q.states),L(q.artifacts),H()}),{start:G,stop:D}=await o1(()=>({nodeId:N.id,since:N.start_time,until:N.end_time??new Date}),q=>{I=q.length>0,W(q)});t.addChild(s),t.addChild(o),t.addChild(h),h.on("click",q=>{q.stopPropagation(),B()}),d.position={x:0,y:e.styles.nodeHeight+e.styles.nodesPadding},d.on("rendered",()=>{Zo(),xt()});async function X(q){return N=q,await n(q),await tt(),await Q(),F&&(await lt(),await W(),await L(),await H()),t}async function B(){F?await U():await O()}async function H(){const{background:q="#fff"}=e.styles.node(N),{width:Z,height:Y}=p(),{height:z}=Ct(),{nodeBorderRadius:k}=e.styles,ut=2;c.position={x:-ut,y:-ut};const gt=st.isTemporal()?z+ut*2:Y+ut*2;await u({width:Z+ut*2,height:gt,stroke:ut,radius:[k,k,0,0],color:q})}async function lt(q){const{height:Z}=Ct(),{width:Y}=s;await b(q??void 0,{parentStartDate:N.start_time,width:Y,height:Z})}async function W(q){if(!F||!st.isTemporal()||i.disableEvents){t.removeChild(_);return}t.addChild(_);const{height:Z}=Ct();if(_.position={x:0,y:Z-e.styles.eventBottomMargin},q){await x(q);return}await v()}async function L(q){if(!F||!st.isTemporal()||i.disableArtifacts){t.removeChild(T);return}t.addChild(T);const{eventTargetSize:Z,flowStateSelectedBarHeight:Y}=e.styles,{height:z}=Ct(),k=z-(I&&!i.disableEvents?Z:Y);if(T.position={x:0,y:k},q){await C(q);return}await E()}async function O(){F=!0,t.addChild(g),t.addChild(d),t.addChild(c),await Promise.all([P(),G(),X(N)]),xt()}async function U(){F=!1,t.removeChild(g),t.removeChild(d),t.removeChild(c),t.removeChild(_),t.removeChild(T),m(),await Promise.all([A(),D(),X(N)]),xt()}async function tt(){const q=e.styles.nodeToggleSize,Z=e.styles.nodeHeight-q,Y=s.width>q,z=await l({inside:Y,isOpen:F});return z.x=Y?Z/2:s.width+e.styles.nodePadding,z.y=Z/2,z}async function Q(){const q=await a(N.label),Z=e.styles.colorMode==="dark"?e.styles.textDefault:e.styles.textInverse,Y=e.styles.nodePadding,z=h.x+h.width+Y,k=s.width+Y,ut=s.width>z+q.width+Y,gt=e.styles.nodeHeight/2-q.height/2,At=ut?z:Math.max(k,z);return q.position={x:At,y:gt},q.tint=ut?Z:e.styles.textDefault,q}function xt(){F&&(lt(),W(),L(),H());const q=Ct();t.emit("resized",q)}function Ct(){const q=p(),{nodeHeight:Z,nodesPadding:Y,eventTargetSize:z,eventBottomMargin:k,artifactPaddingY:ut,artifactIconSize:gt}=e.styles,Ft=R&&st.isTemporal()&&!i.disableArtifacts?gt+ut*2:0,Ue=I&&st.isTemporal()&&!i.disableEvents?z+k:0,Ho=F?q.height+Ft+Ue+Y*2:0,Wr=F?q.width:0;return{height:Z+Ho,width:Math.max(Wr,t.width)}}return{kind:"flow-run",element:t,bar:s,render:X}}async function SR(r,t){const e=await Mt(),i=new gb,{element:s,render:n}=await Oh(),{element:o,render:a}=await kh(),{element:h,render:l}=await h1(),{element:c,render:u}=await a1(),{element:d,render:f,getSize:p,stopWorker:m}=await zd();i.addChild(h),i.addChild(s);let g=!1,b=r,_=t;i.sortableChildren=!0,o.zIndex=Ll,h.zIndex=Fl,s.zIndex=Kn,c.zIndex=Kn,d.zIndex=Gl,o.eventMode="none",o.cursor="default",d.position={x:0,y:e.styles.nodeHeight+e.styles.nodesPadding},d.on("rendered",()=>{Zo(),F()}),c.on("click",P=>{P.stopPropagation(),E()});async function x(P,A){return b=P,_=A,A&&i.addChild(c),await l(P),A&&await v(),g&&(A&&f(A),await C()),await T(),i}async function v(){const P=e.styles.nodeToggleSize,A=e.styles.nodeHeight-P,G=h.width>P,D=await u({inside:G,isOpen:g});return D.x=G?A/2:h.width+e.styles.nodePadding,D.y=A/2,D}async function T(){const P=await n(b.label),A=e.styles.colorMode==="dark"?e.styles.textDefault:e.styles.textInverse,G=e.styles.nodePadding,D=c.x+c.width+G,X=h.width+G,B=h.width>D+P.width+G,H=e.styles.nodeHeight/2-P.height/2,lt=B?D:Math.max(X,D);return P.position={x:lt,y:H},P.tint=B?A:e.styles.textDefault,P}async function C(){const{background:P="#fff"}=e.styles.node(b),{width:A,height:G}=p(),{height:D}=N(),{nodeBorderRadius:X}=e.styles,B=2;o.position={x:-B,y:-B};const H=st.isTemporal()?D+B*2:G+B*2;await a({width:A+B*2,height:H,stroke:B,radius:[X,X,0,0],color:P})}async function E(){g?await R():await I()}async function I(){if(g=!0,i.addChild(d),i.addChild(o),!_)throw new Error("Attempted to open without nested graph data");await Promise.all([f(_),x(b,_)]),F()}async function R(){g=!1,i.removeChild(d),i.removeChild(o),m(),await x(b,_),F()}function N(){const P=p(),{nodeHeight:A,nodesPadding:G}=e.styles,D=g?P.height+G*2:0,X=g?P.width:0;return{height:A+D,width:Math.max(X,i.width)}}function F(){g&&C();const P=N();i.emit("resized",P)}return{kind:"task-run",element:i,render:x,bar:h}}async function CR(r,t){const e=await Mt(),i=await Jt(),s=await wb(),n=await Qt();let o=null;const a=new Map,{animate:h}=await jy(),{element:l,render:c,bar:u}=await R(r,t);let d=r,f=t,p=null,m=!1,g=!1;s.add(l),l.eventMode="static",l.cursor="pointer",l.name=jf,l.on("click",P=>{P.stopPropagation(),Di({kind:d.kind,id:d.id})}),d.end_time||C(),$.on("itemSelected",()=>{const P=ar({kind:d.kind,id:d.id});P!==m&&(m=P,c(d,f))});async function b(P,A){d=P,f=A;const G=N(P);return G===p||(p=G,await Promise.all([c(P,A),_(P.artifacts)]),P.end_time&&E()),l}async function _(P){if(!P||(v(),n.disableArtifacts||!st.isTemporal()))return;const A=[];for(const G of P)A.push(x(G));await Promise.all(A),T()}async function x(P){if(a.has(P.id))return a.get(P.id).render(P);const A=await Td(P,{enableLocalClickHandling:!0});return a.set(P.id,A),o.addChild(A.element),A.render(P)}function v(){if(st.isTemporal()&&!n.disableArtifacts){o||(o=new Tt),l.addChild(o);return}o&&l.removeChild(o)}function T(){if(!o)return;const{artifactsGap:P,artifactsNodeOverlap:A}=e.styles;let G=0;for(const D of a.values())D.element.position.x=G,G+=D.element.width+P;o.position.y=-o.height+A,o.width<u.width&&(o.position.x=u.width-o.width)}function C(){i.ticker.add(I)}function E(){i.ticker.remove(I)}function I(){b(d,f)}async function R(P,A){const{kind:G}=P;switch(G){case"task-run":return await SR(P,A);case"flow-run":return await TR(P);default:const D=G;throw new Error(`switch does not have case for value: ${D}`)}}function N(P){var B;const A=P.end_time??new Date,G=(B=P.artifacts)==null?void 0:B.map(H=>H.type==="progress"?`${H.id}-${H.data}`:H.id).join("|"),D=!!f;return[P.state_type,A.getTime(),st.horizontal,st.horizontalScaleMultiplier,e.styles.colorMode,n.disableArtifacts||G,D].join("-")}function F({x:P,y:A}){h(l,{x:P,y:A},!g),g=!0}return{element:l,render:b,bar:u,setPosition:F}}function yb({gap:r=0,minimum:t=0}={}){const e=new Map;function i(c){const u=e.get(c)??[];return Math.max(...u.values(),Uh(t))+Uh(r)}function s(c){let u=0;for(let d=0;d<c;d++)u+=i(d);return u}function n(c){return s(c+1)-Uh(r)}function o({axis:c,nodeId:u,offset:d}){const f=e.get(c)??new Map;f.set(u,d),e.set(c,f)}function a({axis:c,nodeId:u}){let d,f;for(const[p,m]of e.entries())if(m.has(u)){d=p,f=m.get(u);break}d===c||d===void 0||f===void 0||(h({axis:d,nodeId:u}),o({axis:c,nodeId:u,offset:f}))}function h({axis:c,nodeId:u}){var d;(d=e.get(c))==null||d.delete(u)}function l(){e.clear()}return{getOffset:i,getTotalOffset:s,getTotalValue:n,setOffset:o,updateNodeAxis:a,removeOffset:h,clear:l}}function ER(r){throw new Error(`switch does not have case for value: ${r}`)}const bb="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEtlKG4pe3Rocm93IG5ldyBFcnJvcihgc3dpdGNoIGRvZXMgbm90IGhhdmUgY2FzZSBmb3IgdmFsdWU6ICR7bn1gKX1mdW5jdGlvbiBDbihuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjpuPGU/LTE6bj5lPzE6bj49ZT8wOk5hTn1mdW5jdGlvbiBudChuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjplPG4/LTE6ZT5uPzE6ZT49bj8wOk5hTn1mdW5jdGlvbiBSbihuKXtsZXQgZSx0LHI7bi5sZW5ndGghPT0yPyhlPUNuLHQ9KHUsbCk9PkNuKG4odSksbCkscj0odSxsKT0+bih1KS1sKTooZT1uPT09Q258fG49PT1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4uLmYseTpnLHJvdzpnfSl9RG8oe3R5cGU6ImxheW91dCIsbGF5b3V0OnttYXhSb3c6aSxtYXhDb2x1bW46YSxwb3NpdGlvbnM6b319KX19KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1ydW5HcmFwaC53b3JrZXItQzRjMjBKZ3UuanMubWFwCg==",IR=r=>Uint8Array.from(atob(r),t=>t.charCodeAt(0)),xb=typeof self<"u"&&self.Blob&&new Blob([IR(bb)],{type:"text/javascript;charset=utf-8"});function AR(r){let t;try{if(t=xb&&(self.URL||self.webkitURL).createObjectURL(xb),!t)throw"";const e=new Worker(t,{name:r==null?void 0:r.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;base64,"+bb,{name:r==null?void 0:r.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}function MR(r){const t=new AR;return t.onmessage=r,t}async function zd(){const r=new Map,t=new Map,e=new Map,i=new Tt,s=new Tt,n=await Mt();let o=null;const a=yb({gap:()=>n.styles.rowGap,minimum:()=>n.styles.nodeHeight}),h=yb({gap:()=>n.styles.columnGap,minimum:()=>gd()});let l=null,c=null;i.name=Sl,$.on("layoutUpdated",()=>{a.clear(),h.clear()}),$.on("layoutSettingsUpdated",()=>{c&&i.parent&&u(c),D()}),$.on("itemSelected",()=>{D()});async function u(L){d(),c=L,l=null,await Promise.all([p(L),g(L)]),_(L)}function d(){o||(o=MR(A))}function f(){o&&(o.terminate(),o=null)}async function p(L){const O=[];for(const U of L.nodes.values())O.push(m(U));await Promise.all(O)}async function m(L){const{render:O}=await T(L),U=E(L.id);return await O(L,U)}async function g(L){if((await Qt()).disableEdges){i.removeChild(s);return}i.addChildAt(s,0);const U=[];for(const[tt,{children:Q}]of L.nodes)for(const{id:xt}of Q)U.push(b(tt,xt));await Promise.all(U)}async function b(L,O){const U=`${L}_${O}`;if(e.has(U))return;const tt=await lI();e.has(U)||(e.set(U,tt),s.addChild(tt.element))}function _(L){if(!o)throw new Error("Layout worker not initialized");const O=new Map;for(const[U,{element:tt}]of t)O.set(U,tt.width);o.postMessage({type:"layout",data:L,widths:O,horizontalSettings:Yd(L.start_time),verticalSettings:pR()})}function x(){if(l)for(const[L,O]of e){const[U,tt]=L.split("_"),Q=l.positions.get(U),xt=l.positions.get(tt),Ct=t.get(U);if(!Q||!xt){console.warn(`Could not find edge in layout: Skipping ${L}`);continue}if(!Ct){console.warn(`Could not find parent node in nodes: Skipping ${U}`);continue}const q=Ct.bar.width,Z=I(Q),Y={x:Z.x+q,y:Z.y+n.styles.nodeHeight/2},z=I(xt),k={x:z.x-Y.x,y:z.y-Y.y+n.styles.nodeHeight/2};O.setPosition(Y,k)}}function v(){if(l){for(const[L,O]of t){const U=l.positions.get(L);if(!U){console.warn(`Could not find node in layout: Skipping ${L}`);continue}const tt=I(U);O.setPosition(tt),a.updateNodeAxis({nodeId:L,axis:U.y}),h.updateNodeAxis({nodeId:L,axis:U.column})}x(),i.emit("rendered"),i.emit("resized",P())}}async function T(L){const O=r.get(L.id);if(O)return O;const U=E(L.id),tt=CR(L,U);r.set(L.id,tt);const Q=await tt;return Q.element.on("resized",xt=>C(L.id,xt)),i.addChild(Q.element),t.set(L.id,Q),Q}function C(L,O){if(!l)return;const U=t.get(L),tt=l.positions.get(L);!U||!tt||(a.setOffset({nodeId:L,axis:tt.y,offset:O.height}),h.setOffset({nodeId:L,axis:tt.column,offset:O.width}),v())}function E(L){var O;return(O=c==null?void 0:c.nested_task_run_graphs)==null?void 0:O.get(L)}function I(L){const O=a.getTotalOffset(L.y);return{x:R(L),y:O}}function R(L){return st.isDependency()?h.getTotalOffset(L.column):L.x}function N(){return l?a.getTotalValue(l.maxRow):0}function F(){if(!l||!c)return 0;if(st.isDependency())return h.getTotalValue(l.maxColumn);const L=Yd(c.start_time),O=ob(L),U=O(c.end_time??new Date),tt=O(c.start_time);return U-tt}function P(){return{width:F(),height:N()}}function A({data:L}){const{type:O}=L;switch(O){case"layout":G(L);return;default:ER(O)}}function G(L){l=L.layout,v()}async function D(){const L=await Qt(),O=PI();if(L.disableEdges||!O||!(c!=null&&c.nodes.has(O.id))){X([]);return}const U=lt(O.id);X(U)}function X(L){B(L),H(L)}function B(L){for(const[O,{element:U}]of t){if(L.length===0||L.includes(O)){U.alpha=1;continue}U.alpha=n.styles.nodeUnselectedAlpha}}function H(L){for(const[O,{element:U}]of e){const[tt,Q]=O.split("_");if(L.length===0||L.includes(tt)&&L.includes(Q)){U.alpha=1;continue}U.alpha=n.styles.nodeUnselectedAlpha}}function lt(L){const O=W(L,"parents"),U=W(L,"children");return[L,...O,...U]}function W(L,O){const U=c==null?void 0:c.nodes.get(L);if(!U)return[];const tt=[];for(const{id:Q}of U[O])tt.push(Q),tt.push(...W(Q,O));return tt}return{element:i,stopWorker:f,getSize:P,render:u}}let Xo=null,Xr=null,Rs=null;async function RR(){const r=await qt(),t=await Mt(),{element:e,render:i}=await zd();r.addChild(e),e.alpha=0;const s=await Rg(t.runId,async n=>{const o=Xr?"runDataUpdated":"runDataCreated";Xr=n,$.emit(o,Xr),await Qt(),i(n)});$.on("configUpdated",()=>{Xr&&i(Xr)}),Rs=e,Xo=s.stop,Rs.once("rendered",()=>LR()),$.on("layoutUpdated",()=>GR()),s.start()}function PR(){Xo==null||Xo(),Xo=null,Rs=null,Xr=null}async function Bi(){return Xr||await Ge("runDataCreated")}function LR(){Jd(),_e.shared.addOnce(()=>{Rs&&(Rs.alpha=1)})}async function GR(){if(!Rs)return;const r=await Mt();Rs.once("rendered",()=>{setTimeout(()=>{Jd({animate:!0})},r.animationDuration)})}let Me=null,jd=null;async function FR(){const r=await Jt(),t=await Iu();Me=new IC({screenHeight:t.clientHeight,screenWidth:t.clientWidth,events:r.renderer.events,passiveWheel:!1}),Me.zIndex=sp,Me.drag().pinch().wheel({trackpadPinch:!0}).decelerate({friction:.9}).clampZoom({minWidth:t.clientWidth/2}),Me.on("moved",()=>{$.emit("viewportMoved",null)}).on("moved-end",()=>{$.emit("viewportMoved",null)}),r.stage.addChild(Me),$.emit("viewportCreated",Me),$.on("applicationResized",XR),$.on("scaleUpdated",()=>Wo()),BR()}function NR(){Me=null,jd=null}async function Jd({animate:r}={}){const e=(await qt()).getChildByName(Sl);if(!e)throw new Error("Nodes container not found");VR();const{x:i,y:s,width:n,height:o}=e.getLocalBounds();if(!n||!o){DR({animate:r});return}kR({x:i,y:s,width:n,height:o,animate:r})}async function kR({x:r,y:t,width:e,height:i,animate:s}){const n=await Mt(),o=await qt(),{guideTextSize:a,guideTextTopPadding:h,columnGap:l,rowGap:c,eventTargetSize:u}=n.styles,d=a+h,f=e+l*2,p=i+c*4+d+u,m=o.findFit(f,p);o.animate({position:{x:r+e/2,y:t+i/2+d},scale:Math.min(m,1),time:s?n.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Zo(),Wo()}})}async function DR({animate:r}){const t=await Bi(),e=await Mt(),i=await qt(),s=await Qe();let n=s(t.start_time)-e.styles.columnGap,o=s(t.end_time??new Date)+e.styles.columnGap;if(n>o){const c=n;n=o,o=c}const a=o-n,h=n+a/2,l=i.findFit(a,0);i.animate({position:{x:h,y:0},scale:l,time:r?e.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Zo(),Wo()}})}async function qt(){return Me||await Ge("viewportCreated")}function _b(r){Eg(jd,r)||(jd=r,$.emit("viewportDateRangeUpdated",r))}function OR({xOffset:r,yOffset:t}){if(!Me)return;const{x:e,y:i}=Me.transform.position;Me.setTransform(e+r,i+t,Me.transform.scale.x,Me.transform.scale.y)}async function BR(){const r=await qt();Wo(),r.on("moved",()=>Wo())}async function Wo(){const r=await vb();r&&_b(r)}async function vb(){const r=await qt(),t=await Qe(),e=t.invert(r.left),i=t.invert(r.right);return e instanceof Date&&i instanceof Date?[e,i]:null}async function UR(r){const t=await vb(),e=await Qt();if(r===void 0||e.isDependency()||Eg(r,t))return;const i=await qt(),s=await Qe(),[n,o]=r,a=s(n),h=s(o),l=a+(h-a)/2;_b(r),i.fitWidth(h-a,!0),i.moveCenter(l,i.center.y)}async function XR(){const r=await Jt(),t=await qt(),e=await Iu(),i=t.screenWidth,s=t.screenHeight,n=e.clientWidth,o=e.clientHeight,a=(n-i)/2,h=(o-s)/2;t.resize(r.screen.width,r.screen.height),OR({xOffset:a,yOffset:h})}class il{constructor(){kf(this,"status","visible");kf(this,"labels",new Set)}get visible(){return this.status==="visible"}get hidden(){return this.status==="hidden"}show(){if(this.status!=="visible"){for(const t of this.labels)t.visible=!0;this.status="visible"}}hide(){if(this.status!=="hidden"){for(const t of this.labels)t.visible=!1;this.status="hidden"}}toggle(t){t?this.show():this.hide()}add(t){this.labels.add(t),t.visible=this.visible}clear(){this.labels.clear()}}let Ui=null,qe=null,Xi=null,dr=null,ui=null;async function WR(){const r=await qt(),t=await Jt();Ui=new jS({toggle:"renderable"}),qe=new il,Xi=new il,ui=new il,dr=new il,t.ticker.add(()=>{if(r.dirty){const e=r.scale.x>ip,i=r.scale.x>qf,s=r.scale.x>tp,n=r.scale.x>ep;ui==null||ui.toggle(e),qe==null||qe.toggle(i),Xi==null||Xi.toggle(s),dr==null||dr.toggle(n),Ui==null||Ui.cull(t.renderer.screen),r.dirty=!1}}),$.emit("cullCreated",Ui),$.emit("labelCullCreated",qe),$.emit("iconCullCreated",qe),$.emit("edgeCullCreated",ui),$.emit("toggleCullCreated",dr)}function ZR(){Ui=null,qe==null||qe.clear(),qe=null,Xi==null||Xi.clear(),Xi=null,ui==null||ui.clear(),ui=null,dr==null||dr.clear(),dr=null}async function Zo(){const r=await qt();r.dirty=!0}function VR(){Ui&&Ui.uncull()}async function wb(){return Ui||await Ge("cullCreated")}async function HR(){return ui||await Ge("edgeCullCreated")}async function Tb(){return qe||await Ge("labelCullCreated")}async function Sb(){return Xi||await Ge("iconCullCreated")}async function KR(){const r=await Jt(),t=await Bi(),e=await Qt(),{element:i,render:s,update:n}=await pb({isRoot:!0});i.zIndex=ap;function o(a){if(st.isTemporal()&&!e.disableArtifacts){r.stage.addChild(i),s(a==null?void 0:a.artifacts);return}r.stage.removeChild(i)}t.artifacts&&o(t),$.on("viewportMoved",()=>n()),$.on("runDataCreated",a=>o(a)),$.on("runDataUpdated",a=>o(a)),$.on("configUpdated",()=>o()),$.on("layoutSettingsUpdated",()=>o())}function wP(){}async function YR(){const r=await Jt(),t=await Bi(),{element:e,render:i}=await mb({isRoot:!0});e.zIndex=op,r.stage.addChild(e);function s(n){i(n==null?void 0:n.states)}t.states&&s(t),$.on("runDataUpdated",n=>s(n)),$.on("configUpdated",()=>s()),$.on("layoutSettingsUpdated",()=>s())}function TP(){}async function zR(){const r=await Jt(),t=await qt(),e=await Qt(),i=await Mt(),{inter:s}=await r1(),n=new Tt,o=await or();n.addChild(o);const a=s("");n.addChild(a);let h=await Qe(),l,c;$.on("scaleUpdated",m=>{h=m,p()}),$.on("viewportMoved",()=>{e.disableGuides||(p(),n.height!==r.screen.height&&d())});function u(m,g){l=m,c=g,d(),f(m)}function d(){o.width=i.styles.guideLineWidth,o.height=r.screen.height,o.tint=i.styles.guideLineColor}function f(m){a.text=c(m),a.fontSize=i.styles.guideTextSize,a.tint=i.styles.guideTextColor,a.position.set(i.styles.guideTextLeftPadding,i.styles.guideTextTopPadding)}function p(){l!==void 0&&(n.position.x=h(l)*t.scale._x+t.worldTransform.tx)}return{element:n,render:u}}class Cb extends Error{constructor(){super("Layout is not temporal")}}function jR(r){return r.toLocaleTimeString()}function Eb(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(r)}function JR(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{dateStyle:"short"}).format(r)}function $R(r){return r.getHours()===0&&r.getMinutes()===0?`${rl.date(r)}
1176
- ${Eb(r)}`:Eb(r)}const rl={timeBySeconds:jR,timeByMinutesWithDates:$R,date:JR},re={seconds:"seconds",minutes:"minutes",date:"date"},Vo={day:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.getTime()},week:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.setDate(r.getDate()-r.getDay()+1),t.getTime()}},Et={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Ib=[{ceiling:Et.second*4,increment:Et.second,labelFormat:re.seconds},{ceiling:Et.second*8,increment:Et.second*5,labelFormat:re.seconds},{ceiling:Et.second*13,increment:Et.second*10,labelFormat:re.seconds},{ceiling:Et.second*20,increment:Et.second*15,labelFormat:re.seconds},{ceiling:Et.second*45,increment:Et.second*30,labelFormat:re.seconds},{ceiling:Et.minute*4,increment:Et.minute,labelFormat:re.minutes},{ceiling:Et.minute*8,increment:Et.minute*5,labelFormat:re.minutes},{ceiling:Et.minute*13,increment:Et.minute*10,labelFormat:re.minutes},{ceiling:Et.minute*28,increment:Et.minute*15,labelFormat:re.minutes},{ceiling:Et.hour*1.24,increment:Et.minute*30,labelFormat:re.minutes},{ceiling:Et.hour*3,increment:Et.hour,labelFormat:re.minutes},{ceiling:Et.hour*8,increment:Et.hour*2,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.hour*13,increment:Et.hour*6,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.hour*22,increment:Et.hour*12,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.day*4,increment:Et.day,getAnchor:Vo.day,labelFormat:re.date},{ceiling:Et.week*2,increment:Et.week,getAnchor:Vo.week,labelFormat:re.date},{ceiling:1/0,increment:Et.week*4,labelFormat:re.date}],QR=300;async function qR(){const r=await qt(),t=await Qt(),e=new Tt,i=new Map;let s=await Qe();$.on("scaleUpdated",d=>s=d),await o();function n(){if(e.visible=!t.disableGuides,!t.disableGuides)try{const{anchor:d,increment:f,labelFormat:p}=a(),m=u(d,f);c(m,p)}catch(d){if(d instanceof Cb)return;console.error(d)}}async function o(){const d=[];_d(Rl,async f=>{const p=zR();d.push(p);const m=await p;e.addChild(m.element),i.set(f,m)}),await Promise.all(d)}function a(){const d=r.left-QR,f=s.invert(d),p=s.invert(d+rp/r.scale.x);if(!(f instanceof Date)||!(p instanceof Date))throw new Cb;const m=p.getTime()-f.getTime(),{increment:g,getAnchor:b,labelFormat:_}=h(m);return{anchor:b(f),increment:g,labelFormat:l(_)}}function h(d){const f=Ib.find(p=>p.ceiling>d)??Ib[0];return f.getAnchor||(f.getAnchor=p=>Math.floor(p.getTime()/f.increment)*f.increment),f}function l(d){switch(d){case re.minutes:return rl.timeByMinutesWithDates;case re.date:return rl.date;default:return rl.timeBySeconds}}function c(d,f){const p=new Map(i.entries()),m=Array.from(p.keys()).filter(g=>!d.includes(g));i.clear();for(const g of d){if(p.has(g)){const _=p.get(g);i.set(g,_),_.render(new Date(g),f);continue}const b=p.get(m.pop()??-1);if(b===void 0){console.warn("Guides: No unused guides available to render.");continue}b.render(new Date(g),f),i.set(g,b)}}function u(d,f){return _d(Rl,p=>d+f*p)}return{element:e,render:n}}async function tP(){const r=await Jt(),{element:t,render:e}=await qR();r.stage.addChild(t),e(),$.on("viewportDateRangeUpdated",()=>e()),$.on("layoutSettingsUpdated",()=>e()),$.on("configUpdated",()=>e())}function SP(){}const eP=80;async function iP(){const r=await Jt(),t=await qt(),e=await Qt(),i=await Mt(),s=await or();let n=await Qe();$.on("scaleUpdated",h=>n=h);function o(){if(!e.isTemporal()){s.visible=!1;return}s.width=i.styles.playheadWidth,s.height=r.stage.height,s.tint=i.styles.playheadColor,s.position.x=n(new Date)*t.scale.x+t.worldTransform.tx,a()}function a(){if(t.moving||!(s.position.x>0&&s.position.x<r.screen.width)||!(s.position.x>r.screen.width-eP))return;const c=t.left;t.zoomPercent(-.1,!0),t.left=c}return{element:s,render:o}}async function rP(){const r=await Jt(),t=await Bi(),{element:e,render:i}=await iP();t.end_time||(r.stage.addChild(e),r.ticker.add(i)),$.on("runDataUpdated",({end_time:s})=>{s&&(r.ticker.remove(i),r.stage.removeChild(e))})}function CP(){}function sP({stage:r,config:t}){BS(),FR(),mR(),tP(),RR(),KR(),yR(),YR(),rP(),CI(),DS(r),YS(t),WR(),jE(),MI()}function nP(){$.clear();try{US(),NR(),gR(),OS(),PR(),bR(),zS(),II(),ZR(),JE(),RI(),ZS()}catch(r){console.error(r)}}rt.DEFAULT_EDGE_CONTAINER_NAME=Jf,rt.DEFAULT_EDGE_CULLING_THRESHOLD=ip,rt.DEFAULT_EDGE_MINIMUM_BEZIER=Ml,rt.DEFAULT_EDGE_POINTS=Al,rt.DEFAULT_GUIDES_COUNT=Rl,rt.DEFAULT_GUIDES_MIN_GAP=rp,rt.DEFAULT_HORIZONTAL_SCALE=Ob,rt.DEFAULT_HORIZONTAL_SCALE_MULTIPLIER=Db,rt.DEFAULT_ICON_CULLING_THRESHOLD=tp,rt.DEFAULT_LABEL_CULLING_THRESHOLD=qf,rt.DEFAULT_LINEAR_COLUMN_SIZE_PIXELS=Qf,rt.DEFAULT_NESTED_GRAPH_BORDER_Z_INDEX=Ll,rt.DEFAULT_NESTED_GRAPH_NODES_Z_INDEX=Gl,rt.DEFAULT_NESTED_GRAPH_NODE_Z_INDEX=Fl,rt.DEFAULT_NODES_CONTAINER_NAME=Sl,rt.DEFAULT_NODE_CONTAINER_NAME=jf,rt.DEFAULT_NODE_LABEL_Z_INDEX=Kn,rt.DEFAULT_ROOT_ARTIFACT_Z_INDEX=ap,rt.DEFAULT_ROOT_COLLISION_THROTTLE=Pl,rt.DEFAULT_ROOT_EVENT_Z_INDEX=np,rt.DEFAULT_ROOT_FLOW_STATE_Z_INDEX=op,rt.DEFAULT_SUBFLOW_ARTIFACT_Z_INDEX=cp,rt.DEFAULT_SUBFLOW_EVENT_Z_INDEX=hp,rt.DEFAULT_SUBFLOW_STATE_Z_INDEX=lp,rt.DEFAULT_TEXTURE_RESOLUTION=El,rt.DEFAULT_TEXT_RESOLUTION=Il,rt.DEFAULT_TIME_COLUMN_SIZE_PIXELS=Cl,rt.DEFAULT_TIME_COLUMN_SPAN_SECONDS=$f,rt.DEFAULT_TOGGLE_CULLING_THRESHOLD=ep,rt.DEFAULT_VIEWPORT_Z_INDEX=sp,rt.artifactTypeIconMap=Yr,rt.artifactTypes=Pe,rt.centerViewport=Jd,rt.emitter=$,rt.isArtifactSelection=Vf,rt.isArtifactsSelection=Hf,rt.isEventSelection=Yf,rt.isEventsSelection=zf,rt.isHorizontalMode=kb,rt.isNodeSelection=ua,rt.isRunGraphNodeType=Gb,rt.isStateSelection=Kf,rt.isVerticalMode=Nb,rt.layout=st,rt.resetHorizontalScaleMultiplier=qE,rt.runGraphNodeKinds=Tl,rt.selectItem=Di,rt.setConfig=Cg,rt.setDisabledArtifacts=rI,rt.setDisabledEdges=iI,rt.setDisabledEvents=sI,rt.setHorizontalMode=tI,rt.setHorizontalScaleMultiplier=yd,rt.setVerticalMode=eI,rt.start=sP,rt.stateType=Fb,rt.stop=nP,rt.updateViewportFromDateRange=UR,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
1175
+ */var Ey,Dr,bn,nd,_s,Iy,od,vE=function(){return typeof window<"u"},sr={},vs=180/Math.PI,xn=Math.PI/180,_n=Math.atan2,Ay=1e8,ad=/([A-Z])/g,wE=/(left|right|width|margin|padding|x)/i,TE=/[\s,\(]\S/,Ni={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},hd=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},SE=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},CE=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},EE=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},My=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Ry=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},IE=function(t,e,i){return t.style[e]=i},AE=function(t,e,i){return t.style.setProperty(e,i)},ME=function(t,e,i){return t._gsap[e]=i},RE=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},PE=function(t,e,i,s,n){var o=t._gsap;o.scaleX=o.scaleY=i,o.renderTransform(n,o)},LE=function(t,e,i,s,n){var o=t._gsap;o[e]=i,o.renderTransform(n,o)},Wt="transform",Ae=Wt+"Origin",GE=function r(t,e){var i=this,s=this.target,n=s.style,o=s._gsap;if(t in sr&&n){if(this.tfm=this.tfm||{},t!=="transform")t=Ni[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return i.tfm[a]=nr(s,a)}):this.tfm[t]=o.x?o[t]:nr(s,t),t===Ae&&(this.tfm.zOrigin=o.zOrigin);else return Ni.transform.split(",").forEach(function(a){return r.call(i,a,e)});if(this.props.indexOf(Wt)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Ae,e,"")),t=Wt}(n||e)&&this.props.push(t,e,n[t])},Py=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},FE=function(){var t=this.props,e=this.target,i=e.style,s=e._gsap,n,o;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(ad,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=od(),(!n||!n.isStart)&&!i[Wt]&&(Py(i),s.zOrigin&&i[Ae]&&(i[Ae]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},Ly=function(t,e){var i={target:t,props:[],revert:FE,save:GE};return t._gsap||Ie.core.getCache(t),e&&e.split(",").forEach(function(s){return i.save(s)}),i},Gy,ld=function(t,e){var i=Dr.createElementNS?Dr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Dr.createElement(t);return i&&i.style?i:Dr.createElement(t)},ki=function r(t,e,i){var s=getComputedStyle(t);return s[e]||s.getPropertyValue(e.replace(ad,"-$1").toLowerCase())||s.getPropertyValue(e)||!i&&r(t,vn(e)||e,1)||""},Fy="O,Moz,ms,Ms,Webkit".split(","),vn=function(t,e,i){var s=e||_s,n=s.style,o=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Fy[o]+t in n););return o<0?null:(o===3?"ms":o>=0?Fy[o]:"")+t},cd=function(){vE()&&window.document&&(Ey=window,Dr=Ey.document,bn=Dr.documentElement,_s=ld("div")||{style:{}},ld("div"),Wt=vn(Wt),Ae=Wt+"Origin",_s.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Gy=!!vn("perspective"),od=Ie.core.reverting,nd=1)},ud=function r(t){var e=ld("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,s=this.nextSibling,n=this.style.cssText,o;if(bn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(s?i.insertBefore(this,s):i.appendChild(this)),bn.removeChild(e),this.style.cssText=n,o},Ny=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},ky=function(t){var e;try{e=t.getBBox()}catch{e=ud.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===ud||(e=ud.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Ny(t,["x","cx","x1"])||0,y:+Ny(t,["y","cy","y1"])||0,width:0,height:0}:e},Dy=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ky(t))},ws=function(t,e){if(e){var i=t.style,s;e in sr&&e!==Ae&&(e=Wt),i.removeProperty?(s=e.substr(0,2),(s==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(s==="--"?e:e.replace(ad,"-$1").toLowerCase())):i.removeAttribute(e)}},Or=function(t,e,i,s,n,o){var a=new Ee(t._pt,e,i,0,1,o?Ry:My);return t._pt=a,a.b=s,a.e=n,t._props.push(i),a},Oy={deg:1,rad:1,turn:1},NE={grid:1,flex:1},Br=function r(t,e,i,s){var n=parseFloat(i)||0,o=(i+"").trim().substr((n+"").length)||"px",a=_s.style,h=wE.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),u=100,d=s==="px",f=s==="%",p,m,g,b;if(s===o||!n||Oy[s]||Oy[o])return n;if(o!=="px"&&!d&&(n=r(t,e,i,"px")),b=t.getCTM&&Dy(t),(f||o==="%")&&(sr[e]||~e.indexOf("adius")))return p=b?t.getBBox()[h?"width":"height"]:t[c],Yt(f?n/p*u:n/100*p);if(a[h?"width":"height"]=u+(d?o:s),m=~e.indexOf("adius")||s==="em"&&t.appendChild&&!l?t:t.parentNode,b&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===Dr||!m.appendChild)&&(m=Dr.body),g=m._gsap,g&&f&&g.width&&h&&g.time===Be.time&&!g.uncache)return Yt(n/g.width*u);if(f&&(e==="height"||e==="width")){var _=t.style[e];t.style[e]=u+s,p=t[c],_?t.style[e]=_:ws(t,e)}else(f||o==="%")&&!NE[ki(m,"display")]&&(a.position=ki(t,"position")),m===t&&(a.position="static"),m.appendChild(_s),p=_s[c],m.removeChild(_s),a.position="absolute";return h&&f&&(g=ps(m),g.time=Be.time,g.width=m[c]),Yt(d?p*n/u:p&&n?u/p*n:0)},nr=function(t,e,i,s){var n;return nd||cd(),e in Ni&&e!=="transform"&&(e=Ni[e],~e.indexOf(",")&&(e=e.split(",")[0])),sr[e]&&e!=="transform"?(n=Io(t,s),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:Fh(ki(t,Ae))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||s||~(n+"").indexOf("calc("))&&(n=Gh[e]&&Gh[e](t,e,i)||ki(t,e)||Wg(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?Br(t,e,n,i)+i:n},kE=function(t,e,i,s){if(!i||i==="none"){var n=vn(e,t,1),o=n&&ki(t,n,1);o&&o!==i?(e=n,i=o):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var a=new Ee(this._pt,t.style,e,0,1,wy),h=0,l=0,c,u,d,f,p,m,g,b,_,x,v,T;if(a.b=i,a.e=s,i+="",s+="",s==="auto"&&(m=t.style[e],t.style[e]=s,s=ki(t,e)||s,m?t.style[e]=m:ws(t,e)),c=[i,s],dy(c),i=c[0],s=c[1],d=i.match(dn)||[],T=s.match(dn)||[],T.length){for(;u=dn.exec(s);)g=u[0],_=s.substring(h,u.index),p?p=(p+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(p=1),g!==(m=d[l++]||"")&&(f=parseFloat(m)||0,v=m.substr((f+"").length),g.charAt(1)==="="&&(g=fn(f,g)+v),b=parseFloat(g),x=g.substr((b+"").length),h=dn.lastIndex-x.length,x||(x=x||Ne.units[e]||v,h===s.length&&(s+=x,a.e+=x)),v!==x&&(f=Br(t,e,m,x)||0),a._pt={_next:a._pt,p:_||l===1?_:",",s:f,c:b-f,m:p&&p<4||e==="zIndex"?Math.round:0});a.c=h<s.length?s.substring(h,s.length):""}else a.r=e==="display"&&s==="none"?Ry:My;return Ng.test(s)&&(a.e=0),this._pt=a,a},By={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},DE=function(t){var e=t.split(" "),i=e[0],s=e[1]||"50%";return(i==="top"||i==="bottom"||s==="left"||s==="right")&&(t=i,i=s,s=t),e[0]=By[i]||i,e[1]=By[s]||s,e.join(" ")},OE=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,s=i.style,n=e.u,o=i._gsap,a,h,l;if(n==="all"||n===!0)s.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)a=n[l],sr[a]&&(h=1,a=a==="transformOrigin"?Ae:Wt),ws(i,a);h&&(ws(i,Wt),o&&(o.svg&&i.removeAttribute("transform"),Io(i,1),o.uncache=1,Py(s)))}},Gh={clearProps:function(t,e,i,s,n){if(n.data!=="isFromStart"){var o=t._pt=new Ee(t._pt,e,i,0,0,OE);return o.u=s,o.pr=-10,o.tween=n,t._props.push(i),1}}},Eo=[1,0,0,1,0,0],Uy={},Xy=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Wy=function(t){var e=ki(t,Wt);return Xy(e)?Eo:e.substr(7).match(Fg).map(Yt)},dd=function(t,e){var i=t._gsap||ps(t),s=t.style,n=Wy(t),o,a,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?Eo:n):(n===Eo&&!t.offsetParent&&t!==bn&&!i.svg&&(h=s.display,s.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,bn.appendChild(t)),n=Wy(t),h?s.display=h:ws(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):bn.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},fd=function(t,e,i,s,n,o){var a=t._gsap,h=n||dd(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,u=a.xOffset||0,d=a.yOffset||0,f=h[0],p=h[1],m=h[2],g=h[3],b=h[4],_=h[5],x=e.split(" "),v=parseFloat(x[0])||0,T=parseFloat(x[1])||0,C,E,I,R;i?h!==Eo&&(E=f*g-p*m)&&(I=v*(g/E)+T*(-m/E)+(m*_-g*b)/E,R=v*(-p/E)+T*(f/E)-(f*_-p*b)/E,v=I,T=R):(C=ky(t),v=C.x+(~x[0].indexOf("%")?v/100*C.width:v),T=C.y+(~(x[1]||x[0]).indexOf("%")?T/100*C.height:T)),s||s!==!1&&a.smooth?(b=v-l,_=T-c,a.xOffset=u+(b*f+_*m)-b,a.yOffset=d+(b*p+_*g)-_):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=T,a.smooth=!!s,a.origin=e,a.originIsAbsolute=!!i,t.style[Ae]="0px 0px",o&&(Or(o,a,"xOrigin",l,v),Or(o,a,"yOrigin",c,T),Or(o,a,"xOffset",u,a.xOffset),Or(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+T)},Io=function(t,e){var i=t._gsap||new gy(t);if("x"in i&&!e&&!i.uncache)return i;var s=t.style,n=i.scaleX<0,o="px",a="deg",h=getComputedStyle(t),l=ki(t,Ae)||"0",c,u,d,f,p,m,g,b,_,x,v,T,C,E,I,R,N,F,P,A,G,D,X,B,H,lt,W,L,O,U,tt,Q;return c=u=d=m=g=b=_=x=v=0,f=p=1,i.svg=!!(t.getCTM&&Dy(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(s[Wt]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Wt]!=="none"?h[Wt]:"")),s.scale=s.rotate=s.translate="none"),E=dd(t,i.svg),i.svg&&(i.uncache?(H=t.getBBox(),l=i.xOrigin-H.x+"px "+(i.yOrigin-H.y)+"px",B=""):B=!e&&t.getAttribute("data-svg-origin"),fd(t,B||l,!!B||i.originIsAbsolute,i.smooth!==!1,E)),T=i.xOrigin||0,C=i.yOrigin||0,E!==Eo&&(F=E[0],P=E[1],A=E[2],G=E[3],c=D=E[4],u=X=E[5],E.length===6?(f=Math.sqrt(F*F+P*P),p=Math.sqrt(G*G+A*A),m=F||P?_n(P,F)*vs:0,_=A||G?_n(A,G)*vs+m:0,_&&(p*=Math.abs(Math.cos(_*xn))),i.svg&&(c-=T-(T*F+C*A),u-=C-(T*P+C*G))):(Q=E[6],U=E[7],W=E[8],L=E[9],O=E[10],tt=E[11],c=E[12],u=E[13],d=E[14],I=_n(Q,O),g=I*vs,I&&(R=Math.cos(-I),N=Math.sin(-I),B=D*R+W*N,H=X*R+L*N,lt=Q*R+O*N,W=D*-N+W*R,L=X*-N+L*R,O=Q*-N+O*R,tt=U*-N+tt*R,D=B,X=H,Q=lt),I=_n(-A,O),b=I*vs,I&&(R=Math.cos(-I),N=Math.sin(-I),B=F*R-W*N,H=P*R-L*N,lt=A*R-O*N,tt=G*N+tt*R,F=B,P=H,A=lt),I=_n(P,F),m=I*vs,I&&(R=Math.cos(I),N=Math.sin(I),B=F*R+P*N,H=D*R+X*N,P=P*R-F*N,X=X*R-D*N,F=B,D=H),g&&Math.abs(g)+Math.abs(m)>359.9&&(g=m=0,b=180-b),f=Yt(Math.sqrt(F*F+P*P+A*A)),p=Yt(Math.sqrt(X*X+Q*Q)),I=_n(D,X),_=Math.abs(I)>2e-4?I*vs:0,v=tt?1/(tt<0?-tt:tt):0),i.svg&&(B=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Xy(ki(t,Wt)),B&&t.setAttribute("transform",B))),Math.abs(_)>90&&Math.abs(_)<270&&(n?(f*=-1,_+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,_+=_<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+o,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+o,i.z=d+o,i.scaleX=Yt(f),i.scaleY=Yt(p),i.rotation=Yt(m)+a,i.rotationX=Yt(g)+a,i.rotationY=Yt(b)+a,i.skewX=_+a,i.skewY=x+a,i.transformPerspective=v+o,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(s[Ae]=Fh(l)),i.xOffset=i.yOffset=0,i.force3D=Ne.force3D,i.renderTransform=i.svg?UE:Gy?Zy:BE,i.uncache=0,i},Fh=function(t){return(t=t.split(" "))[0]+" "+t[1]},pd=function(t,e,i){var s=me(e);return Yt(parseFloat(e)+parseFloat(Br(t,"x",i+"px",s)))+s},BE=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Zy(t,e)},Ts="0deg",Ao="0px",Ss=") ",Zy=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.z,l=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,g=i.transformPerspective,b=i.force3D,_=i.target,x=i.zOrigin,v="",T=b==="auto"&&t&&t!==1||b===!0;if(x&&(u!==Ts||c!==Ts)){var C=parseFloat(c)*xn,E=Math.sin(C),I=Math.cos(C),R;C=parseFloat(u)*xn,R=Math.cos(C),o=pd(_,o,E*R*-x),a=pd(_,a,-Math.sin(C)*-x),h=pd(_,h,I*R*-x+x)}g!==Ao&&(v+="perspective("+g+Ss),(s||n)&&(v+="translate("+s+"%, "+n+"%) "),(T||o!==Ao||a!==Ao||h!==Ao)&&(v+=h!==Ao||T?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Ss),l!==Ts&&(v+="rotate("+l+Ss),c!==Ts&&(v+="rotateY("+c+Ss),u!==Ts&&(v+="rotateX("+u+Ss),(d!==Ts||f!==Ts)&&(v+="skew("+d+", "+f+Ss),(p!==1||m!==1)&&(v+="scale("+p+", "+m+Ss),_.style[Wt]=v||"translate(0, 0)"},UE=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.rotation,l=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,g=i.xOffset,b=i.yOffset,_=i.forceCSS,x=parseFloat(o),v=parseFloat(a),T,C,E,I,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=xn,l*=xn,T=Math.cos(h)*u,C=Math.sin(h)*u,E=Math.sin(h-l)*-d,I=Math.cos(h-l)*d,l&&(c*=xn,R=Math.tan(l-c),R=Math.sqrt(1+R*R),E*=R,I*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),T*=R,C*=R)),T=Yt(T),C=Yt(C),E=Yt(E),I=Yt(I)):(T=u,I=d,C=E=0),(x&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(x=Br(f,"x",o,"px"),v=Br(f,"y",a,"px")),(p||m||g||b)&&(x=Yt(x+p-(p*T+m*E)+g),v=Yt(v+m-(p*C+m*I)+b)),(s||n)&&(R=f.getBBox(),x=Yt(x+s/100*R.width),v=Yt(v+n/100*R.height)),R="matrix("+T+","+C+","+E+","+I+","+x+","+v+")",f.setAttribute("transform",R),_&&(f.style[Wt]=R)},XE=function(t,e,i,s,n){var o=360,a=ae(n),h=parseFloat(n)*(a&&~n.indexOf("rad")?vs:1),l=h-s,c=s+l+"deg",u,d;return a&&(u=n.split("_")[1],u==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),u==="cw"&&l<0?l=(l+o*Ay)%o-~~(l/o)*o:u==="ccw"&&l>0&&(l=(l-o*Ay)%o-~~(l/o)*o)),t._pt=d=new Ee(t._pt,e,i,s,l,SE),d.e=c,d.u="deg",t._props.push(i),d},Vy=function(t,e){for(var i in e)t[i]=e[i];return t},WE=function(t,e,i){var s=Vy({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,l,c,u,d,f,p;s.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),o[Wt]=e,a=Io(i,1),ws(i,Wt),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Wt],o[Wt]=e,a=Io(i,1),o[Wt]=l);for(h in sr)l=s[h],c=a[h],l!==c&&n.indexOf(h)<0&&(f=me(l),p=me(c),u=f!==p?Br(i,h,l,p):parseFloat(l),d=parseFloat(c),t._pt=new Ee(t._pt,a,h,u,d-u,hd),t._pt.u=p||0,t._props.push(h));Vy(a,s)};Ce("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",s="Bottom",n="Left",o=(t<3?[e,i,s,n]:[e+n,e+i,s+i,s+n]).map(function(a){return t<2?r+a:"border"+a+r});Gh[t>1?"border"+r:r]=function(a,h,l,c,u){var d,f;if(arguments.length<4)return d=o.map(function(p){return nr(a,p,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},o.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),a.init(h,f,u)}});var Hy={name:"css",register:cd,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,s,n){var o=this._props,a=t.style,h=i.vars.startAt,l,c,u,d,f,p,m,g,b,_,x,v,T,C,E,I;nd||cd(),this.styles=this.styles||Ly(t),I=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(De[m]&&yy(m,e,i,s,t,n)))){if(f=typeof c,p=Gh[m],f==="function"&&(c=c.call(i,s,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=_o(c)),p)p(this,t,m,c,i)&&(E=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",Nr.lastIndex=0,Nr.test(l)||(g=me(l),b=me(c)),b?g!==b&&(l=Br(t,m,l,b)+b):g&&(c+=g),this.add(a,"setProperty",l,c,s,n,0,0,m),o.push(m),I.push(m,0,a[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,s,t,n):h[m],ae(l)&&~l.indexOf("random(")&&(l=_o(l)),me(l+"")||l==="auto"||(l+=Ne.units[m]||me(nr(t,m))||""),(l+"").charAt(1)==="="&&(l=nr(t,m))):l=nr(t,m),d=parseFloat(l),_=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),_&&(c=c.substr(2)),u=parseFloat(c),m in Ni&&(m==="autoAlpha"&&(d===1&&nr(t,"visibility")==="hidden"&&u&&(d=0),I.push("visibility",0,a.visibility),Or(this,a,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=Ni[m],~m.indexOf(",")&&(m=m.split(",")[0]))),x=m in sr,x){if(this.styles.save(m),v||(T=t._gsap,T.renderTransform&&!e.parseTransform||Io(t,e.parseTransform),C=e.smoothOrigin!==!1&&T.smooth,v=this._pt=new Ee(this._pt,a,Wt,0,1,T.renderTransform,T,0,-1),v.dep=1),m==="scale")this._pt=new Ee(this._pt,T,"scaleY",T.scaleY,(_?fn(T.scaleY,_+u):u)-T.scaleY||0,hd),this._pt.u=0,o.push("scaleY",m),m+="X";else if(m==="transformOrigin"){I.push(Ae,0,a[Ae]),c=DE(c),T.svg?fd(t,c,0,C,0,this):(b=parseFloat(c.split(" ")[2])||0,b!==T.zOrigin&&Or(this,T,"zOrigin",T.zOrigin,b),Or(this,a,m,Fh(l),Fh(c)));continue}else if(m==="svgOrigin"){fd(t,c,1,C,0,this);continue}else if(m in Uy){XE(this,T,m,d,_?fn(d,_+c):c);continue}else if(m==="smoothOrigin"){Or(this,T,"smooth",T.smooth,c);continue}else if(m==="force3D"){T[m]=c;continue}else if(m==="transform"){WE(this,c,t);continue}}else m in a||(m=vn(m)||m);if(x||(u||u===0)&&(d||d===0)&&!TE.test(c)&&m in a)g=(l+"").substr((d+"").length),u||(u=0),b=me(c)||(m in Ne.units?Ne.units[m]:g),g!==b&&(d=Br(t,m,l,b)),this._pt=new Ee(this._pt,x?T:a,m,d,(_?fn(d,_+u):u)-d,!x&&(b==="px"||m==="zIndex")&&e.autoRound!==!1?EE:hd),this._pt.u=b||0,g!==b&&b!=="%"&&(this._pt.b=l,this._pt.r=CE);else if(m in a)kE.call(this,t,m,l,_?_+c:c);else if(m in t)this.add(t,m,l||t[m],_?_+c:c,s,n);else if(m!=="parseTransform"){ku(m,c);continue}x||(m in a?I.push(m,0,a[m]):I.push(m,1,l||t[m])),o.push(m)}}E&&Ty(this)},render:function(t,e){if(e.tween._time||!od())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:nr,aliases:Ni,getSetter:function(t,e,i){var s=Ni[e];return s&&s.indexOf(",")<0&&(e=s),e in sr&&e!==Ae&&(t._gsap.x||nr(t,"x"))?i&&Iy===i?e==="scale"?RE:ME:(Iy=i||{})&&(e==="scale"?PE:LE):t.style&&!Ru(t.style[e])?IE:~e.indexOf("-")?AE:td(t,e)},core:{_removeProperty:ws,_getMatrix:dd}};Ie.utils.checkPrefix=vn,Ie.core.getStyleSaver=Ly,function(r,t,e,i){var s=Ce(r+","+t+","+e,function(n){sr[n]=1});Ce(t,function(n){Ne.units[n]="deg",Uy[n]=1}),Ni[s[13]]=r+","+t,Ce(i,function(n){var o=n.split(":");Ni[o[1]]=s[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Ce("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Ne.units[r]="px"}),Ie.registerPlugin(Hy);var Ky=Ie.registerPlugin(Hy)||Ie;Ky.core.Tween;function Yy(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&Mg in r?r[Mg](t):r instanceof Date?new r.constructor(t):new Date(t)}function md(r,t){return Yy(r,r)}function ZE(r,t,e){return Yy(r,+md(r)+t)}function VE(r,t,e){return ZE(r,t*1e3)}function HE(r){return t=>{const e=Math.trunc,i=e(t);return i===0?0:i}}function zy(r,t){return+md(r)-+md(t)}function KE(r,t,e){const i=zy(r,t)/1e3;return HE()(i)}function YE(r){let t=0;for(const[,{children:e}]of r)t+=e.length;return t}function zE({start_time:r,end_time:t,nodes:e},i,s){const n=Math.max(KE(t??new Date,r),1),o=i.styles.nodeHeight+i.styles.rowGap;return(e.size>0?e.size*o*.5:o*4)*s/(n*Cl)}async function jE(){const r=await Bi(),t=await Mt(),e=await Jt(),i=e.view.width/e.view.height,s=zE(r,t,i);yd(s,!0),r.nodes.size>t.disableAnimationsThreshold&&(st.disableAnimations=!0),YE(r.nodes)>t.disableEdgesThreshold&&(st.disableEdges=!0)}function JE(){st.horizontal="temporal",st.vertical="nearest-parent",st.horizontalScaleMultiplierDefault=0,st.horizontalScaleMultiplier=0,st.disableAnimations=!1,st.disableGuides=!1,st.disableEdges=!1,st.disableArtifacts=!1,st.disableEvents=!1}const st={horizontal:"temporal",vertical:"nearest-parent",horizontalScaleMultiplierDefault:0,horizontalScaleMultiplier:0,disableAnimations:!1,disableGuides:!1,disableEdges:!1,disableArtifacts:!1,disableEvents:!1,isTemporal(){return this.horizontal==="temporal"},isDependency(){return this.horizontal==="dependency"},isWaterfall(){return this.vertical==="waterfall"},isNearestParent(){return this.vertical==="nearest-parent"},isLeftAligned(){return this.horizontal==="left-aligned"}};async function Qt(){return bd()?st:await Fe("layoutSettingsCreated")}function gd(){return st.isDependency()?Qf:Cl*st.horizontalScaleMultiplier}function $E(){return[0,gd()]}function QE(r){if(st.isDependency())return[0,1];const t=r,e=VE(t,$f);return[t,e]}function yd(r,t=!1){if(st.horizontalScaleMultiplier===r)return;const e=wn();st.horizontalScaleMultiplier=r,t&&(st.horizontalScaleMultiplierDefault=r),e()}function qE(){yd(st.horizontalScaleMultiplierDefault)}function tI(r){if(st.horizontal===r)return;const t=wn();st.horizontal=r,st.disableGuides=st.isDependency()||st.isLeftAligned(),t()}function eI(r){if(st.vertical===r)return;const t=wn();st.vertical=r,t()}function iI(r){if(st.disableEdges===r)return;const t=wn();st.disableEdges=r,t()}function rI(r){if(st.disableArtifacts===r)return;const t=wn();st.disableArtifacts=r,t()}function sI(r){if(st.disableEvents===r)return;const t=wn();st.disableEvents=r,t()}function wn(){const r=bd()?"layoutSettingsUpdated":"layoutSettingsCreated",{horizontal:t,vertical:e}=st;return()=>{bd()&&$.emit(r,st),(t!==st.horizontal||e!==st.vertical)&&$.emit("layoutUpdated")}}function bd(){return st.horizontalScaleMultiplier!==0}async function jy(){const r=await Qt(),t=await Mt();function e(i,s,n){const a=r.disableAnimations||n?0:t.animationDuration/1e3;return Ky.to(i,{...s,duration:a,ease:"power1.out",onUpdate:()=>{Zo()}})}return{animate:e}}async function nI({size:r,stroke:t=1,radius:e=0}){const i=await Jt(),s=new Ir;return s.lineStyle(t,"#fff",1,0),s.drawRoundedRect(0,0,r*2,r*2,e),i.renderer.generateTexture(s,{region:new pt(0,0,r,r),resolution:10})}async function Mo(r){return await fo(nI,[r])}var Nh=(r=>(r[r.Up=0]="Up",r[r.Down=180]="Down",r[r.Left=270]="Left",r[r.Right=90]="Right",r))(Nh||{});function Jy(){const r=new jt;async function t(e){const{rotate:i=0}=e,s={size:e.size,radius:e.radius,stroke:e.stroke},n=await Mo(s);return r.texture=n,r.anchor.set(.5,.5),r.angle=45+i,r}return{element:r,render:t}}async function oI(){const r=await Jt(),t=new Ir;return t.beginFill("#fff"),t.drawRect(0,0,1,1),t.endFill(),r.renderer.generateTexture(t,{wrapMode:_i.REPEAT})}async function xd(){return await fo(oI,[])}function _d(r,t){return Array.from({length:r},(e,i)=>t(i))}const aI=8,hI=2;async function lI(){const r=await Mt(),t=await wb(),e=await HR(),{animate:i}=await jy(),s=new Tt,{element:n,render:o}=await Jy(),a=await xd(),h=_d(Al,()=>new ct),l=new nS(a,h);let c=!1;s.name=Jf,s.addChild(n),s.addChild(l),t.addAll([n,l]),e.add(s);async function u(){return await o({size:10,rotate:Nh.Right}),n.tint=r.styles.edgeColor,l.tint=r.styles.edgeColor,s}async function d(p,m){const g=f(m);c||await u();for(const[b,_]of h.entries()){const{x,y:v}=g[b];i(_,{x,y:v},!c)}i(s,{x:p.x,y:p.y},!c),i(n,{x:m.x-aI,y:m.y},!c),c=!0}function f({x:p,y:m}){const g=[],b={x:0,y:0},_={x:p-hI,y:m},x={x:$y(b.x,{source:b,target:_}),y:b.y},v={x:$y(_.x,{source:b,target:_},!0),y:_.y};for(const[T]of h.entries()){if(T===h.length-1){g[T]=_;continue}const C=cI(T,{source:b,target:_,sourceBezier:x,targetBezier:v});g[T]=C}return g}return{element:s,render:u,setPosition:d}}function $y(r,{source:t,target:e},i){const s=(e.x-t.x)/2;return r+(s>Ml?s:Ml)*(i?-1:1)}function cI(r,t){const e=r/Al,{source:i,target:s,sourceBezier:n,targetBezier:o}=t,a=i.x+(n.x-i.x)*e,h=i.y+(n.y-i.y)*e,l=n.x+(o.x-n.x)*e,c=n.y+(o.y-n.y)*e,u=o.x+(s.x-o.x)*e,d=o.y+(s.y-o.y)*e,f=a+(l-a)*e,p=h+(c-h)*e,m=l+(u-l)*e,g=c+(d-c)*e,b=f+(m-f)*e,_=p+(g-p)*e;return{x:b,y:_}}async function uI({height:r,radius:t}){const e=await Jt(),i=new Ir;return i.beginFill("#fff"),i.drawRoundedRect(0,0,t*2,r,t),i.endFill(),e.renderer.generateTexture(i,{region:new pt(0,0,t,r),resolution:El})}async function dI(r){return await fo(uI,[r])}function fI(){const r=new jt,t=new jt;async function e(i){const s=await dI(i);return r.texture=s,t.texture=s,t.anchor.x=1,t.scale.x=-1,{left:r,right:t}}return{left:r,right:t,render:e}}async function or(){const r=await xd();return new jt(r)}async function vd(){const r=new Tt,t=await or(),{left:e,right:i,render:s}=await fI();r.addChild(t),r.addChild(e),r.addChild(i);async function n(h){const{width:l,x:c,visible:u}=a(h);return await s({height:h.height,radius:h.radius}),t.visible=u,t.width=l,t.height=h.height,t.x=c,e.visible=o(h.capLeft,h.radius),i.visible=o(h.capRight,h.radius),i.x=h.radius+l,t.tint=h.background,e.tint=h.background,i.tint=h.background,r}function o(h,l){return l===0?!1:h??!0}function a(h){const l=o(h.capLeft,h.radius),c=o(h.capRight,h.radius);let u=0;l&&(u+=h.radius),c&&(u+=h.radius);const d=Math.max(h.width-u,0),f=d>0,p=l?h.radius:0;return{width:d,visible:f,x:p}}return{element:r,render:n}}function kh(){const r=new Tt,t=new jt,e=new jt,i=new jt,s=new jt,n=new jt,o=new jt,a=new jt,h=new jt;t.name="border-corner-top-left",e.name="border-corner-top-right",i.name="border-corner-bottom-left",s.name="border-corner-bottom-right",n.name="border-corner-left",o.name="border-corner-right",a.name="border-corner-top",h.name="border-corner-bottom",e.anchor.x=1,e.scale.x=-1,i.anchor.y=1,i.scale.y=-1,s.anchor.x=1,s.scale.x=-1,s.anchor.y=1,s.scale.y=-1,r.addChild(t),r.addChild(e),r.addChild(i),r.addChild(s),r.addChild(n),r.addChild(o),r.addChild(a),r.addChild(h);async function l(p){const{radius:m=0,color:g="#fff",stroke:b,width:_,height:x}=p,v=typeof m=="number",T={topLeft:c(v?m:m[0],_,x),topRight:c(v?m:m[1],_,x),bottomLeft:c(v?m:m[2],_,x),bottomRight:c(v?m:m[3],_,x)};return await u({width:_,height:x,stroke:b,cornerSizes:T}),await d({width:_,height:x,stroke:b,cornerSizes:T}),f(g),r}function c(p,m,g){const b=Math.min(m,g);return{size:p*2>b?b/2:p,radius:p}}async function u({width:p,height:m,stroke:g,cornerSizes:b}){const{topLeft:_,topRight:x,bottomLeft:v,bottomRight:T}=b,[C,E,I,R]=await Promise.all([Mo({..._,stroke:g}),Mo({...x,stroke:g}),Mo({...v,stroke:g}),Mo({...T,stroke:g})]);t.texture=C,e.texture=E,i.texture=R,s.texture=I,t.position.set(0,0),e.position.set(p-x.size,0),i.position.set(0,m-v.size),s.position.set(p-T.size,m-T.size)}async function d({width:p,height:m,stroke:g,cornerSizes:b}){const _=await xd(),{topLeft:x,topRight:v,bottomLeft:T,bottomRight:C}=b;a.texture=_,n.texture=_,o.texture=_,h.texture=_,n.position.set(0,x.size),n.height=Math.max(m-x.size-T.size,0),n.width=g,o.position.set(p-g,v.size),o.height=Math.max(m-v.size-C.size,0),o.width=g,a.position.set(x.size,0),a.width=Math.max(p-x.size-v.size,0),a.height=g,h.position.set(T.size,m-g),h.width=Math.max(p-T.size-C.size,0),h.height=g}function f(p){t.tint=p,e.tint=p,i.tint=p,s.tint=p,a.tint=p,n.tint=p,o.tint=p,h.tint=p}return{element:r,render:l}}async function Dh(){const r=await Mt(),t=new Tt,{element:e,render:i}=await kh();async function s({selected:n,width:o,height:a}){if(!n)return t.removeChild(e),t;const{selectedBorderColor:h,selectedBorderWidth:l,selectedBorderOffset:c,selectedBorderRadius:u}=r.styles;return e.position.set(-c,-c),t.addChild(e),await i({stroke:l,radius:u,width:o+c*2,height:a+c*2,color:h}),t}return{element:t,render:s}}async function pI(){const r=await Mt(),t=new Tt,{element:e,render:i}=await vd(),{element:s,render:n}=await Dh();t.addChild(e),t.addChild(s);async function o({selected:a,width:h,height:l}){const{artifactBgColor:c,artifactBorderRadius:u}=r.styles,d={width:h,height:l,background:c,radius:u,capLeft:!0,capRight:!0};return await Promise.all([i(d),n({selected:a,width:h,height:l})]),t}return{element:t,render:o}}var mI=Object.defineProperty,gI=(r,t,e)=>t in r?mI(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ro=(r,t,e)=>(gI(r,typeof t!="symbol"?t+"":t,e),e);class yI extends Tt{constructor(t){super(),Ro(this,"_progress",0),Ro(this,"options"),Ro(this,"bgCircle",new Ir),Ro(this,"fillCircle",new Ir),Ro(this,"innerView",new Tt),this.options=t,this.addChild(this.innerView),this.innerView.addChild(this.bgCircle,this.fillCircle),this.addBackground(),t.value&&(this.progress=t.value)}addBackground(){const{backgroundColor:t,lineWidth:e,radius:i,backgroundAlpha:s}=this.options;let n=1;s>0&&(n=s),t===void 0&&(n=1e-6),this.bgCircle.lineStyle({width:e,color:t,alpha:n}).drawCircle(0,0,i)}set progress(t){t>100&&(t=100),t<0&&(t=0),this._progress=t;const{lineWidth:e,radius:i,fillColor:s,fillAlpha:n,cap:o}=this.options;if(t===0&&n===0){this.fillCircle.clear();return}const a=0,h=360/100*t;this.fillCircle.clear().lineStyle({width:e,color:s,cap:o,alpha:n}).arc(0,0,i,(-90+a)*Nc,(-90+a+h)*Nc)}get progress(){return this._progress}}async function bI(r={}){const t=await Sb(),e=new yI({fillColor:16777215,cullAtZoomThreshold:!0,backgroundColor:0,backgroundAlpha:1,value:50,cap:"round",fillAlpha:1,lineWidth:20,radius:50,...r});r.cullAtZoomThreshold&&t.add(e);function i(s){e.progress=s.value??0;const n=(s.radius+s.lineWidth)*2;return e.width=n,e.height=n,e.position.set(n/2),e}return{element:e,render:i}}const xI=Object.freeze(Object.defineProperty({__proto__:null,Artifact:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_19)'%3e%3cmask%20id='mask0_7_19'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_19)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.68182%205.63634C5.68182%205.15937%206.06849%204.77271%206.54546%204.77271H13.4546C13.9316%204.77271%2014.3182%205.15937%2014.3182%205.63634V14.2512C14.3182%2014.8932%2013.6426%2015.3108%2013.0683%2015.0237L11.8182%2014.3986L10.3863%2015.1146C10.1431%2015.2362%209.85691%2015.2362%209.61373%2015.1146L8.18182%2014.3986L6.93169%2015.0237C6.35746%2015.3108%205.68182%2014.8932%205.68182%2014.2512V5.63634ZM7.04546%206.13634V13.4423L7.7956%2013.0672C8.03873%2012.9456%208.32491%2012.9456%208.5681%2013.0672L10%2013.7832L11.4319%2013.0672C11.6751%2012.9456%2011.9613%2012.9456%2012.2045%2013.0672L12.9546%2013.4423V6.13634H7.04546Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%208.63631C6.36365%208.38531%206.56716%208.18176%206.81819%208.18176H6.98566C7.23669%208.18176%207.4402%208.38531%207.4402%208.63631C7.4402%208.88731%207.23669%209.09085%206.98566%209.09085H6.81819C6.56716%209.09085%206.36365%208.88731%206.36365%208.63631ZM7.78709%208.63631C7.78709%208.38531%207.9906%208.18176%208.24165%208.18176H8.57656C8.82765%208.18176%209.0311%208.38531%209.0311%208.63631C9.0311%208.88731%208.82765%209.09085%208.57656%209.09085H8.24165C7.9906%209.09085%207.78709%208.88731%207.78709%208.63631ZM9.37801%208.63631C9.37801%208.38531%209.58147%208.18176%209.83256%208.18176H10.1675C10.4186%208.18176%2010.622%208.38531%2010.622%208.63631C10.622%208.88731%2010.4186%209.09085%2010.1675%209.09085H9.83256C9.58147%209.09085%209.37801%208.88731%209.37801%208.63631ZM10.9689%208.63631C10.9689%208.38531%2011.1724%208.18176%2011.4235%208.18176H11.7584C12.0095%208.18176%2012.2129%208.38531%2012.2129%208.63631C12.2129%208.88731%2012.0095%209.09085%2011.7584%209.09085H11.4235C11.1724%209.09085%2010.9689%208.88731%2010.9689%208.63631ZM12.5598%208.63631C12.5598%208.38531%2012.7633%208.18176%2013.0144%208.18176H13.1818C13.4328%208.18176%2013.6364%208.38531%2013.6364%208.63631C13.6364%208.88731%2013.4328%209.09085%2013.1818%209.09085H13.0144C12.7633%209.09085%2012.5598%208.88731%2012.5598%208.63631Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_19'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactImage:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_36)'%3e%3cmask%20id='mask0_7_36'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_36)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.4718%2010.0244C11.2567%209.97354%2011.0304%2010.0028%2010.8353%2010.1067L2.29995%2014.6522C1.8568%2014.8882%201.68886%2015.4387%201.92486%2015.8818C2.16086%2016.325%202.71143%2016.4929%203.15458%2016.2569L11.3872%2011.8727L17.9726%2013.4302C18.4612%2013.5457%2018.951%2013.2433%2019.0665%2012.7546C19.1821%2012.2661%2018.8796%2011.7764%2018.3911%2011.6607L11.4718%2010.0244Z'%20fill='white'/%3e%3cpath%20d='M6.07329%209.09092C5.32016%209.09092%204.70966%208.48037%204.70966%207.72728C4.70966%206.97417%205.32016%206.36365%206.07329%206.36365C6.82643%206.36365%207.43693%206.97417%207.43693%207.72728C7.43693%208.48037%206.82643%209.09092%206.07329%209.09092Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_36'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactMarkdown:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_27)'%3e%3cmask%20id='mask0_7_27'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_27)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%2010C6.36365%209.49794%206.77067%209.09094%207.27274%209.09094H12.7273C13.2294%209.09094%2013.6364%209.49794%2013.6364%2010C13.6364%2010.5021%2013.2294%2010.9091%2012.7273%2010.9091H7.27274C6.77067%2010.9091%206.36365%2010.5021%206.36365%2010Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%2013.6364C6.36365%2013.1343%206.77067%2012.7273%207.27274%2012.7273H9.09092C9.59301%2012.7273%2010%2013.1343%2010%2013.6364C10%2014.1385%209.59301%2014.5455%209.09092%2014.5455H7.27274C6.77067%2014.5455%206.36365%2014.1385%206.36365%2013.6364Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%206.36368C6.36365%205.86161%206.77067%205.45459%207.27274%205.45459H11.8182C12.3203%205.45459%2012.7273%205.86161%2012.7273%206.36368C12.7273%206.86575%2012.3203%207.27277%2011.8182%207.27277H7.27274C6.77067%207.27277%206.36365%206.86575%206.36365%206.36368Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_27'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactProgress:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_2)'%3e%3cmask%20id='mask0_7_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_2)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.04937%200.190318C8.681%200.0653727%209.33327%200%2010%200C10.6667%200%2011.319%200.0653727%2011.9506%200.190318L11.5978%201.97394C11.0817%201.87185%2010.5475%201.81818%2010%201.81818C9.45245%201.81818%208.91827%201.87185%208.40218%201.97394L8.04937%200.190318ZM15.5568%201.68489C16.6469%202.41471%2017.5853%203.35308%2018.3151%204.4432L16.8043%205.45469C16.2066%204.56206%2015.4379%203.79335%2014.5453%203.19574L15.5568%201.68489ZM1.68489%204.4432C2.41471%203.35308%203.35308%202.41471%204.4432%201.68489L5.45469%203.19574C4.56206%203.79335%203.79335%204.56206%203.19574%205.45469L1.68489%204.4432ZM19.8096%208.04937C19.9346%208.681%2020%209.33327%2020%2010C20%2010.6667%2019.9346%2011.319%2019.8096%2011.9506L18.0261%2011.5978C18.1282%2011.0817%2018.1818%2010.5475%2018.1818%2010C18.1818%209.45245%2018.1282%208.91827%2018.0261%208.40218L19.8096%208.04937ZM0%2010C0%209.33327%200.0653727%208.681%200.190318%208.04937L1.97394%208.40218C1.87185%208.91827%201.81818%209.45245%201.81818%2010C1.81818%2010.5475%201.87185%2011.0817%201.97394%2011.5978L0.190318%2011.9506C0.0653727%2011.319%200%2010.6667%200%2010ZM18.3151%2015.5568C17.5853%2016.6469%2016.6469%2017.5853%2015.5568%2018.3151L14.5453%2016.8043C15.4379%2016.2066%2016.2066%2015.4379%2016.8043%2014.5453L18.3151%2015.5568ZM4.4432%2018.3151C3.35308%2017.5853%202.41471%2016.6469%201.68489%2015.5568L3.19574%2014.5453C3.79335%2015.4379%204.56206%2016.2066%205.45469%2016.8043L4.4432%2018.3151ZM10%2020C9.33327%2020%208.681%2019.9346%208.04937%2019.8096L8.40218%2018.0261C8.91827%2018.1282%209.45245%2018.1818%2010%2018.1818C10.5475%2018.1818%2011.0817%2018.1282%2011.5978%2018.0261L11.9506%2019.8096C11.319%2019.9346%2010.6667%2020%2010%2020Z'%20fill='white'/%3e%3cpath%20d='M10%2011.8181C8.99582%2011.8181%208.18182%2011.0041%208.18182%209.99994C8.18182%208.99576%208.99582%208.18176%2010%208.18176C11.0042%208.18176%2011.8182%208.99576%2011.8182%209.99994C11.8182%2011.0041%2011.0042%2011.8181%2010%2011.8181Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_2'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactResult:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_19)'%3e%3cmask%20id='mask0_7_19'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_19)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.68182%205.63634C5.68182%205.15937%206.06849%204.77271%206.54546%204.77271H13.4546C13.9316%204.77271%2014.3182%205.15937%2014.3182%205.63634V14.2512C14.3182%2014.8932%2013.6426%2015.3108%2013.0683%2015.0237L11.8182%2014.3986L10.3863%2015.1146C10.1431%2015.2362%209.85691%2015.2362%209.61373%2015.1146L8.18182%2014.3986L6.93169%2015.0237C6.35746%2015.3108%205.68182%2014.8932%205.68182%2014.2512V5.63634ZM7.04546%206.13634V13.4423L7.7956%2013.0672C8.03873%2012.9456%208.32491%2012.9456%208.5681%2013.0672L10%2013.7832L11.4319%2013.0672C11.6751%2012.9456%2011.9613%2012.9456%2012.2045%2013.0672L12.9546%2013.4423V6.13634H7.04546Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.36365%208.63631C6.36365%208.38531%206.56716%208.18176%206.81819%208.18176H6.98566C7.23669%208.18176%207.4402%208.38531%207.4402%208.63631C7.4402%208.88731%207.23669%209.09085%206.98566%209.09085H6.81819C6.56716%209.09085%206.36365%208.88731%206.36365%208.63631ZM7.78709%208.63631C7.78709%208.38531%207.9906%208.18176%208.24165%208.18176H8.57656C8.82765%208.18176%209.0311%208.38531%209.0311%208.63631C9.0311%208.88731%208.82765%209.09085%208.57656%209.09085H8.24165C7.9906%209.09085%207.78709%208.88731%207.78709%208.63631ZM9.37801%208.63631C9.37801%208.38531%209.58147%208.18176%209.83256%208.18176H10.1675C10.4186%208.18176%2010.622%208.38531%2010.622%208.63631C10.622%208.88731%2010.4186%209.09085%2010.1675%209.09085H9.83256C9.58147%209.09085%209.37801%208.88731%209.37801%208.63631ZM10.9689%208.63631C10.9689%208.38531%2011.1724%208.18176%2011.4235%208.18176H11.7584C12.0095%208.18176%2012.2129%208.38531%2012.2129%208.63631C12.2129%208.88731%2012.0095%209.09085%2011.7584%209.09085H11.4235C11.1724%209.09085%2010.9689%208.88731%2010.9689%208.63631ZM12.5598%208.63631C12.5598%208.38531%2012.7633%208.18176%2013.0144%208.18176H13.1818C13.4328%208.18176%2013.6364%208.38531%2013.6364%208.63631C13.6364%208.88731%2013.4328%209.09085%2013.1818%209.09085H13.0144C12.7633%209.09085%2012.5598%208.88731%2012.5598%208.63631Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_19'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ArtifactTable:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_7_9)'%3e%3cmask%20id='mask0_7_9'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='-1'%20y='-1'%20width='22'%20height='22'%3e%3cpath%20d='M20.9091%20-0.909058H-0.909088V20.9091H20.9091V-0.909058Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_7_9)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%2010C0%204.47715%204.47715%200%2010%200C15.5228%200%2020%204.47715%2020%2010C20%2015.5228%2015.5228%2020%2010%2020C4.47715%2020%200%2015.5228%200%2010ZM10%201.81818C5.4813%201.81818%201.81818%205.4813%201.81818%2010C1.81818%2014.5187%205.48131%2018.1818%2010%2018.1818C14.5187%2018.1818%2018.1818%2014.5187%2018.1818%2010C18.1818%205.48131%2014.5187%201.81818%2010%201.81818Z'%20fill='white'/%3e%3cpath%20d='M8.18183%205.45459H6.36365C5.86157%205.45459%205.45456%205.8616%205.45456%206.36368V8.18186C5.45456%208.68394%205.86157%209.09095%206.36365%209.09095H8.18183C8.68391%209.09095%209.09092%208.68394%209.09092%208.18186V6.36368C9.09092%205.8616%208.68391%205.45459%208.18183%205.45459Z'%20fill='white'/%3e%3cpath%20d='M13.6364%205.45459H11.8182C11.3161%205.45459%2010.9091%205.8616%2010.9091%206.36368V8.18186C10.9091%208.68394%2011.3161%209.09095%2011.8182%209.09095H13.6364C14.1384%209.09095%2014.5455%208.68394%2014.5455%208.18186V6.36368C14.5455%205.8616%2014.1384%205.45459%2013.6364%205.45459Z'%20fill='white'/%3e%3cpath%20d='M13.6364%2010.9091H11.8182C11.3161%2010.9091%2010.9091%2011.3161%2010.9091%2011.8181V13.6363C10.9091%2014.1384%2011.3161%2014.5454%2011.8182%2014.5454H13.6364C14.1384%2014.5454%2014.5455%2014.1384%2014.5455%2013.6363V11.8181C14.5455%2011.3161%2014.1384%2010.9091%2013.6364%2010.9091Z'%20fill='white'/%3e%3cpath%20d='M8.18183%2010.9091H6.36365C5.86157%2010.9091%205.45456%2011.3161%205.45456%2011.8181V13.6363C5.45456%2014.1384%205.86157%2014.5454%206.36365%2014.5454H8.18183C8.68391%2014.5454%209.09092%2014.1384%209.09092%2013.6363V11.8181C9.09092%2011.3161%208.68391%2010.9091%208.18183%2010.9091Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_7_9'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"}));function _I(r){const t={resolution:Il};return ot.from(xI[r],t)}async function vI(r){return await fo(_I,[r])}async function wI({cullAtZoomThreshold:r=!0}={}){const t=await Sb(),e=new jt;r&&t.add(e);async function i(s){const n=await vI(s);return e.texture=n,e}return{element:e,render:i}}var Qy={exports:{}};(function(r){(function(){function t(m,g){document.addEventListener?m.addEventListener("scroll",g,!1):m.attachEvent("scroll",g)}function e(m){document.body?m():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),m()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),m())})}function i(m){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(m)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function s(m,g){m.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+g+";"}function n(m){var g=m.g.offsetWidth,b=g+100;return m.j.style.width=b+"px",m.i.scrollLeft=b,m.h.scrollLeft=m.h.scrollWidth+100,m.l!==g?(m.l=g,!0):!1}function o(m,g){function b(){var x=_;n(x)&&x.g.parentNode!==null&&g(x.l)}var _=m;t(m.h,b),t(m.i,b),n(m)}function a(m,g,b){g=g||{},b=b||window,this.family=m,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=b}var h=null,l=null,c=null,u=null;function d(m){return l===null&&(f(m)&&/Apple/.test(window.navigator.vendor)?(m=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!m&&603>parseInt(m[1],10)):l=!1),l}function f(m){return u===null&&(u=!!m.document.fonts),u}function p(m,g){var b=m.style,_=m.weight;if(c===null){var x=document.createElement("div");try{x.style.font="condensed 100px sans-serif"}catch{}c=x.style.font!==""}return[b,_,c?m.stretch:"","100px",g].join(" ")}a.prototype.load=function(m,g){var b=this,_=m||"BESbswy",x=0,v=g||3e3,T=new Date().getTime();return new Promise(function(C,E){if(f(b.context)&&!d(b.context)){var I=new Promise(function(N,F){function P(){new Date().getTime()-T>=v?F(Error(""+v+"ms timeout exceeded")):b.context.document.fonts.load(p(b,'"'+b.family+'"'),_).then(function(A){1<=A.length?N():setTimeout(P,25)},F)}P()}),R=new Promise(function(N,F){x=setTimeout(function(){F(Error(""+v+"ms timeout exceeded"))},v)});Promise.race([R,I]).then(function(){clearTimeout(x),C(b)},E)}else e(function(){function N(){var O;(O=D!=-1&&X!=-1||D!=-1&&B!=-1||X!=-1&&B!=-1)&&((O=D!=X&&D!=B&&X!=B)||(h===null&&(O=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!O&&(536>parseInt(O[1],10)||parseInt(O[1],10)===536&&11>=parseInt(O[2],10))),O=h&&(D==H&&X==H&&B==H||D==lt&&X==lt&&B==lt||D==W&&X==W&&B==W)),O=!O),O&&(L.parentNode!==null&&L.parentNode.removeChild(L),clearTimeout(x),C(b))}function F(){if(new Date().getTime()-T>=v)L.parentNode!==null&&L.parentNode.removeChild(L),E(Error(""+v+"ms timeout exceeded"));else{var O=b.context.document.hidden;(O===!0||O===void 0)&&(D=P.g.offsetWidth,X=A.g.offsetWidth,B=G.g.offsetWidth,N()),x=setTimeout(F,50)}}var P=new i(_),A=new i(_),G=new i(_),D=-1,X=-1,B=-1,H=-1,lt=-1,W=-1,L=document.createElement("div");L.dir="ltr",s(P,p(b,"sans-serif")),s(A,p(b,"serif")),s(G,p(b,"monospace")),L.appendChild(P.g),L.appendChild(A.g),L.appendChild(G.g),b.context.document.body.appendChild(L),H=P.g.offsetWidth,lt=A.g.offsetWidth,W=G.g.offsetWidth,F(),o(P,function(O){D=O,N()}),s(P,p(b,'"'+b.family+'",sans-serif')),o(A,function(O){X=O,N()}),s(A,p(b,'"'+b.family+'",serif')),o(G,function(O){B=O,N()}),s(G,p(b,'"'+b.family+'",monospace'))})})},r.exports=a})()})(Qy);var TI=Qy.exports;const SI=Zs(TI),qy={inter:{fontFamily:"Inter Variable",fontSize:16,lineHeight:20,fill:16777215}},t1={resolution:Il,chars:li.ASCII},e1="sans-serif",i1={inter:AI(qy.inter)};let wd=!1;async function CI(){const r=Object.values(qy);await Promise.all(r.map(t=>EI(t))),wd=!0,$.emit("fontsLoaded",i1)}async function EI(r){const{fontFamily:t,...e}=r,i=new SI(t);try{await i.load()}catch(s){console.error(s),console.warn(`fonts: font ${t} failed to load, falling back to ${e1}`),li.from(t,{fontFamily:e1,...e},t1);return}li.from(t,r,t1)}function II(){wd=!1}async function r1(){return wd?i1:await Fe("fontsLoaded")}function AI(r){const{fontFamily:t,...e}=r,i={fontName:t,...e};return s=>new GS(s,i)}async function Oh({cullAtZoomThreshold:r=!0}={}){const{inter:t}=await r1(),e=await Tb(),i=t("");r&&e.add(i);async function s(n){return i.text=n,await i}return{element:i,render:s}}async function s1({cullAtZoomThreshold:r}){const t=await Mt(),e=new Tt,i=new Tt,{element:s,render:n}=await wI({cullAtZoomThreshold:r}),{element:o,render:a}=await bI(),{element:h,render:l}=await Oh({cullAtZoomThreshold:r}),{element:c,render:u}=await pI();let d=!1,f=null,p;i.addChild(h),e.addChild(c),e.addChild(i);async function m(v){const{selected:T,name:C,type:E}=v;return d=T??d,f=C??f,p=E,p==="progress"?i.addChild(o):i.addChild(s),v.type==="progress"?await Promise.all([b(v.data),_()]):await Promise.all([g(),_()]),await x(),e}async function g(){if(p==="progress")return s;const v=Yr[p],{artifactIconSize:T,artifactIconColor:C,artifactPaddingLeft:E,artifactPaddingY:I}=t.styles,R=await n(v);return R.position={x:E,y:I},R.width=T,R.height=T,R.tint=C,R}async function b(v){const{artifactPaddingLeft:T,artifactPaddingRight:C,artifactPaddingY:E,artifactIconSize:I}=t.styles,R=20,N=(I-R*2)/2,F=a({value:v,radius:N,lineWidth:R});return f?F.position.x+=T:F.position.x+=(T+C)/2,F.position.y+=E,o}async function _(){if(!f)return h.visible=!1,h;await l(f);const{artifactPaddingLeft:v,artifactPaddingY:T,artifactTextColor:C,artifactIconSize:E,artifactContentGap:I}=t.styles,R=f?I:0,N=v+E+R,F=T;return h.tint=C,h.scale.set(.75),h.position={x:N,y:F},h.visible=!0,h}async function x(){const{artifactPaddingLeft:v,artifactPaddingRight:T,artifactPaddingY:C}=t.styles,E={selected:d,width:i.width+v+T,height:i.height+C*2};return await u(E)}return{element:e,render:m}}let Zt=null,Bh=!1;async function MI(){const r=await qt();r.on("click",()=>Di(null)),r.on("drag-start",()=>{Bh=!0}),r.on("drag-end",()=>{setTimeout(()=>{Bh=!1})})}function RI(){Zt=null,Bh=!1}function Di(r){if(!Bh&&!(!r&&!Zt||r&&ar(r))){if(Zt=r,r===null){$.emit("itemSelected",null);return}$.emit("itemSelected",r)}}function ar(r){if(Zt===null)return!1;const{kind:t}=r;switch(t){case"task-run":return ua(Zt)&&Zt.id===r.id;case"flow-run":return ua(Zt)&&Zt.id===r.id;case"artifact":return Vf(Zt)&&Zt.id===r.id;case"artifacts":return Hf(Zt)&&Zt.ids.length===r.ids.length&&Zt.ids.every(i=>r.ids.includes(i));case"state":return Kf(Zt)&&Zt.id===r.id;case"event":return Yf(Zt)&&Zt.id===r.id;case"events":return zf(Zt)&&Zt.ids.length===r.ids.length&&Zt.ids.every(i=>r.ids.includes(i));default:const e=t;throw new Error(`switch does not have case for value: ${e}`)}}function PI(){return Zt&&ua(Zt)?Zt:null}async function Td(r,{cullAtZoomThreshold:t=!0,enableLocalClickHandling:e=!1}={}){const{element:i,render:s}=await s1({cullAtZoomThreshold:t});let n=!1,o=r;i.eventMode="static",i.cursor="pointer",e&&i.on("click",u=>{u.stopPropagation(),Di({kind:"artifact",id:o.id})}),$.on("itemSelected",()=>{const u=ar({kind:"artifact",id:o.id});u!==n&&(n=u,a(o))});async function a(u){o=u,await s({selected:n,name:o.key,...o})}function h(){return n}function l(){return o.created}function c(){return o.id}return{isArtifact:!0,element:i,render:a,getSelected:h,getDate:l,getId:c}}function n1(r){return r.isArtifact===!0}function LI(r){return typeof r=="function"}function Uh(r){return LI(r)?r():r}async function o1(r,t){const e=await Bi(),i=await Mt();let s,n=null;async function o(){try{n=await i.fetchEvents(Uh(r)),t(n)}catch(h){console.error(h)}e.end_time||(s=setTimeout(()=>o(),i.fetchEventsInterval))}function a(){clearTimeout(s)}return{start:o,stop:a}}async function a1(){const r=await Mt(),t=await Tb(),e=new Tt,{element:i,render:s}=await Jy(),{element:n,render:o}=await vd(),{element:a,render:h}=await kh();t.add(e);let l=!1;e.eventMode="static",e.cursor="pointer",e.addChild(n),e.addChild(i),e.addChild(a),e.on("mouseover",u),e.on("mouseout",d);async function c({inside:f,isOpen:p}){l=f;const m={size:10,stroke:2,rotate:p?Nh.Up:Nh.Down},g=await s(m),b={width:r.styles.nodeToggleSize,height:r.styles.nodeToggleSize,background:r.styles.nodeToggleBgColor,radius:r.styles.nodeToggleBorderRadius},_=await o(b);_.alpha=f?0:.5;const x=await h({width:b.width,height:b.height,radius:b.radius,stroke:1,color:r.styles.nodeToggleBorderColor});x.alpha=f?0:1;const v={y:_.height/2,x:_.width/2},T=m.size/4;return g.x=v.x,g.y=p?v.y+T:v.y-T,e}function u(){n.alpha=l?.5:1}function d(){n.alpha=l?0:.5}return{element:e,render:c}}async function h1(){const r=await Mt(),t=await Qt(),e=new Tt,{element:i,render:s}=await vd(),{element:n,render:o}=await Dh();e.addChild(i),e.addChild(n);async function a(l){const{background:c="#fff"}=r.styles.node(l),{nodeHeight:u,nodeRadius:d}=r.styles,f=ar({kind:l.kind,id:l.id}),p=h(l,d),m=l.state_type!=="RUNNING"||t.isDependency();return await Promise.all([s({width:p,height:u,radius:d,background:c,capRight:m}),o({selected:f,width:p,height:u})]),i}function h(l,c){const u=gd();if(st.isTemporal()||st.isLeftAligned()){const d=l.start_time,f=l.end_time??new Date,m=zy(f,d)/_h*u;return Math.max(m,c*2)}return u}return{element:e,render:a}}var l1="Expected a function",c1=NaN,GI="[object Symbol]",FI=/^\s+|\s+$/g,NI=/^[-+]0x[0-9a-f]+$/i,kI=/^0b[01]+$/i,DI=/^0o[0-7]+$/i,OI=parseInt,BI=typeof be=="object"&&be&&be.Object===Object&&be,UI=typeof self=="object"&&self&&self.Object===Object&&self,XI=BI||UI||Function("return this")(),WI=Object.prototype,ZI=WI.toString,VI=Math.max,HI=Math.min,Sd=function(){return XI.Date.now()};function KI(r,t,e){var i,s,n,o,a,h,l=0,c=!1,u=!1,d=!0;if(typeof r!="function")throw new TypeError(l1);t=u1(t)||0,Xh(e)&&(c=!!e.leading,u="maxWait"in e,n=u?VI(u1(e.maxWait)||0,t):n,d="trailing"in e?!!e.trailing:d);function f(C){var E=i,I=s;return i=s=void 0,l=C,o=r.apply(I,E),o}function p(C){return l=C,a=setTimeout(b,t),c?f(C):o}function m(C){var E=C-h,I=C-l,R=t-E;return u?HI(R,n-I):R}function g(C){var E=C-h,I=C-l;return h===void 0||E>=t||E<0||u&&I>=n}function b(){var C=Sd();if(g(C))return _(C);a=setTimeout(b,m(C))}function _(C){return a=void 0,d&&i?f(C):(i=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),l=0,i=h=s=a=void 0}function v(){return a===void 0?o:_(Sd())}function T(){var C=Sd(),E=g(C);if(i=arguments,s=this,h=C,E){if(a===void 0)return p(h);if(u)return a=setTimeout(b,t),f(h)}return a===void 0&&(a=setTimeout(b,t)),o}return T.cancel=x,T.flush=v,T}function YI(r,t,e){var i=!0,s=!0;if(typeof r!="function")throw new TypeError(l1);return Xh(e)&&(i="leading"in e?!!e.leading:i,s="trailing"in e?!!e.trailing:s),KI(r,t,{leading:i,maxWait:t,trailing:s})}function Xh(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function zI(r){return!!r&&typeof r=="object"}function jI(r){return typeof r=="symbol"||zI(r)&&ZI.call(r)==GI}function u1(r){if(typeof r=="number")return r;if(jI(r))return c1;if(Xh(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Xh(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(FI,"");var e=kI.test(r);return e||DI.test(r)?OI(r.slice(2),e?2:8):NI.test(r)?c1:+r}var JI=YI;const d1=Zs(JI);async function f1(){const{element:r,render:t}=await s1({cullAtZoomThreshold:!1});let e=null,i=[],s=!1;r.eventMode="static",r.cursor="pointer",$.on("itemSelected",()=>{const l=ar({kind:"artifacts",ids:i});l!==s&&e&&(s=l,n({ids:i,date:e}))});async function n(l){if(!l){e=null,i=[],r.visible=!1;return}const{ids:c,date:u}=l;e=u,i=c,await t({selected:s,type:"unknown",name:c.length.toString()}),r.visible=!0}function o(){return s}function a(){return e}function h(){return i}return{isArtifactCluster:!0,element:r,render:n,getSelected:o,getDate:a,getIds:h,isCluster:!0}}async function $I({radius:r}){const t=await Jt(),e=new Ir;return e.beginFill("#fff"),e.drawCircle(0,0,r),e.endFill(),t.renderer.generateTexture(e,{resolution:El})}async function QI(r){return await fo($I,[r])}async function p1(r){const t=await QI(r);return new jt(t)}async function m1(r){const t=new Tt,e=await Mt(),i=await or(),s=await p1({radius:e.styles.eventRadiusDefault}),{element:n,render:o}=await Dh();let a=!1;t.addChild(i),t.addChild(s),t.addChild(n),t.eventMode="static",t.cursor="pointer",t.on("mouseenter",()=>{a||s.scale.set(1.5)}),t.on("mouseleave",()=>{a||s.scale.set(1)}),$.on("itemSelected",()=>{const u=ar({kind:"event",id:r.id,occurred:r.occurred});u!==a&&(a=u,s.scale.set(u?1.5:1),h())});function h(){const{eventColor:u,eventTargetSize:d,eventSelectedBorderInset:f}=e.styles;i.alpha=0,i.width=d,i.height=d,s.tint=u,s.anchor.set(.5),s.position.set(d/2,d/2),n.position.set(f,f),o({selected:a,width:d-f*2,height:d-f*2})}function l(){return r.id}function c(){return r.occurred}return{element:t,render:h,getId:l,getDate:c}}async function g1(){const r=new Tt,t=await Mt(),e=await or(),i=await p1({radius:t.styles.eventClusterRadiusDefault}),{element:s,render:n}=await Dh(),{element:o,render:a}=await Oh({cullAtZoomThreshold:!1});let h=null,l=[],c=!1;r.addChild(e),r.addChild(i),r.addChild(o),r.addChild(s),r.eventMode="static",r.cursor="pointer",r.on("mouseenter",()=>{c||i.scale.set(1.5)}),r.on("mouseleave",()=>{c||i.scale.set(1)}),$.on("itemSelected",()=>{const _=ar({kind:"events",occurred:h,ids:l});_!==c&&(c=_,i.scale.set(_?1.5:1),h&&u({ids:l,date:h}))});async function u(_){if(!_){h=null,l=[],r.visible=!1;return}const{ids:x,date:v}=_;h=v,l=x,d(),f(),m(),await p(x.length.toString()),r.visible=!0}function d(){const{eventTargetSize:_}=t.styles;e.alpha=0,e.width=_,e.height=_}function f(){const{eventClusterColor:_,eventTargetSize:x}=t.styles;i.tint=_,i.anchor.set(.5),i.position.set(x/2,x/2)}async function p(_){if(l.length<2)return;const{eventTargetSize:x}=t.styles,v=-1;o.scale.set(.6),o.anchor.set(.5),o.position.set(x/2,x/2+v),await a(_)}function m(){const{eventSelectedBorderInset:_,eventTargetSize:x}=t.styles;s.position.set(_,_),n({selected:c,width:x-_*2,height:x-_*2})}function g(){return l}function b(){return h}return{element:r,render:u,getIds:g,getDate:b}}function Wh(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function qI(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Cd(r){let t,e,i;r.length!==2?(t=Wh,e=(a,h)=>Wh(r(a),h),i=(a,h)=>r(a)-h):(t=r===Wh||r===qI?r:tA,e=r,i=r);function s(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<0?l=u+1:c=u}while(l<c)}return l}function n(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<=0?l=u+1:c=u}while(l<c)}return l}function o(a,h,l=0,c=a.length){const u=s(a,h,l,c-1);return u>l&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:s,center:o,right:n}}function tA(){return 0}function eA(r){return r===null?NaN:+r}const iA=Cd(Wh).right;Cd(eA).center;const rA=Math.sqrt(50),sA=Math.sqrt(10),nA=Math.sqrt(2);function Zh(r,t,e){const i=(t-r)/Math.max(0,e),s=Math.floor(Math.log10(i)),n=i/Math.pow(10,s),o=n>=rA?10:n>=sA?5:n>=nA?2:1;let a,h,l;return s<0?(l=Math.pow(10,-s)/o,a=Math.round(r*l),h=Math.round(t*l),a/l<r&&++a,h/l>t&&--h,l=-l):(l=Math.pow(10,s)*o,a=Math.round(r/l),h=Math.round(t/l),a*l<r&&++a,h*l>t&&--h),h<a&&.5<=e&&e<2?Zh(r,t,e*2):[a,h,l]}function oA(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];const i=t<r,[s,n,o]=i?Zh(t,r,e):Zh(r,t,e);if(!(n>=s))return[];const a=n-s+1,h=new Array(a);if(i)if(o<0)for(let l=0;l<a;++l)h[l]=(n-l)/-o;else for(let l=0;l<a;++l)h[l]=(n-l)*o;else if(o<0)for(let l=0;l<a;++l)h[l]=(s+l)/-o;else for(let l=0;l<a;++l)h[l]=(s+l)*o;return h}function Ed(r,t,e){return t=+t,r=+r,e=+e,Zh(r,t,e)[2]}function Id(r,t,e){t=+t,r=+r,e=+e;const i=t<r,s=i?Ed(t,r,e):Ed(r,t,e);return(i?-1:1)*(s<0?1/-s:s)}function Ad(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function y1(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function Po(){}var Lo=.7,Vh=1/Lo,Tn="\\s*([+-]?\\d+)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aA=/^#([0-9a-f]{3,8})$/,hA=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),lA=new RegExp(`^rgb\\(${Oi},${Oi},${Oi}\\)$`),cA=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${Go}\\)$`),uA=new RegExp(`^rgba\\(${Oi},${Oi},${Oi},${Go}\\)$`),dA=new RegExp(`^hsl\\(${Go},${Oi},${Oi}\\)$`),fA=new RegExp(`^hsla\\(${Go},${Oi},${Oi},${Go}\\)$`),b1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ad(Po,Fo,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:x1,formatHex:x1,formatHex8:pA,formatHsl:mA,formatRgb:_1,toString:_1});function x1(){return this.rgb().formatHex()}function pA(){return this.rgb().formatHex8()}function mA(){return C1(this).formatHsl()}function _1(){return this.rgb().formatRgb()}function Fo(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=aA.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?v1(t):e===3?new Me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Hh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Hh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hA.exec(r))?new Me(t[1],t[2],t[3],1):(t=lA.exec(r))?new Me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cA.exec(r))?Hh(t[1],t[2],t[3],t[4]):(t=uA.exec(r))?Hh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dA.exec(r))?S1(t[1],t[2]/100,t[3]/100,1):(t=fA.exec(r))?S1(t[1],t[2]/100,t[3]/100,t[4]):b1.hasOwnProperty(r)?v1(b1[r]):r==="transparent"?new Me(NaN,NaN,NaN,0):null}function v1(r){return new Me(r>>16&255,r>>8&255,r&255,1)}function Hh(r,t,e,i){return i<=0&&(r=t=e=NaN),new Me(r,t,e,i)}function gA(r){return r instanceof Po||(r=Fo(r)),r?(r=r.rgb(),new Me(r.r,r.g,r.b,r.opacity)):new Me}function Md(r,t,e,i){return arguments.length===1?gA(r):new Me(r,t,e,i??1)}function Me(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}Ad(Me,Md,y1(Po,{brighter(r){return r=r==null?Vh:Math.pow(Vh,r),new Me(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Lo:Math.pow(Lo,r),new Me(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Me(Cs(this.r),Cs(this.g),Cs(this.b),Kh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w1,formatHex:w1,formatHex8:yA,formatRgb:T1,toString:T1}));function w1(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function yA(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function T1(){const r=Kh(this.opacity);return`${r===1?"rgb(":"rgba("}${Cs(this.r)}, ${Cs(this.g)}, ${Cs(this.b)}${r===1?")":`, ${r})`}`}function Kh(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function Cs(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Es(r){return r=Cs(r),(r<16?"0":"")+r.toString(16)}function S1(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new ci(r,t,e,i)}function C1(r){if(r instanceof ci)return new ci(r.h,r.s,r.l,r.opacity);if(r instanceof Po||(r=Fo(r)),!r)return new ci;if(r instanceof ci)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,s=Math.min(t,e,i),n=Math.max(t,e,i),o=NaN,a=n-s,h=(n+s)/2;return a?(t===n?o=(e-i)/a+(e<i)*6:e===n?o=(i-t)/a+2:o=(t-e)/a+4,a/=h<.5?n+s:2-n-s,o*=60):a=h>0&&h<1?0:o,new ci(o,a,h,r.opacity)}function bA(r,t,e,i){return arguments.length===1?C1(r):new ci(r,t,e,i??1)}function ci(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}Ad(ci,bA,y1(Po,{brighter(r){return r=r==null?Vh:Math.pow(Vh,r),new ci(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Lo:Math.pow(Lo,r),new ci(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,s=2*e-i;return new Me(Rd(r>=240?r-240:r+120,s,i),Rd(r,s,i),Rd(r<120?r+240:r-120,s,i),this.opacity)},clamp(){return new ci(E1(this.h),Yh(this.s),Yh(this.l),Kh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Kh(this.opacity);return`${r===1?"hsl(":"hsla("}${E1(this.h)}, ${Yh(this.s)*100}%, ${Yh(this.l)*100}%${r===1?")":`, ${r})`}`}}));function E1(r){return r=(r||0)%360,r<0?r+360:r}function Yh(r){return Math.max(0,Math.min(1,r||0))}function Rd(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const Pd=r=>()=>r;function xA(r,t){return function(e){return r+e*t}}function _A(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function vA(r){return(r=+r)==1?I1:function(t,e){return e-t?_A(t,e,r):Pd(isNaN(t)?e:t)}}function I1(r,t){var e=t-r;return e?xA(r,e):Pd(isNaN(r)?t:r)}const A1=function r(t){var e=vA(t);function i(s,n){var o=e((s=Md(s)).r,(n=Md(n)).r),a=e(s.g,n.g),h=e(s.b,n.b),l=I1(s.opacity,n.opacity);return function(c){return s.r=o(c),s.g=a(c),s.b=h(c),s.opacity=l(c),s+""}}return i.gamma=r,i}(1);function wA(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),s;return function(n){for(s=0;s<e;++s)i[s]=r[s]*(1-n)+t[s]*n;return i}}function TA(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function SA(r,t){var e=t?t.length:0,i=r?Math.min(e,r.length):0,s=new Array(i),n=new Array(e),o;for(o=0;o<i;++o)s[o]=Fd(r[o],t[o]);for(;o<e;++o)n[o]=t[o];return function(a){for(o=0;o<i;++o)n[o]=s[o](a);return n}}function CA(r,t){var e=new Date;return r=+r,t=+t,function(i){return e.setTime(r*(1-i)+t*i),e}}function zh(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function EA(r,t){var e={},i={},s;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in r?e[s]=Fd(r[s],t[s]):i[s]=t[s];return function(n){for(s in e)i[s]=e[s](n);return i}}var Ld=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gd=new RegExp(Ld.source,"g");function IA(r){return function(){return r}}function AA(r){return function(t){return r(t)+""}}function MA(r,t){var e=Ld.lastIndex=Gd.lastIndex=0,i,s,n,o=-1,a=[],h=[];for(r=r+"",t=t+"";(i=Ld.exec(r))&&(s=Gd.exec(t));)(n=s.index)>e&&(n=t.slice(e,n),a[o]?a[o]+=n:a[++o]=n),(i=i[0])===(s=s[0])?a[o]?a[o]+=s:a[++o]=s:(a[++o]=null,h.push({i:o,x:zh(i,s)})),e=Gd.lastIndex;return e<t.length&&(n=t.slice(e),a[o]?a[o]+=n:a[++o]=n),a.length<2?h[0]?AA(h[0].x):IA(t):(t=h.length,function(l){for(var c=0,u;c<t;++c)a[(u=h[c]).i]=u.x(l);return a.join("")})}function Fd(r,t){var e=typeof t,i;return t==null||e==="boolean"?Pd(t):(e==="number"?zh:e==="string"?(i=Fo(t))?(t=i,A1):MA:t instanceof Fo?A1:t instanceof Date?CA:TA(t)?wA:Array.isArray(t)?SA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?EA:zh)(r,t)}function RA(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function PA(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function jh(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Sn(r){return r=jh(Math.abs(r)),r?r[1]:NaN}function LA(r,t){return function(e,i){for(var s=e.length,n=[],o=0,a=r[0],h=0;s>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),n.push(e.substring(s-=a,s+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return n.reverse().join(t)}}function GA(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var FA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jh(r){if(!(t=FA.exec(r)))throw new Error("invalid format: "+r);var t;return new Nd({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jh.prototype=Nd.prototype;function Nd(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}Nd.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function NA(r){t:for(var t=r.length,e=1,i=-1,s;e<t;++e)switch(r[e]){case".":i=s=e;break;case"0":i===0&&(i=e),s=e;break;default:if(!+r[e])break t;i>0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(s+1):r}var M1;function kA(r,t){var e=jh(r,t);if(!e)return r+"";var i=e[0],s=e[1],n=s-(M1=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=i.length;return n===o?i:n>o?i+new Array(n-o+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+new Array(1-n).join("0")+jh(r,Math.max(0,t+n-1))[0]}function R1(r,t){var e=jh(r,t);if(!e)return r+"";var i=e[0],s=e[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const P1={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:PA,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>R1(r*100,t),r:R1,s:kA,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function L1(r){return r}var G1=Array.prototype.map,F1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DA(r){var t=r.grouping===void 0||r.thousands===void 0?L1:LA(G1.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",s=r.decimal===void 0?".":r.decimal+"",n=r.numerals===void 0?L1:GA(G1.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=Jh(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,b=u.width,_=u.comma,x=u.precision,v=u.trim,T=u.type;T==="n"?(_=!0,T="g"):P1[T]||(x===void 0&&(x=12),v=!0,T="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var C=m==="$"?e:m==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",E=m==="$"?i:/[%p]/.test(T)?o:"",I=P1[T],R=/[defgprs%]/.test(T);x=x===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function N(F){var P=C,A=E,G,D,X;if(T==="c")A=I(F)+A,F="";else{F=+F;var B=F<0||1/F<0;if(F=isNaN(F)?h:I(Math.abs(F),x),v&&(F=NA(F)),B&&+F==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:a:p==="-"||p==="("?"":p)+P,A=(T==="s"?F1[8+M1/3]:"")+A+(B&&p==="("?")":""),R){for(G=-1,D=F.length;++G<D;)if(X=F.charCodeAt(G),48>X||X>57){A=(X===46?s+F.slice(G+1):F.slice(G))+A,F=F.slice(0,G);break}}}_&&!g&&(F=t(F,1/0));var H=P.length+F.length+A.length,lt=H<b?new Array(b-H+1).join(d):"";switch(_&&g&&(F=t(lt+F,lt.length?b-A.length:1/0),lt=""),f){case"<":F=P+F+A+lt;break;case"=":F=P+lt+F+A;break;case"^":F=lt.slice(0,H=lt.length>>1)+P+F+A+lt.slice(H);break;default:F=lt+P+F+A;break}return n(F)}return N.toString=function(){return u+""},N}function c(u,d){var f=l((u=Jh(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Sn(d)/3)))*3,m=Math.pow(10,-p),g=F1[8+p/3];return function(b){return f(m*b)+g}}return{format:l,formatPrefix:c}}var $h,N1,k1;OA({thousands:",",grouping:[3],currency:["$",""]});function OA(r){return $h=DA(r),N1=$h.format,k1=$h.formatPrefix,$h}function BA(r){return Math.max(0,-Sn(Math.abs(r)))}function UA(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sn(t)/3)))*3-Sn(Math.abs(r)))}function XA(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Sn(t)-Sn(r))+1}function D1(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}function WA(r){return function(){return r}}function ZA(r){return+r}var O1=[0,1];function Cn(r){return r}function kd(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:WA(isNaN(t)?NaN:.5)}function VA(r,t){var e;return r>t&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function HA(r,t,e){var i=r[0],s=r[1],n=t[0],o=t[1];return s<i?(i=kd(s,i),n=e(o,n)):(i=kd(i,s),n=e(n,o)),function(a){return n(i(a))}}function KA(r,t,e){var i=Math.min(r.length,t.length)-1,s=new Array(i),n=new Array(i),o=-1;for(r[i]<r[0]&&(r=r.slice().reverse(),t=t.slice().reverse());++o<i;)s[o]=kd(r[o],r[o+1]),n[o]=e(t[o],t[o+1]);return function(a){var h=iA(r,a,1,i)-1;return n[h](s[h](a))}}function B1(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function YA(){var r=O1,t=O1,e=Fd,i,s,n,o=Cn,a,h,l;function c(){var d=Math.min(r.length,t.length);return o!==Cn&&(o=VA(r[0],r[d-1])),a=d>2?KA:HA,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?n:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(s((l||(l=a(t,r.map(i),zh)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,ZA),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=RA,c()},u.clamp=function(d){return arguments.length?(o=d?!0:Cn,c()):o!==Cn},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(n=d,u):n},function(d,f){return i=d,s=f,c()}}function U1(){return YA()(Cn,Cn)}function zA(r,t,e,i){var s=Id(r,t,e),n;switch(i=Jh(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(n=UA(s,o))&&(i.precision=n),k1(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(n=XA(s,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=n-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(n=BA(s))&&(i.precision=n-(i.type==="%")*2);break}}return N1(i)}function jA(r){var t=r.domain;return r.ticks=function(e){var i=t();return oA(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var s=t();return zA(s[0],s[s.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),s=0,n=i.length-1,o=i[s],a=i[n],h,l,c=10;for(a<o&&(l=o,o=a,a=l,l=s,s=n,n=l);c-- >0;){if(l=Ed(o,a,e),l===h)return i[s]=o,i[n]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function X1(){var r=U1();return r.copy=function(){return B1(r,X1())},D1.apply(r,arguments),jA(r)}function JA(r,t){r=r.slice();var e=0,i=r.length-1,s=r[e],n=r[i],o;return n<s&&(o=e,e=i,i=o,o=s,s=n,n=o),r[e]=t.floor(s),r[i]=t.ceil(n),r}const Dd=new Date,Od=new Date;function ie(r,t,e,i){function s(n){return r(n=arguments.length===0?new Date:new Date(+n)),n}return s.floor=n=>(r(n=new Date(+n)),n),s.ceil=n=>(r(n=new Date(n-1)),t(n,1),r(n),n),s.round=n=>{const o=s(n),a=s.ceil(n);return n-o<a-n?o:a},s.offset=(n,o)=>(t(n=new Date(+n),o==null?1:Math.floor(o)),n),s.range=(n,o,a)=>{const h=[];if(n=s.ceil(n),a=a==null?1:Math.floor(a),!(n<o)||!(a>0))return h;let l;do h.push(l=new Date(+n)),t(n,a),r(n);while(l<n&&n<o);return h},s.filter=n=>ie(o=>{if(o>=o)for(;r(o),!n(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!n(o););else for(;--a>=0;)for(;t(o,1),!n(o););}),e&&(s.count=(n,o)=>(Dd.setTime(+n),Od.setTime(+o),r(Dd),r(Od),Math.floor(e(Dd,Od))),s.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?s.filter(i?o=>i(o)%n===0:o=>s.count(0,o)%n===0):s)),s}const Qh=ie(()=>{},(r,t)=>{r.setTime(+r+t)},(r,t)=>t-r);Qh.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?ie(t=>{t.setTime(Math.floor(t/r)*r)},(t,e)=>{t.setTime(+t+e*r)},(t,e)=>(e-t)/r):Qh),Qh.range;const hr=1e3,$e=hr*60,lr=$e*60,cr=lr*24,Bd=cr*7,W1=cr*30,Ud=cr*365,En=ie(r=>{r.setTime(r-r.getMilliseconds())},(r,t)=>{r.setTime(+r+t*hr)},(r,t)=>(t-r)/hr,r=>r.getUTCSeconds());En.range;const Xd=ie(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*hr)},(r,t)=>{r.setTime(+r+t*$e)},(r,t)=>(t-r)/$e,r=>r.getMinutes());Xd.range,ie(r=>{r.setUTCSeconds(0,0)},(r,t)=>{r.setTime(+r+t*$e)},(r,t)=>(t-r)/$e,r=>r.getUTCMinutes()).range;const Wd=ie(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*hr-r.getMinutes()*$e)},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getHours());Wd.range,ie(r=>{r.setUTCMinutes(0,0,0)},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getUTCHours()).range;const No=ie(r=>r.setHours(0,0,0,0),(r,t)=>r.setDate(r.getDate()+t),(r,t)=>(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*$e)/cr,r=>r.getDate()-1);No.range;const Zd=ie(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/cr,r=>r.getUTCDate()-1);Zd.range,ie(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/cr,r=>Math.floor(r/cr)).range;function Is(r){return ie(t=>{t.setDate(t.getDate()-(t.getDay()+7-r)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*$e)/Bd)}const qh=Is(0),tl=Is(1),$A=Is(2),QA=Is(3),In=Is(4),qA=Is(5),tM=Is(6);qh.range,tl.range,$A.range,QA.range,In.range,qA.range,tM.range;function As(r){return ie(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-r)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/Bd)}const Z1=As(0),el=As(1),eM=As(2),iM=As(3),An=As(4),rM=As(5),sM=As(6);Z1.range,el.range,eM.range,iM.range,An.range,rM.range,sM.range;const Vd=ie(r=>{r.setDate(1),r.setHours(0,0,0,0)},(r,t)=>{r.setMonth(r.getMonth()+t)},(r,t)=>t.getMonth()-r.getMonth()+(t.getFullYear()-r.getFullYear())*12,r=>r.getMonth());Vd.range,ie(r=>{r.setUTCDate(1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCMonth(r.getUTCMonth()+t)},(r,t)=>t.getUTCMonth()-r.getUTCMonth()+(t.getUTCFullYear()-r.getUTCFullYear())*12,r=>r.getUTCMonth()).range;const ur=ie(r=>{r.setMonth(0,1),r.setHours(0,0,0,0)},(r,t)=>{r.setFullYear(r.getFullYear()+t)},(r,t)=>t.getFullYear()-r.getFullYear(),r=>r.getFullYear());ur.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:ie(t=>{t.setFullYear(Math.floor(t.getFullYear()/r)*r),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*r)}),ur.range;const Ms=ie(r=>{r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCFullYear(r.getUTCFullYear()+t)},(r,t)=>t.getUTCFullYear()-r.getUTCFullYear(),r=>r.getUTCFullYear());Ms.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:ie(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/r)*r),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*r)}),Ms.range;function nM(r,t,e,i,s,n){const o=[[En,1,hr],[En,5,5*hr],[En,15,15*hr],[En,30,30*hr],[n,1,$e],[n,5,5*$e],[n,15,15*$e],[n,30,30*$e],[s,1,lr],[s,3,3*lr],[s,6,6*lr],[s,12,12*lr],[i,1,cr],[i,2,2*cr],[e,1,Bd],[t,1,W1],[t,3,3*W1],[r,1,Ud]];function a(l,c,u){const d=c<l;d&&([l,c]=[c,l]);const f=u&&typeof u.range=="function"?u:h(l,c,u),p=f?f.range(l,+c+1):[];return d?p.reverse():p}function h(l,c,u){const d=Math.abs(c-l)/u,f=Cd(([,,g])=>g).right(o,d);if(f===o.length)return r.every(Id(l/Ud,c/Ud,u));if(f===0)return Qh.every(Math.max(Id(l,c,u),1));const[p,m]=o[d/o[f-1][2]<o[f][2]/d?f-1:f];return p.every(m)}return[a,h]}const[oM,aM]=nM(ur,Vd,qh,No,Wd,Xd);function Hd(r){if(0<=r.y&&r.y<100){var t=new Date(-1,r.m,r.d,r.H,r.M,r.S,r.L);return t.setFullYear(r.y),t}return new Date(r.y,r.m,r.d,r.H,r.M,r.S,r.L)}function Kd(r){if(0<=r.y&&r.y<100){var t=new Date(Date.UTC(-1,r.m,r.d,r.H,r.M,r.S,r.L));return t.setUTCFullYear(r.y),t}return new Date(Date.UTC(r.y,r.m,r.d,r.H,r.M,r.S,r.L))}function ko(r,t,e){return{y:r,m:t,d:e,H:0,M:0,S:0,L:0}}function hM(r){var t=r.dateTime,e=r.date,i=r.time,s=r.periods,n=r.days,o=r.shortDays,a=r.months,h=r.shortMonths,l=Do(s),c=Oo(s),u=Do(n),d=Oo(n),f=Do(o),p=Oo(o),m=Do(a),g=Oo(a),b=Do(h),_=Oo(h),x={a:B,A:H,b:lt,B:W,c:null,d:j1,e:j1,f:PM,g:XM,G:ZM,H:AM,I:MM,j:RM,L:J1,m:LM,M:GM,p:L,q:O,Q:ib,s:rb,S:FM,u:NM,U:kM,V:DM,w:OM,W:BM,x:null,X:null,y:UM,Y:WM,Z:VM,"%":eb},v={a:U,A:tt,b:Q,B:xt,c:null,d:Q1,e:Q1,f:zM,g:sR,G:oR,H:HM,I:KM,j:YM,L:q1,m:jM,M:JM,p:Ct,q,Q:ib,s:rb,S:$M,u:QM,U:qM,V:tR,w:eR,W:iR,x:null,X:null,y:rR,Y:nR,Z:aR,"%":eb},T={a:N,A:F,b:P,B:A,c:G,d:Y1,e:Y1,f:SM,g:K1,G:H1,H:z1,I:z1,j:_M,L:TM,m:xM,M:vM,p:R,q:bM,Q:EM,s:IM,S:wM,u:fM,U:pM,V:mM,w:dM,W:gM,x:D,X,y:K1,Y:H1,Z:yM,"%":CM};x.x=C(e,x),x.X=C(i,x),x.c=C(t,x),v.x=C(e,v),v.X=C(i,v),v.c=C(t,v);function C(Z,Y){return function(z){var k=[],ut=-1,gt=0,At=Z.length,Ft,Pe,Ue;for(z instanceof Date||(z=new Date(+z));++ut<At;)Z.charCodeAt(ut)===37&&(k.push(Z.slice(gt,ut)),(Pe=V1[Ft=Z.charAt(++ut)])!=null?Ft=Z.charAt(++ut):Pe=Ft==="e"?" ":"0",(Ue=Y[Ft])&&(Ft=Ue(z,Pe)),k.push(Ft),gt=ut+1);return k.push(Z.slice(gt,ut)),k.join("")}}function E(Z,Y){return function(z){var k=ko(1900,void 0,1),ut=I(k,Z,z+="",0),gt,At;if(ut!=z.length)return null;if("Q"in k)return new Date(k.Q);if("s"in k)return new Date(k.s*1e3+("L"in k?k.L:0));if(Y&&!("Z"in k)&&(k.Z=0),"p"in k&&(k.H=k.H%12+k.p*12),k.m===void 0&&(k.m="q"in k?k.q:0),"V"in k){if(k.V<1||k.V>53)return null;"w"in k||(k.w=1),"Z"in k?(gt=Kd(ko(k.y,0,1)),At=gt.getUTCDay(),gt=At>4||At===0?el.ceil(gt):el(gt),gt=Zd.offset(gt,(k.V-1)*7),k.y=gt.getUTCFullYear(),k.m=gt.getUTCMonth(),k.d=gt.getUTCDate()+(k.w+6)%7):(gt=Hd(ko(k.y,0,1)),At=gt.getDay(),gt=At>4||At===0?tl.ceil(gt):tl(gt),gt=No.offset(gt,(k.V-1)*7),k.y=gt.getFullYear(),k.m=gt.getMonth(),k.d=gt.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),At="Z"in k?Kd(ko(k.y,0,1)).getUTCDay():Hd(ko(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(At+5)%7:k.w+k.U*7-(At+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,Kd(k)):Hd(k)}}function I(Z,Y,z,k){for(var ut=0,gt=Y.length,At=z.length,Ft,Pe;ut<gt;){if(k>=At)return-1;if(Ft=Y.charCodeAt(ut++),Ft===37){if(Ft=Y.charAt(ut++),Pe=T[Ft in V1?Y.charAt(ut++):Ft],!Pe||(k=Pe(Z,z,k))<0)return-1}else if(Ft!=z.charCodeAt(k++))return-1}return k}function R(Z,Y,z){var k=l.exec(Y.slice(z));return k?(Z.p=c.get(k[0].toLowerCase()),z+k[0].length):-1}function N(Z,Y,z){var k=f.exec(Y.slice(z));return k?(Z.w=p.get(k[0].toLowerCase()),z+k[0].length):-1}function F(Z,Y,z){var k=u.exec(Y.slice(z));return k?(Z.w=d.get(k[0].toLowerCase()),z+k[0].length):-1}function P(Z,Y,z){var k=b.exec(Y.slice(z));return k?(Z.m=_.get(k[0].toLowerCase()),z+k[0].length):-1}function A(Z,Y,z){var k=m.exec(Y.slice(z));return k?(Z.m=g.get(k[0].toLowerCase()),z+k[0].length):-1}function G(Z,Y,z){return I(Z,t,Y,z)}function D(Z,Y,z){return I(Z,e,Y,z)}function X(Z,Y,z){return I(Z,i,Y,z)}function B(Z){return o[Z.getDay()]}function H(Z){return n[Z.getDay()]}function lt(Z){return h[Z.getMonth()]}function W(Z){return a[Z.getMonth()]}function L(Z){return s[+(Z.getHours()>=12)]}function O(Z){return 1+~~(Z.getMonth()/3)}function U(Z){return o[Z.getUTCDay()]}function tt(Z){return n[Z.getUTCDay()]}function Q(Z){return h[Z.getUTCMonth()]}function xt(Z){return a[Z.getUTCMonth()]}function Ct(Z){return s[+(Z.getUTCHours()>=12)]}function q(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var Y=C(Z+="",x);return Y.toString=function(){return Z},Y},parse:function(Z){var Y=E(Z+="",!1);return Y.toString=function(){return Z},Y},utcFormat:function(Z){var Y=C(Z+="",v);return Y.toString=function(){return Z},Y},utcParse:function(Z){var Y=E(Z+="",!0);return Y.toString=function(){return Z},Y}}}var V1={"-":"",_:" ",0:"0"},le=/^\s*\d+/,lM=/^%/,cM=/[\\^$*+?|[\]().{}]/g;function It(r,t,e){var i=r<0?"-":"",s=(i?-r:r)+"",n=s.length;return i+(n<e?new Array(e-n+1).join(t)+s:s)}function uM(r){return r.replace(cM,"\\$&")}function Do(r){return new RegExp("^(?:"+r.map(uM).join("|")+")","i")}function Oo(r){return new Map(r.map((t,e)=>[t.toLowerCase(),e]))}function dM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.w=+i[0],e+i[0].length):-1}function fM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.u=+i[0],e+i[0].length):-1}function pM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.U=+i[0],e+i[0].length):-1}function mM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.V=+i[0],e+i[0].length):-1}function gM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.W=+i[0],e+i[0].length):-1}function H1(r,t,e){var i=le.exec(t.slice(e,e+4));return i?(r.y=+i[0],e+i[0].length):-1}function K1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function yM(r,t,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return i?(r.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function bM(r,t,e){var i=le.exec(t.slice(e,e+1));return i?(r.q=i[0]*3-3,e+i[0].length):-1}function xM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.m=i[0]-1,e+i[0].length):-1}function Y1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.d=+i[0],e+i[0].length):-1}function _M(r,t,e){var i=le.exec(t.slice(e,e+3));return i?(r.m=0,r.d=+i[0],e+i[0].length):-1}function z1(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.H=+i[0],e+i[0].length):-1}function vM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.M=+i[0],e+i[0].length):-1}function wM(r,t,e){var i=le.exec(t.slice(e,e+2));return i?(r.S=+i[0],e+i[0].length):-1}function TM(r,t,e){var i=le.exec(t.slice(e,e+3));return i?(r.L=+i[0],e+i[0].length):-1}function SM(r,t,e){var i=le.exec(t.slice(e,e+6));return i?(r.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function CM(r,t,e){var i=lM.exec(t.slice(e,e+1));return i?e+i[0].length:-1}function EM(r,t,e){var i=le.exec(t.slice(e));return i?(r.Q=+i[0],e+i[0].length):-1}function IM(r,t,e){var i=le.exec(t.slice(e));return i?(r.s=+i[0],e+i[0].length):-1}function j1(r,t){return It(r.getDate(),t,2)}function AM(r,t){return It(r.getHours(),t,2)}function MM(r,t){return It(r.getHours()%12||12,t,2)}function RM(r,t){return It(1+No.count(ur(r),r),t,3)}function J1(r,t){return It(r.getMilliseconds(),t,3)}function PM(r,t){return J1(r,t)+"000"}function LM(r,t){return It(r.getMonth()+1,t,2)}function GM(r,t){return It(r.getMinutes(),t,2)}function FM(r,t){return It(r.getSeconds(),t,2)}function NM(r){var t=r.getDay();return t===0?7:t}function kM(r,t){return It(qh.count(ur(r)-1,r),t,2)}function $1(r){var t=r.getDay();return t>=4||t===0?In(r):In.ceil(r)}function DM(r,t){return r=$1(r),It(In.count(ur(r),r)+(ur(r).getDay()===4),t,2)}function OM(r){return r.getDay()}function BM(r,t){return It(tl.count(ur(r)-1,r),t,2)}function UM(r,t){return It(r.getFullYear()%100,t,2)}function XM(r,t){return r=$1(r),It(r.getFullYear()%100,t,2)}function WM(r,t){return It(r.getFullYear()%1e4,t,4)}function ZM(r,t){var e=r.getDay();return r=e>=4||e===0?In(r):In.ceil(r),It(r.getFullYear()%1e4,t,4)}function VM(r){var t=r.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+It(t/60|0,"0",2)+It(t%60,"0",2)}function Q1(r,t){return It(r.getUTCDate(),t,2)}function HM(r,t){return It(r.getUTCHours(),t,2)}function KM(r,t){return It(r.getUTCHours()%12||12,t,2)}function YM(r,t){return It(1+Zd.count(Ms(r),r),t,3)}function q1(r,t){return It(r.getUTCMilliseconds(),t,3)}function zM(r,t){return q1(r,t)+"000"}function jM(r,t){return It(r.getUTCMonth()+1,t,2)}function JM(r,t){return It(r.getUTCMinutes(),t,2)}function $M(r,t){return It(r.getUTCSeconds(),t,2)}function QM(r){var t=r.getUTCDay();return t===0?7:t}function qM(r,t){return It(Z1.count(Ms(r)-1,r),t,2)}function tb(r){var t=r.getUTCDay();return t>=4||t===0?An(r):An.ceil(r)}function tR(r,t){return r=tb(r),It(An.count(Ms(r),r)+(Ms(r).getUTCDay()===4),t,2)}function eR(r){return r.getUTCDay()}function iR(r,t){return It(el.count(Ms(r)-1,r),t,2)}function rR(r,t){return It(r.getUTCFullYear()%100,t,2)}function sR(r,t){return r=tb(r),It(r.getUTCFullYear()%100,t,2)}function nR(r,t){return It(r.getUTCFullYear()%1e4,t,4)}function oR(r,t){var e=r.getUTCDay();return r=e>=4||e===0?An(r):An.ceil(r),It(r.getUTCFullYear()%1e4,t,4)}function aR(){return"+0000"}function eb(){return"%"}function ib(r){return+r}function rb(r){return Math.floor(+r/1e3)}var Mn,sb;hR({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hR(r){return Mn=hM(r),sb=Mn.format,Mn.parse,Mn.utcFormat,Mn.utcParse,Mn}function lR(r){return new Date(r)}function cR(r){return r instanceof Date?+r:+new Date(+r)}function nb(r,t,e,i,s,n,o,a,h,l){var c=U1(),u=c.invert,d=c.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),b=l("%a %d"),_=l("%b %d"),x=l("%B"),v=l("%Y");function T(C){return(h(C)<C?f:a(C)<C?p:o(C)<C?m:n(C)<C?g:i(C)<C?s(C)<C?b:_:e(C)<C?x:v)(C)}return c.invert=function(C){return new Date(u(C))},c.domain=function(C){return arguments.length?d(Array.from(C,cR)):d().map(lR)},c.ticks=function(C){var E=d();return r(E[0],E[E.length-1],C??10)},c.tickFormat=function(C,E){return E==null?T:l(E)},c.nice=function(C){var E=d();return(!C||typeof C.range!="function")&&(C=t(E[0],E[E.length-1],C??10)),C?d(JA(E,C)):c},c.copy=function(){return B1(c,nb(r,t,e,i,s,n,o,a,h,l))},c}function uR(){return D1.apply(nb(oM,aM,ur,Vd,qh,No,Wd,Xd,En,sb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Bo(r,t,e){this.k=r,this.x=t,this.y=e}Bo.prototype={constructor:Bo,scale:function(r){return r===1?this:new Bo(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new Bo(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Bo.prototype;function ob(r){return r.mode==="temporal"||r.mode==="left-aligned"?dR(r):fR(r)}function dR({domain:r,range:t}){return uR().domain(r).range(t)}function fR({domain:r,range:t}){return X1().domain(r).range(t)}function Yd(r){return{mode:st.horizontal,range:$E(),domain:QE(r)}}function pR(){return{mode:st.vertical}}let Rn=null;async function mR(){const r=await Bi();ab(r.start_time),$.on("layoutSettingsUpdated",()=>ab(r.start_time))}function gR(){Rn=null}async function Qe(){return Rn||await Fe("scaleCreated")}async function ab(r){await Qt();const t=Rn?"scaleUpdated":"scaleCreated",e=Yd(r);Rn=ob(e),$.emit(t,Rn)}function Ur(r){return"getIds"in r}async function hb({items:r,createCluster:t}){const e=[...r.values()].sort((o,a)=>o.element.x-a.element.x);async function i(o){let a,h=null,l=null;for(let c=o??0;c<e.length;c++){const u=e[c],d=u.element.x;if(u.element.visible=!0,h!==null&&a&&d<a){l=c;break}h=c,a=d+u.element.width}if(l!==null&&h!==null){const c=e[h],u=e[l];c.element.visible=!1,u.element.visible=!1;const d=await s(c,u);d&&(e.splice(h,1,d),e.splice(l,1)),i(h)}}async function s(o,a){const h=o.getDate(),l=a.getDate(),c=Ur(o)?o.getIds():[o.getId()],u=Ur(a)?a.getIds():[a.getId()];if(!h||!l)return console.error("flowRunArtifacts: visible item is missing date"),null;let d;Ur(o)?d=o:Ur(a)?d=a:d=await t();const f=[...c,...u],p=n(f);return await d.render({ids:f,date:p}),d}function n(o){const a=o.reduce((c,u)=>{const d=r.get(u),f=d==null?void 0:d.getDate();return f&&c.push(f.getTime()),c},[]),h=Math.min(...a),l=Math.max(...a);return new Date((h+l)/2)}await i()}async function lb(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Qt();let n=await Qe();const o=await h();o.element.on("click",c=>{c.stopPropagation();const{element:u}=o,d={x:u.position.x,y:u.position.y,width:u.width,height:u.height},f=Ur(o)?{kind:"events",ids:o.getIds(),occurred:o.getDate(),position:d}:{kind:"event",id:o.getId(),occurred:o.getDate(),position:d};Di(f)}),$.on("scaleUpdated",c=>{n=c,l()}),$.on("viewportMoved",()=>l());async function a(c){await o.render(c),l()}async function h(){return r.type==="event"?await m1(r.event):await g1()}function l(){const c=o.getDate();if(!c||s.disableEvents||!st.isTemporal())return;const{element:u}=o,f=n(c)*e.scale._x+e.worldTransform.tx-u.width/2,p=t.screen.height-u.height-i.styles.eventBottomMargin;u.position.set(f,p)}return{...o,render:a}}async function cb(r){const t=await qt(),e=await Qt();let i=await Qe();const s=await o();s.element.on("click",h=>{h.stopPropagation();const{element:l}=s,c=l.getGlobalPosition(),u={x:c.x,y:c.y,width:l.width*t.scale.x,height:l.height*t.scale.y},d=Ur(s)?{kind:"events",ids:s.getIds(),occurred:s.getDate(),position:u}:{kind:"event",id:s.getId(),occurred:s.getDate(),position:u};Di(d)}),$.on("scaleUpdated",h=>{i=h,a()});async function n(h){await s.render(h),a()}async function o(){return r.type==="event"?await m1(r.event):await g1()}function a(){const h=s.getDate(),{parentStartDate:l}=r;if(!h||e.disableEvents||!st.isTemporal()||!l)return;const{element:c}=s,d=i(h)-i(l)-c.width/2,f=-c.height;c.position.set(d,f)}return{...s,render:n}}async function ub({isRoot:r,parentStartDate:t}={}){const e=await Qt(),i=new Map,s=new Map,n=[];let o=[];const a=new Tt;let h=null;$.on("scaleUpdated",()=>u());async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render();if(s.has(p.id))return await s.get(p.id);const m=(async()=>{const g=r?await lb({type:"event",event:p}):await cb({type:"event",event:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render()}function u(){e.disableEvents||!st.isTemporal()||d()}const d=d1(async()=>{o=[...n],await hb({items:i,createCluster:f});for(const p of o)p.render()},Pl);async function f(){if(o.length>0)return o.pop();const p=r?await lb({type:"cluster"}):await cb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}let Uo=null,Pn=null;async function yR(){const r=await Jt(),t=await Mt(),e=await Qt(),i=await Bi(),{element:s,render:n,update:o}=await ub({isRoot:!0});s.zIndex=np;async function a(l){if(!st.isTemporal()||e.disableEvents){r.stage.removeChild(s);return}r.stage.addChild(s),await n(l)}const h=await o1(()=>({nodeId:t.runId,since:i.start_time,until:i.end_time??new Date}),l=>{const c=Pn?"eventDataUpdated":"eventDataCreated";Pn=l,$.emit(c,Pn),a(l)});$.on("configUpdated",()=>a()),$.on("viewportMoved",()=>o()),$.on("layoutSettingsUpdated",()=>a()),Uo=h.stop,h.start()}function bR(){Uo==null||Uo(),Uo=null,Pn=null}async function xR(){return Pn||await Fe("eventDataCreated")}async function db(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Qt(),n=await xR();let o=await Qe(),a=n&&n.length>0;const h=await c();h.element.on("click",d=>{d.stopPropagation();const{element:f}=h,p=f.getGlobalPosition(),m={x:p.x,y:p.y,width:f.width,height:f.height},g=Ur(h)?{kind:"artifacts",ids:h.getIds(),position:m}:{kind:"artifact",id:h.getId()};Di(g)}),$.on("scaleUpdated",d=>{o=d,u()}),$.on("viewportMoved",()=>u()),$.on("eventDataCreated",d=>{a=d.length>0,u()}),$.on("eventDataUpdated",d=>{a=d.length>0,u()});async function l(d){if(n1(h)){if(r.type!=="artifact")throw new Error(`ArtifactFactory attempted to render a ${r.type}`);await h.render(r.artifact)}else await h.render(d);u()}async function c(){return r.type==="artifact"?await Td(r.artifact,{cullAtZoomThreshold:!1}):await f1()}function u(){const d=h.getDate();if(!d||!st.isTemporal()||s.disableArtifacts)return;const f=h.getSelected(),{element:p}=h,{eventTargetSize:m,flowStateSelectedBarHeight:g}=i.styles;let b=0;if(f){const{selectedBorderOffset:C,selectedBorderWidth:E}=i.styles;b=C+E*2}const x=o(d)*e.scale._x+e.worldTransform.tx-(p.width-b)/2,v=a&&!s.disableEvents?m:g,T=t.screen.height-(p.height-b)-v;p.position.set(x,T)}return{...h,render:l}}async function fb(r){const t=await qt(),e=await Mt(),i=await Qt();let s=await Qe();const n=await a();n.element.on("click",l=>{l.stopPropagation();const{element:c}=n,u=c.getGlobalPosition(),d={x:u.x,y:u.y,width:c.width*t.scale.x,height:c.height*t.scale.y},f=Ur(n)?{kind:"artifacts",ids:n.getIds(),position:d}:{kind:"artifact",id:n.getId()};Di(f)}),$.on("scaleUpdated",l=>{s=l,h()});async function o(l){if(n1(n)){if(r.type!=="artifact")throw new Error(`ArtifactFactory attempted to render a ${r.type}`);await n.render(r.artifact)}else await n.render(l);h()}async function a(){return r.type==="artifact"?await Td(r.artifact):await f1()}function h(){const l=n.getDate(),{parentStartDate:c}=r;if(!l||!st.isTemporal()||i.disableArtifacts||!c)return;const u=n.getSelected(),{element:d}=n;let f=0;if(u){const{selectedBorderOffset:b,selectedBorderWidth:_}=e.styles;f=b+_*2}const m=s(l)-s(c)-(d.width-f)/2,g=-(d.height-f);d.position.set(m,g)}return{...n,render:o}}async function pb({isRoot:r,parentStartDate:t}={}){const e=await Qt(),i=new Map,s=new Map,n=[];let o=[];const a=new Tt;let h=null;async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render(p);s.has(p.id)&&await s.get(p.id);const m=(async()=>{const g=r?await db({type:"artifact",artifact:p}):await fb({type:"artifact",artifact:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render(p)}function u(){if(!(e.disableArtifacts||!st.isTemporal())){if(!st.isTemporal()){a.visible=!1;return}a.visible=!0,a.position.x=0,d()}}const d=d1(async()=>{o=[...n],await hb({items:i,createCluster:f});for(const p of o)p.render()},Pl);async function f(){if(o.length>0)return o.pop();const p=r?await db({type:"cluster"}):await fb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}async function _R(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Bi();let n=await Qe();const o=new Tt,a=await or(),h=await or();let l=null,c=!1,u=!1;t.stage.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{c=!0,d()}),a.on("mouseleave",()=>{c=!1,d()}),a.on("click",()=>{const x={x:a.position.x,y:a.position.y,width:a.width,height:a.height};Di({...r,kind:"state",position:x})}),$.on("viewportMoved",()=>d()),$.on("scaleUpdated",x=>{n=x,d()}),$.on("itemSelected",()=>{const x=ar({kind:"state",...r});x!==u&&(u=x,c=!1,d())}),r.type==="RUNNING"&&!s.end_time&&g();function d(x){const{end:v}=x??{};if(v&&(l=v),s.end_time&&b(),!st.isTemporal()){h.visible=!1,o.visible=!1;return}const T=f();p(T),m(T),h.visible=!0,o.visible=!0}function f(){const{background:x="#fff"}=i.styles.state(r),v=Math.max(n(r.timestamp)*e.scale._x+e.worldTransform.tx,0);let T=0;return r.type==="RUNNING"&&!s.end_time?T=n(new Date)*e.scale._x+e.worldTransform.tx-v:l?T=n(l)*e.scale._x+e.worldTransform.tx-v:T=t.screen.width-v,{x:v,width:Math.max(T,0),background:x}}function p({x,width:v,background:T}){const{flowStateBarHeight:C,flowStateSelectedBarHeight:E}=i.styles,I=c||u?E:C;a.x=x,a.y=t.screen.height-I,a.width=v,a.height=I,a.tint=T}function m({x,width:v,background:T}){if(r.type==="RUNNING"){h.visible=!1;return}const{flowStateBarHeight:C,flowStateAreaAlpha:E}=i.styles;h.x=x,h.y=0,h.width=v,h.height=t.screen.height-C,h.tint=T,h.alpha=E}function g(){t.ticker.add(_)}function b(){t.ticker.remove(_)}function _(){d()}return{element:o,render:d}}function vR(r){return"isNodesFlowRunStateFactory"in r}async function wR(r){const t=await Jt(),e=await qt(),i=await Mt(),s=await Bi();let n=await Qe();const o=new Tt,a=await or(),h=await or();let l=null,c=null,u=0,d=0,f=!1,p=!1;o.visible=!1,o.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{f=!0,m()}),a.on("mouseleave",()=>{f=!1,m()}),a.on("click",C=>{C.stopPropagation();const E=a.getGlobalPosition(),I={x:E.x,y:E.y,width:a.width*e.scale.x,height:a.height*e.scale.y};Di({...r,kind:"state",position:I})}),h.eventMode="none",h.cursor="default",$.on("scaleUpdated",C=>{n=C,m()}),$.on("itemSelected",()=>{const C=ar({kind:"state",...r});C!==p&&(p=C,f=!1,m())}),r.type==="RUNNING"&&!s.end_time&&x();function m(C){const{end:E,parentStartDate:I,width:R,height:N}=C??{};if(E&&(l=E),I&&(c=I),R&&(u=R),N&&(d=N),s.end_time&&v(),!st.isTemporal()){o.visible=!1;return}if(!c||u<=0){o.visible=!1;return}const F=g();if(F.width<=0){o.visible=!1;return}b(F),_(F),o.visible=!0}function g(){const{background:C="#fff"}=i.styles.state(r);if(!c)return{x:0,width:0,background:C};const E=n(c);let I=n(r.timestamp)-E;if(I>=u)return{x:u,width:0,background:C};I<0&&(I=0);let R=n(l??new Date)-E;R>u&&(R=u);const N=Math.max(R-I,0);return{x:I,width:N,background:C}}function b({x:C,width:E,background:I}){const{flowStateBarHeight:R,flowStateSelectedBarHeight:N}=i.styles,F=f||p?N:R;a.x=C,a.y=d-F,a.width=E,a.height=F,a.tint=I}function _({x:C,width:E,background:I}){const{flowStateBarHeight:R,flowStateAreaAlpha:N,nodeHeight:F}=i.styles,P=F/2;h.x=C,h.y=P,h.width=E,h.height=d-R-P,h.tint=I,h.alpha=N}function x(){t.ticker.add(T)}function v(){t.ticker.remove(T)}function T(){m()}return{element:o,render:m,isNodesFlowRunStateFactory:!0}}function mb({isRoot:r}={}){const t=new Tt,e=new Map,i=new Map;let s=null;async function n(a,h){if(a&&(s=a),!s)return;const l=[];for(let c=0;c<s.length;c++)l.push(o(s[c],c,h));await Promise.all(l)}async function o(a,h,l){const c=s&&s.length>=h+1&&s[h+1],u=c?c.timestamp:void 0;let d;if(i.has(a.id)&&await i.get(a.id),e.has(a.id))d=e.get(a.id);else{const f=(async()=>{const p=r?await _R(a):await wR(a);e.set(a.id,p),t.addChild(p.element)})();i.set(a.id,f),await f,i.delete(a.id),d=e.get(a.id)}vR(d)?await d.render({end:u,...l}):await d.render(u?{end:u}:void 0)}return{element:t,render:n}}class gb extends Tt{updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t)this.children[t].updateTransform()}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(const t of this.children)if(t.calculateBounds(),t._mask){const e=t._mask.isMaskData?t._mask.maskObject:t._mask;e?(e.calculateBounds(),this._bounds.addBoundsMask(t._bounds,e._bounds)):this._bounds.addBounds(t._bounds)}else t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds);this._bounds.updateID=this._boundsID}}async function TR(r){const t=new gb,e=await Mt(),i=await Qt(),{element:s,render:n}=await h1(),{element:o,render:a}=await Oh(),{element:h,render:l}=await a1(),{element:c,render:u}=await kh(),{element:d,render:f,getSize:p,stopWorker:m}=await zd(),{element:g,render:b}=await mb(),{element:_,render:x,update:v}=await ub({parentStartDate:r.start_time}),{element:T,render:C,update:E}=await pb({parentStartDate:r.start_time});let I=!1,R=!1,N=r,F=!1;t.sortableChildren=!0,c.zIndex=Ll,s.zIndex=Fl,o.zIndex=Kn,h.zIndex=Kn,d.zIndex=Gl,_.zIndex=hp,g.zIndex=lp,T.zIndex=cp,c.eventMode="none",c.cursor="default";const{start:P,stop:A}=await Rg(N.id,q=>{R=!!q.artifacts&&q.artifacts.length>0,f(q),lt(q.states),L(q.artifacts),H()}),{start:G,stop:D}=await o1(()=>({nodeId:N.id,since:N.start_time,until:N.end_time??new Date}),q=>{I=q.length>0,W(q)});t.addChild(s),t.addChild(o),t.addChild(h),h.on("click",q=>{q.stopPropagation(),B()}),d.position={x:0,y:e.styles.nodeHeight+e.styles.nodesPadding},d.on("rendered",()=>{Zo(),xt()});async function X(q){return N=q,await n(q),await tt(),await Q(),F&&(await lt(),await W(),await L(),await H()),t}async function B(){F?await U():await O()}async function H(){const{background:q="#fff"}=e.styles.node(N),{width:Z,height:Y}=p(),{height:z}=Ct(),{nodeBorderRadius:k}=e.styles,ut=2;c.position={x:-ut,y:-ut};const gt=st.isTemporal()?z+ut*2:Y+ut*2;await u({width:Z+ut*2,height:gt,stroke:ut,radius:[k,k,0,0],color:q})}async function lt(q){const{height:Z}=Ct(),{width:Y}=s;await b(q??void 0,{parentStartDate:N.start_time,width:Y,height:Z})}async function W(q){if(!F||!st.isTemporal()||i.disableEvents){t.removeChild(_);return}t.addChild(_);const{height:Z}=Ct();if(_.position={x:0,y:Z-e.styles.eventBottomMargin},q){await x(q);return}await v()}async function L(q){if(!F||!st.isTemporal()||i.disableArtifacts){t.removeChild(T);return}t.addChild(T);const{eventTargetSize:Z,flowStateSelectedBarHeight:Y}=e.styles,{height:z}=Ct(),k=z-(I&&!i.disableEvents?Z:Y);if(T.position={x:0,y:k},q){await C(q);return}await E()}async function O(){F=!0,t.addChild(g),t.addChild(d),t.addChild(c),await Promise.all([P(),G(),X(N)]),xt()}async function U(){F=!1,t.removeChild(g),t.removeChild(d),t.removeChild(c),t.removeChild(_),t.removeChild(T),m(),await Promise.all([A(),D(),X(N)]),xt()}async function tt(){const q=e.styles.nodeToggleSize,Z=e.styles.nodeHeight-q,Y=s.width>q,z=await l({inside:Y,isOpen:F});return z.x=Y?Z/2:s.width+e.styles.nodePadding,z.y=Z/2,z}async function Q(){const q=await a(N.label),Z=e.styles.colorMode==="dark"?e.styles.textDefault:e.styles.textInverse,Y=e.styles.nodePadding,z=h.x+h.width+Y,k=s.width+Y,ut=s.width>z+q.width+Y,gt=e.styles.nodeHeight/2-q.height/2,At=ut?z:Math.max(k,z);return q.position={x:At,y:gt},q.tint=ut?Z:e.styles.textDefault,q}function xt(){F&&(lt(),W(),L(),H());const q=Ct();t.emit("resized",q)}function Ct(){const q=p(),{nodeHeight:Z,nodesPadding:Y,eventTargetSize:z,eventBottomMargin:k,artifactPaddingY:ut,artifactIconSize:gt}=e.styles,Ft=R&&st.isTemporal()&&!i.disableArtifacts?gt+ut*2:0,Ue=I&&st.isTemporal()&&!i.disableEvents?z+k:0,Ho=F?q.height+Ft+Ue+Y*2:0,Wr=F?q.width:0;return{height:Z+Ho,width:Math.max(Wr,t.width)}}return{kind:"flow-run",element:t,bar:s,render:X}}async function SR(r,t){const e=await Mt(),i=new gb,{element:s,render:n}=await Oh(),{element:o,render:a}=await kh(),{element:h,render:l}=await h1(),{element:c,render:u}=await a1(),{element:d,render:f,getSize:p,stopWorker:m}=await zd();i.addChild(h),i.addChild(s);let g=!1,b=r,_=t;i.sortableChildren=!0,o.zIndex=Ll,h.zIndex=Fl,s.zIndex=Kn,c.zIndex=Kn,d.zIndex=Gl,o.eventMode="none",o.cursor="default",d.position={x:0,y:e.styles.nodeHeight+e.styles.nodesPadding},d.on("rendered",()=>{Zo(),F()}),c.on("click",P=>{P.stopPropagation(),E()});async function x(P,A){return b=P,_=A,A&&i.addChild(c),await l(P),A&&await v(),g&&(A&&f(A),await C()),await T(),i}async function v(){const P=e.styles.nodeToggleSize,A=e.styles.nodeHeight-P,G=h.width>P,D=await u({inside:G,isOpen:g});return D.x=G?A/2:h.width+e.styles.nodePadding,D.y=A/2,D}async function T(){const P=await n(b.label),A=e.styles.colorMode==="dark"?e.styles.textDefault:e.styles.textInverse,G=e.styles.nodePadding,D=c.x+c.width+G,X=h.width+G,B=h.width>D+P.width+G,H=e.styles.nodeHeight/2-P.height/2,lt=B?D:Math.max(X,D);return P.position={x:lt,y:H},P.tint=B?A:e.styles.textDefault,P}async function C(){const{background:P="#fff"}=e.styles.node(b),{width:A,height:G}=p(),{height:D}=N(),{nodeBorderRadius:X}=e.styles,B=2;o.position={x:-B,y:-B};const H=st.isTemporal()?D+B*2:G+B*2;await a({width:A+B*2,height:H,stroke:B,radius:[X,X,0,0],color:P})}async function E(){g?await R():await I()}async function I(){if(g=!0,i.addChild(d),i.addChild(o),!_)throw new Error("Attempted to open without nested graph data");await Promise.all([f(_),x(b,_)]),F()}async function R(){g=!1,i.removeChild(d),i.removeChild(o),m(),await x(b,_),F()}function N(){const P=p(),{nodeHeight:A,nodesPadding:G}=e.styles,D=g?P.height+G*2:0,X=g?P.width:0;return{height:A+D,width:Math.max(X,i.width)}}function F(){g&&C();const P=N();i.emit("resized",P)}return{kind:"task-run",element:i,render:x,bar:h}}async function CR(r,t){const e=await Mt(),i=await Jt(),s=await wb(),n=await Qt();let o=null;const a=new Map,{animate:h}=await jy(),{element:l,render:c,bar:u}=await R(r,t);let d=r,f=t,p=null,m=!1,g=!1;s.add(l),l.eventMode="static",l.cursor="pointer",l.name=jf,l.on("click",P=>{P.stopPropagation(),Di({kind:d.kind,id:d.id})}),d.end_time||C(),$.on("itemSelected",()=>{const P=ar({kind:d.kind,id:d.id});P!==m&&(m=P,c(d,f))});async function b(P,A){d=P,f=A;const G=N(P);return G===p||(p=G,await Promise.all([c(P,A),_(P.artifacts)]),P.end_time&&E()),l}async function _(P){if(!P||(v(),n.disableArtifacts||!st.isTemporal()))return;const A=[];for(const G of P)A.push(x(G));await Promise.all(A),T()}async function x(P){if(a.has(P.id))return a.get(P.id).render(P);const A=await Td(P,{enableLocalClickHandling:!0});return a.set(P.id,A),o.addChild(A.element),A.render(P)}function v(){if(st.isTemporal()&&!n.disableArtifacts){o||(o=new Tt),l.addChild(o);return}o&&l.removeChild(o)}function T(){if(!o)return;const{artifactsGap:P,artifactsNodeOverlap:A}=e.styles;let G=0;for(const D of a.values())D.element.position.x=G,G+=D.element.width+P;o.position.y=-o.height+A,o.width<u.width&&(o.position.x=u.width-o.width)}function C(){i.ticker.add(I)}function E(){i.ticker.remove(I)}function I(){b(d,f)}async function R(P,A){const{kind:G}=P;switch(G){case"task-run":return await SR(P,A);case"flow-run":return await TR(P);default:const D=G;throw new Error(`switch does not have case for value: ${D}`)}}function N(P){var B;const A=P.end_time??new Date,G=(B=P.artifacts)==null?void 0:B.map(H=>H.type==="progress"?`${H.id}-${H.data}`:H.id).join("|"),D=!!f;return[P.state_type,A.getTime(),st.horizontal,st.horizontalScaleMultiplier,e.styles.colorMode,n.disableArtifacts||G,D].join("-")}function F({x:P,y:A}){h(l,{x:P,y:A},!g),g=!0}return{element:l,render:b,bar:u,setPosition:F}}function yb({gap:r=0,minimum:t=0}={}){const e=new Map;function i(c){const u=e.get(c)??[];return Math.max(...u.values(),Uh(t))+Uh(r)}function s(c){let u=0;for(let d=0;d<c;d++)u+=i(d);return u}function n(c){return s(c+1)-Uh(r)}function o({axis:c,nodeId:u,offset:d}){const f=e.get(c)??new Map;f.set(u,d),e.set(c,f)}function a({axis:c,nodeId:u}){let d,f;for(const[p,m]of e.entries())if(m.has(u)){d=p,f=m.get(u);break}d===c||d===void 0||f===void 0||(h({axis:d,nodeId:u}),o({axis:c,nodeId:u,offset:f}))}function h({axis:c,nodeId:u}){var d;(d=e.get(c))==null||d.delete(u)}function l(){e.clear()}return{getOffset:i,getTotalOffset:s,getTotalValue:n,setOffset:o,updateNodeAxis:a,removeOffset:h,clear:l}}function ER(r){throw new Error(`switch does not have case for value: ${r}`)}const bb="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEtlKG4pe3Rocm93IG5ldyBFcnJvcihgc3dpdGNoIGRvZXMgbm90IGhhdmUgY2FzZSBmb3IgdmFsdWU6ICR7bn1gKX1mdW5jdGlvbiBDbihuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjpuPGU/LTE6bj5lPzE6bj49ZT8wOk5hTn1mdW5jdGlvbiBudChuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjplPG4/LTE6ZT5uPzE6ZT49bj8wOk5hTn1mdW5jdGlvbiBSbihuKXtsZXQgZSx0LHI7bi5sZW5ndGghPT0yPyhlPUNuLHQ9KHUsbCk9PkNuKG4odSksbCkscj0odSxsKT0+bih1KS1sKTooZT1uPT09Q258fG49PT1udD9uOmV0LHQ9bixyPW4pO2Z1bmN0aW9uIG8odSxsLGY9MCxnPXUubGVuZ3RoKXtpZihmPGcpe2lmKGUobCxsKSE9PTApcmV0dXJuIGc7ZG97Y29uc3QgbT1mK2c+Pj4xO3QodVttXSxsKTwwP2Y9bSsxOmc9bX13aGlsZShmPGcpfXJldH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IR=r=>Uint8Array.from(atob(r),t=>t.charCodeAt(0)),xb=typeof self<"u"&&self.Blob&&new Blob([IR(bb)],{type:"text/javascript;charset=utf-8"});function AR(r){let t;try{if(t=xb&&(self.URL||self.webkitURL).createObjectURL(xb),!t)throw"";const e=new Worker(t,{name:r==null?void 0:r.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;base64,"+bb,{name:r==null?void 0:r.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}function MR(r){const t=new AR;return t.onmessage=r,t}async function zd(){const r=new Map,t=new Map,e=new Map,i=new Tt,s=new Tt,n=await Mt();let o=null;const a=yb({gap:()=>n.styles.rowGap,minimum:()=>n.styles.nodeHeight}),h=yb({gap:()=>n.styles.columnGap,minimum:()=>gd()});let l=null,c=null;i.name=Sl,$.on("layoutUpdated",()=>{a.clear(),h.clear()}),$.on("layoutSettingsUpdated",()=>{c&&i.parent&&u(c),D()}),$.on("itemSelected",()=>{D()});async function u(L){d(),c=L,l=null,await Promise.all([p(L),g(L)]),_(L)}function d(){o||(o=MR(A))}function f(){o&&(o.terminate(),o=null)}async function p(L){const O=[];for(const U of L.nodes.values())O.push(m(U));await Promise.all(O)}async function m(L){const{render:O}=await T(L),U=E(L.id);return await O(L,U)}async function g(L){if((await Qt()).disableEdges){i.removeChild(s);return}i.addChildAt(s,0);const U=[];for(const[tt,{children:Q}]of L.nodes)for(const{id:xt}of Q)U.push(b(tt,xt));await Promise.all(U)}async function b(L,O){const U=`${L}_${O}`;if(e.has(U))return;const tt=await lI();e.has(U)||(e.set(U,tt),s.addChild(tt.element))}function _(L){if(!o)throw new Error("Layout worker not initialized");const O=new Map;for(const[U,{element:tt}]of t)O.set(U,tt.width);o.postMessage({type:"layout",data:L,widths:O,horizontalSettings:Yd(L.start_time),verticalSettings:pR()})}function x(){if(l)for(const[L,O]of e){const[U,tt]=L.split("_"),Q=l.positions.get(U),xt=l.positions.get(tt),Ct=t.get(U);if(!Q||!xt){console.warn(`Could not find edge in layout: Skipping ${L}`);continue}if(!Ct){console.warn(`Could not find parent node in nodes: Skipping ${U}`);continue}const q=Ct.bar.width,Z=I(Q),Y={x:Z.x+q,y:Z.y+n.styles.nodeHeight/2},z=I(xt),k={x:z.x-Y.x,y:z.y-Y.y+n.styles.nodeHeight/2};O.setPosition(Y,k)}}function v(){if(l){for(const[L,O]of t){const U=l.positions.get(L);if(!U){console.warn(`Could not find node in layout: Skipping ${L}`);continue}const tt=I(U);O.setPosition(tt),a.updateNodeAxis({nodeId:L,axis:U.y}),h.updateNodeAxis({nodeId:L,axis:U.column})}x(),i.emit("rendered"),i.emit("resized",P())}}async function T(L){const O=r.get(L.id);if(O)return O;const U=E(L.id),tt=CR(L,U);r.set(L.id,tt);const Q=await tt;return Q.element.on("resized",xt=>C(L.id,xt)),i.addChild(Q.element),t.set(L.id,Q),Q}function C(L,O){if(!l)return;const U=t.get(L),tt=l.positions.get(L);!U||!tt||(a.setOffset({nodeId:L,axis:tt.y,offset:O.height}),h.setOffset({nodeId:L,axis:tt.column,offset:O.width}),v())}function E(L){var O;return(O=c==null?void 0:c.nested_task_run_graphs)==null?void 0:O.get(L)}function I(L){const O=a.getTotalOffset(L.y);return{x:R(L),y:O}}function R(L){return st.isDependency()?h.getTotalOffset(L.column):L.x}function N(){return l?a.getTotalValue(l.maxRow):0}function F(){if(!l||!c)return 0;if(st.isDependency())return h.getTotalValue(l.maxColumn);const L=Yd(c.start_time),O=ob(L),U=O(c.end_time??new Date),tt=O(c.start_time);return U-tt}function P(){return{width:F(),height:N()}}function A({data:L}){const{type:O}=L;switch(O){case"layout":G(L);return;default:ER(O)}}function G(L){l=L.layout,v()}async function D(){const L=await Qt(),O=PI();if(L.disableEdges||!O||!(c!=null&&c.nodes.has(O.id))){X([]);return}const U=lt(O.id);X(U)}function X(L){B(L),H(L)}function B(L){for(const[O,{element:U}]of t){if(L.length===0||L.includes(O)){U.alpha=1;continue}U.alpha=n.styles.nodeUnselectedAlpha}}function H(L){for(const[O,{element:U}]of e){const[tt,Q]=O.split("_");if(L.length===0||L.includes(tt)&&L.includes(Q)){U.alpha=1;continue}U.alpha=n.styles.nodeUnselectedAlpha}}function lt(L){const O=W(L,"parents"),U=W(L,"children");return[L,...O,...U]}function W(L,O){const U=c==null?void 0:c.nodes.get(L);if(!U)return[];const tt=[];for(const{id:Q}of U[O])tt.push(Q),tt.push(...W(Q,O));return tt}return{element:i,stopWorker:f,getSize:P,render:u}}let Xo=null,Xr=null,Rs=null;async function RR(){const r=await qt(),t=await Mt(),{element:e,render:i}=await zd();r.addChild(e),e.alpha=0;const s=await Rg(t.runId,async n=>{const o=Xr?"runDataUpdated":"runDataCreated";Xr=n,$.emit(o,Xr),await Qt(),i(n)});$.on("configUpdated",()=>{Xr&&i(Xr)}),Rs=e,Xo=s.stop,Rs.once("rendered",()=>LR()),$.on("layoutUpdated",()=>GR()),s.start()}function PR(){Xo==null||Xo(),Xo=null,Rs=null,Xr=null}async function Bi(){return Xr||await Fe("runDataCreated")}function LR(){Jd(),_e.shared.addOnce(()=>{Rs&&(Rs.alpha=1)})}async function GR(){if(!Rs)return;const r=await Mt();Rs.once("rendered",()=>{setTimeout(()=>{Jd({animate:!0})},r.animationDuration)})}let Re=null,jd=null;async function FR(){const r=await Jt(),t=await Iu();Re=new IC({screenHeight:t.clientHeight,screenWidth:t.clientWidth,events:r.renderer.events,passiveWheel:!1}),Re.zIndex=sp,Re.drag().pinch().wheel({trackpadPinch:!0}).decelerate({friction:.9}).clampZoom({minWidth:t.clientWidth/2}),Re.on("moved",()=>{$.emit("viewportMoved",null)}).on("moved-end",()=>{$.emit("viewportMoved",null)}),r.stage.addChild(Re),$.emit("viewportCreated",Re),$.on("applicationResized",XR),$.on("scaleUpdated",()=>Wo()),BR()}function NR(){Re=null,jd=null}async function Jd({animate:r}={}){const e=(await qt()).getChildByName(Sl);if(!e)throw new Error("Nodes container not found");VR();const{x:i,y:s,width:n,height:o}=e.getLocalBounds();if(!n||!o){DR({animate:r});return}kR({x:i,y:s,width:n,height:o,animate:r})}async function kR({x:r,y:t,width:e,height:i,animate:s}){const n=await Mt(),o=await qt(),{guideTextSize:a,guideTextTopPadding:h,columnGap:l,rowGap:c,eventTargetSize:u}=n.styles,d=a+h,f=e+l*2,p=i+c*4+d+u,m=o.findFit(f,p);o.animate({position:{x:r+e/2,y:t+i/2+d},scale:Math.min(m,1),time:s?n.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Zo(),Wo()}})}async function DR({animate:r}){const t=await Bi(),e=await Mt(),i=await qt(),s=await Qe();let n=s(t.start_time)-e.styles.columnGap,o=s(t.end_time??new Date)+e.styles.columnGap;if(n>o){const c=n;n=o,o=c}const a=o-n,h=n+a/2,l=i.findFit(a,0);i.animate({position:{x:h,y:0},scale:l,time:r?e.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Zo(),Wo()}})}async function qt(){return Re||await Fe("viewportCreated")}function _b(r){Eg(jd,r)||(jd=r,$.emit("viewportDateRangeUpdated",r))}function OR({xOffset:r,yOffset:t}){if(!Re)return;const{x:e,y:i}=Re.transform.position;Re.setTransform(e+r,i+t,Re.transform.scale.x,Re.transform.scale.y)}async function BR(){const r=await qt();Wo(),r.on("moved",()=>Wo())}async function Wo(){const r=await vb();r&&_b(r)}async function vb(){const r=await qt(),t=await Qe(),e=t.invert(r.left),i=t.invert(r.right);return e instanceof Date&&i instanceof Date?[e,i]:null}async function UR(r){const t=await vb(),e=await Qt();if(r===void 0||e.isDependency()||Eg(r,t))return;const i=await qt(),s=await Qe(),[n,o]=r,a=s(n),h=s(o),l=a+(h-a)/2;_b(r),i.fitWidth(h-a,!0),i.moveCenter(l,i.center.y)}async function XR(){const r=await Jt(),t=await qt(),e=await Iu(),i=t.screenWidth,s=t.screenHeight,n=e.clientWidth,o=e.clientHeight,a=(n-i)/2,h=(o-s)/2;t.resize(r.screen.width,r.screen.height),OR({xOffset:a,yOffset:h})}class il{constructor(){kf(this,"status","visible");kf(this,"labels",new Set)}get visible(){return this.status==="visible"}get hidden(){return this.status==="hidden"}show(){if(this.status!=="visible"){for(const t of this.labels)t.visible=!0;this.status="visible"}}hide(){if(this.status!=="hidden"){for(const t of this.labels)t.visible=!1;this.status="hidden"}}toggle(t){t?this.show():this.hide()}add(t){this.labels.add(t),t.visible=this.visible}clear(){this.labels.clear()}}let Ui=null,qe=null,Xi=null,dr=null,ui=null;async function WR(){const r=await qt(),t=await Jt();Ui=new jS({toggle:"renderable"}),qe=new il,Xi=new il,ui=new il,dr=new il,t.ticker.add(()=>{if(r.dirty){const e=r.scale.x>ip,i=r.scale.x>qf,s=r.scale.x>tp,n=r.scale.x>ep;ui==null||ui.toggle(e),qe==null||qe.toggle(i),Xi==null||Xi.toggle(s),dr==null||dr.toggle(n),Ui==null||Ui.cull(t.renderer.screen),r.dirty=!1}}),$.emit("cullCreated",Ui),$.emit("labelCullCreated",qe),$.emit("iconCullCreated",qe),$.emit("edgeCullCreated",ui),$.emit("toggleCullCreated",dr)}function ZR(){Ui=null,qe==null||qe.clear(),qe=null,Xi==null||Xi.clear(),Xi=null,ui==null||ui.clear(),ui=null,dr==null||dr.clear(),dr=null}async function Zo(){const r=await qt();r.dirty=!0}function VR(){Ui&&Ui.uncull()}async function wb(){return Ui||await Fe("cullCreated")}async function HR(){return ui||await Fe("edgeCullCreated")}async function Tb(){return qe||await Fe("labelCullCreated")}async function Sb(){return Xi||await Fe("iconCullCreated")}async function KR(){const r=await Jt(),t=await Bi(),e=await Qt(),{element:i,render:s,update:n}=await pb({isRoot:!0});i.zIndex=ap;function o(a){if(st.isTemporal()&&!e.disableArtifacts){r.stage.addChild(i),s(a==null?void 0:a.artifacts);return}r.stage.removeChild(i)}t.artifacts&&o(t),$.on("viewportMoved",()=>n()),$.on("runDataCreated",a=>o(a)),$.on("runDataUpdated",a=>o(a)),$.on("configUpdated",()=>o()),$.on("layoutSettingsUpdated",()=>o())}function wP(){}async function YR(){const r=await Jt(),t=await Bi(),{element:e,render:i}=await mb({isRoot:!0});e.zIndex=op,r.stage.addChild(e);function s(n){i(n==null?void 0:n.states)}t.states&&s(t),$.on("runDataUpdated",n=>s(n)),$.on("configUpdated",()=>s()),$.on("layoutSettingsUpdated",()=>s())}function TP(){}async function zR(){const r=await Jt(),t=await qt(),e=await Qt(),i=await Mt(),{inter:s}=await r1(),n=new Tt,o=await or();n.addChild(o);const a=s("");n.addChild(a);let h=await Qe(),l,c;$.on("scaleUpdated",m=>{h=m,p()}),$.on("viewportMoved",()=>{e.disableGuides||(p(),n.height!==r.screen.height&&d())});function u(m,g){l=m,c=g,d(),f(m)}function d(){o.width=i.styles.guideLineWidth,o.height=r.screen.height,o.tint=i.styles.guideLineColor}function f(m){a.text=c(m),a.fontSize=i.styles.guideTextSize,a.tint=i.styles.guideTextColor,a.position.set(i.styles.guideTextLeftPadding,i.styles.guideTextTopPadding)}function p(){l!==void 0&&(n.position.x=h(l)*t.scale._x+t.worldTransform.tx)}return{element:n,render:u}}class Cb extends Error{constructor(){super("Layout is not temporal")}}function jR(r){return r.toLocaleTimeString()}function Eb(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(r)}function JR(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{dateStyle:"short"}).format(r)}function $R(r){return r.getHours()===0&&r.getMinutes()===0?`${rl.date(r)}
1176
+ ${Eb(r)}`:Eb(r)}const rl={timeBySeconds:jR,timeByMinutesWithDates:$R,date:JR},re={seconds:"seconds",minutes:"minutes",date:"date"},Vo={day:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.getTime()},week:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.setDate(r.getDate()-r.getDay()+1),t.getTime()}},Et={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Ib=[{ceiling:Et.second*4,increment:Et.second,labelFormat:re.seconds},{ceiling:Et.second*8,increment:Et.second*5,labelFormat:re.seconds},{ceiling:Et.second*13,increment:Et.second*10,labelFormat:re.seconds},{ceiling:Et.second*20,increment:Et.second*15,labelFormat:re.seconds},{ceiling:Et.second*45,increment:Et.second*30,labelFormat:re.seconds},{ceiling:Et.minute*4,increment:Et.minute,labelFormat:re.minutes},{ceiling:Et.minute*8,increment:Et.minute*5,labelFormat:re.minutes},{ceiling:Et.minute*13,increment:Et.minute*10,labelFormat:re.minutes},{ceiling:Et.minute*28,increment:Et.minute*15,labelFormat:re.minutes},{ceiling:Et.hour*1.24,increment:Et.minute*30,labelFormat:re.minutes},{ceiling:Et.hour*3,increment:Et.hour,labelFormat:re.minutes},{ceiling:Et.hour*8,increment:Et.hour*2,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.hour*13,increment:Et.hour*6,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.hour*22,increment:Et.hour*12,getAnchor:Vo.day,labelFormat:re.minutes},{ceiling:Et.day*4,increment:Et.day,getAnchor:Vo.day,labelFormat:re.date},{ceiling:Et.week*2,increment:Et.week,getAnchor:Vo.week,labelFormat:re.date},{ceiling:1/0,increment:Et.week*4,labelFormat:re.date}],QR=300;async function qR(){const r=await qt(),t=await Qt(),e=new Tt,i=new Map;let s=await Qe();$.on("scaleUpdated",d=>s=d),await o();function n(){if(e.visible=!t.disableGuides,!t.disableGuides)try{const{anchor:d,increment:f,labelFormat:p}=a(),m=u(d,f);c(m,p)}catch(d){if(d instanceof Cb)return;console.error(d)}}async function o(){const d=[];_d(Rl,async f=>{const p=zR();d.push(p);const m=await p;e.addChild(m.element),i.set(f,m)}),await Promise.all(d)}function a(){const d=r.left-QR,f=s.invert(d),p=s.invert(d+rp/r.scale.x);if(!(f instanceof Date)||!(p instanceof Date))throw new Cb;const m=p.getTime()-f.getTime(),{increment:g,getAnchor:b,labelFormat:_}=h(m);return{anchor:b(f),increment:g,labelFormat:l(_)}}function h(d){const f=Ib.find(p=>p.ceiling>d)??Ib[0];return f.getAnchor||(f.getAnchor=p=>Math.floor(p.getTime()/f.increment)*f.increment),f}function l(d){switch(d){case re.minutes:return rl.timeByMinutesWithDates;case re.date:return rl.date;default:return rl.timeBySeconds}}function c(d,f){const p=new Map(i.entries()),m=Array.from(p.keys()).filter(g=>!d.includes(g));i.clear();for(const g of d){if(p.has(g)){const _=p.get(g);i.set(g,_),_.render(new Date(g),f);continue}const b=p.get(m.pop()??-1);if(b===void 0){console.warn("Guides: No unused guides available to render.");continue}b.render(new Date(g),f),i.set(g,b)}}function u(d,f){return _d(Rl,p=>d+f*p)}return{element:e,render:n}}async function tP(){const r=await Jt(),{element:t,render:e}=await qR();r.stage.addChild(t),e(),$.on("viewportDateRangeUpdated",()=>e()),$.on("layoutSettingsUpdated",()=>e()),$.on("configUpdated",()=>e())}function SP(){}const eP=80;async function iP(){const r=await Jt(),t=await qt(),e=await Qt(),i=await Mt(),s=await or();let n=await Qe();$.on("scaleUpdated",h=>n=h);function o(){if(!e.isTemporal()){s.visible=!1;return}s.width=i.styles.playheadWidth,s.height=r.stage.height,s.tint=i.styles.playheadColor,s.position.x=n(new Date)*t.scale.x+t.worldTransform.tx,a()}function a(){if(t.moving||!(s.position.x>0&&s.position.x<r.screen.width)||!(s.position.x>r.screen.width-eP))return;const c=t.left;t.zoomPercent(-.1,!0),t.left=c}return{element:s,render:o}}async function rP(){const r=await Jt(),t=await Bi(),{element:e,render:i}=await iP();t.end_time||(r.stage.addChild(e),r.ticker.add(i)),$.on("runDataUpdated",({end_time:s})=>{s&&(r.ticker.remove(i),r.stage.removeChild(e))})}function CP(){}function sP({stage:r,config:t}){BS(),FR(),mR(),tP(),RR(),KR(),yR(),YR(),rP(),CI(),DS(r),YS(t),WR(),jE(),MI()}function nP(){$.clear();try{US(),NR(),gR(),OS(),PR(),bR(),zS(),II(),ZR(),JE(),RI(),ZS()}catch(r){console.error(r)}}rt.DEFAULT_EDGE_CONTAINER_NAME=Jf,rt.DEFAULT_EDGE_CULLING_THRESHOLD=ip,rt.DEFAULT_EDGE_MINIMUM_BEZIER=Ml,rt.DEFAULT_EDGE_POINTS=Al,rt.DEFAULT_GUIDES_COUNT=Rl,rt.DEFAULT_GUIDES_MIN_GAP=rp,rt.DEFAULT_HORIZONTAL_SCALE=Ob,rt.DEFAULT_HORIZONTAL_SCALE_MULTIPLIER=Db,rt.DEFAULT_ICON_CULLING_THRESHOLD=tp,rt.DEFAULT_LABEL_CULLING_THRESHOLD=qf,rt.DEFAULT_LINEAR_COLUMN_SIZE_PIXELS=Qf,rt.DEFAULT_NESTED_GRAPH_BORDER_Z_INDEX=Ll,rt.DEFAULT_NESTED_GRAPH_NODES_Z_INDEX=Gl,rt.DEFAULT_NESTED_GRAPH_NODE_Z_INDEX=Fl,rt.DEFAULT_NODES_CONTAINER_NAME=Sl,rt.DEFAULT_NODE_CONTAINER_NAME=jf,rt.DEFAULT_NODE_LABEL_Z_INDEX=Kn,rt.DEFAULT_ROOT_ARTIFACT_Z_INDEX=ap,rt.DEFAULT_ROOT_COLLISION_THROTTLE=Pl,rt.DEFAULT_ROOT_EVENT_Z_INDEX=np,rt.DEFAULT_ROOT_FLOW_STATE_Z_INDEX=op,rt.DEFAULT_SUBFLOW_ARTIFACT_Z_INDEX=cp,rt.DEFAULT_SUBFLOW_EVENT_Z_INDEX=hp,rt.DEFAULT_SUBFLOW_STATE_Z_INDEX=lp,rt.DEFAULT_TEXTURE_RESOLUTION=El,rt.DEFAULT_TEXT_RESOLUTION=Il,rt.DEFAULT_TIME_COLUMN_SIZE_PIXELS=Cl,rt.DEFAULT_TIME_COLUMN_SPAN_SECONDS=$f,rt.DEFAULT_TOGGLE_CULLING_THRESHOLD=ep,rt.DEFAULT_VIEWPORT_Z_INDEX=sp,rt.artifactTypeIconMap=Yr,rt.artifactTypes=Le,rt.centerViewport=Jd,rt.emitter=$,rt.isArtifactSelection=Vf,rt.isArtifactsSelection=Hf,rt.isEventSelection=Yf,rt.isEventsSelection=zf,rt.isHorizontalMode=kb,rt.isNodeSelection=ua,rt.isRunGraphNodeType=Gb,rt.isStateSelection=Kf,rt.isVerticalMode=Nb,rt.layout=st,rt.resetHorizontalScaleMultiplier=qE,rt.runGraphNodeKinds=Tl,rt.selectItem=Di,rt.setConfig=Cg,rt.setDisabledArtifacts=rI,rt.setDisabledEdges=iI,rt.setDisabledEvents=sI,rt.setHorizontalMode=tI,rt.setHorizontalScaleMultiplier=yd,rt.setVerticalMode=eI,rt.start=sP,rt.stateType=Fb,rt.stop=nP,rt.updateViewportFromDateRange=UR,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
1177
1177
  //# sourceMappingURL=graphs.umd.js.map