reacthub-pixitweenjs 0.2.18 → 0.2.20

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.
Files changed (3) hide show
  1. package/dist/index.es.js +11718 -21652
  2. package/dist/index.umd.js +74 -378
  3. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Te,dt){typeof exports=="object"&&typeof module<"u"?dt(exports,require("react"),require("gsap"),require("pixi.js")):typeof define=="function"&&define.amd?define(["exports","react","gsap","pixi.js"],dt):(Te=typeof globalThis<"u"?globalThis:Te||self,dt(Te["reacthub-pixitweenjs"]={},Te.React,Te.gsap,Te.PIXI))})(this,function(Te,dt,Wr,o_){"use strict";function nd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Mt=nd(dt),Ar=nd(o_);var Nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ni(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function id(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var sd={exports:{}},Ha={};/**
1
+ (function(Lt,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("react"),require("@pixi/react"),require("gsap"),require("pixi.js"),require("@pixi/sound")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","gsap","pixi.js","@pixi/sound"],J):(Lt=typeof globalThis<"u"?globalThis:Lt||self,J(Lt["reacthub-pixitweenjs"]={},Lt.React,Lt.PIXIReact,Lt.gsap,Lt.PIXI,Lt.PIXI.sound))})(this,function(Lt,J,yt,ye,Gh,$h){"use strict";function La(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const lt=La(J),ne=La(Gh);var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Fa={exports:{}},gn={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,24 +6,24 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var l_=dt,u_=Symbol.for("react.element"),c_=Symbol.for("react.fragment"),h_=Object.prototype.hasOwnProperty,f_=l_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d_={key:!0,ref:!0,__self:!0,__source:!0};function ad(e,t,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)h_.call(t,n)&&!d_.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:u_,type:e,key:s,ref:a,props:i,_owner:f_.current}}Ha.Fragment=c_,Ha.jsx=ad,Ha.jsxs=ad,sd.exports=Ha;var $t=sd.exports,od={exports:{}},ii=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))(ii||{}),ld=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(ld||{}),vu=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(vu||{}),Lt=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR",e))(Lt||{}),Cr=(e=>(e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e))(Cr||{}),wt=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(wt||{}),Ni=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(Ni||{}),Ut=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(Ut||{}),_u=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(_u||{}),mn=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(mn||{}),gn=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(gn||{}),Mn=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(Mn||{}),yn=(e=>(e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",e))(yn||{}),si=(e=>(e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT",e))(si||{}),bu=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(bu||{}),dr=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(dr||{}),Ce=(e=>(e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE",e[e.COLOR=4]="COLOR",e))(Ce||{}),Ee=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(Ee||{}),Xr=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(Xr||{});const Pt={ADAPTER:{createCanvas:(e,t)=>{const r=document.createElement("canvas");return r.width=e,r.height=t,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var xu=/iPhone/i,ud=/iPod/i,cd=/iPad/i,hd=/\biOS-universal(?:.+)Mac\b/i,wu=/\bAndroid(?:.+)Mobile\b/i,fd=/Android/i,Mi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ga=/Silk/i,vn=/Windows Phone/i,dd=/\bWindows(?:.+)ARM\b/i,pd=/BlackBerry/i,md=/BB10/i,gd=/Opera Mini/i,yd=/\b(CriOS|Chrome)(?:.+)Mobile/i,vd=/Mobile(?:.+)Firefox\b/i,_d=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function p_(e){return function(t){return t.test(e)}}function bd(e){var t={userAgent:"",platform:"",maxTouchPoints:0};!e&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e=="string"?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var r=t.userAgent,n=r.split("[FBAN");typeof n[1]<"u"&&(r=n[0]),n=r.split("Twitter"),typeof n[1]<"u"&&(r=n[0]);var i=p_(r),s={apple:{phone:i(xu)&&!i(vn),ipod:i(ud),tablet:!i(xu)&&(i(cd)||_d(t))&&!i(vn),universal:i(hd),device:(i(xu)||i(ud)||i(cd)||i(hd)||_d(t))&&!i(vn)},amazon:{phone:i(Mi),tablet:!i(Mi)&&i(Ga),device:i(Mi)||i(Ga)},android:{phone:!i(vn)&&i(Mi)||!i(vn)&&i(wu),tablet:!i(vn)&&!i(Mi)&&!i(wu)&&(i(Ga)||i(fd)),device:!i(vn)&&(i(Mi)||i(Ga)||i(wu)||i(fd))||i(/\bokhttp\b/i)},windows:{phone:i(vn),tablet:i(dd),device:i(vn)||i(dd)},other:{blackberry:i(pd),blackberry10:i(md),opera:i(gd),firefox:i(vd),chrome:i(yd),device:i(pd)||i(md)||i(gd)||i(vd)||i(yd)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const Li=(bd.default??bd)(globalThis.navigator);Pt.RETINA_PREFIX=/@([0-9\.]+)x/,Pt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var xd={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,h,d){this.fn=c,this.context=h,this.once=d||!1}function s(c,h,d,p,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,p||c,f),g=r?r+h:h;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function a(c,h){--c._eventsCount===0?c._events=new n:delete c._events[h]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],d,p;if(this._eventsCount===0)return h;for(p in d=this._events)t.call(d,p)&&h.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},o.prototype.listeners=function(h){var d=r?r+h:h,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var f=0,m=p.length,g=new Array(m);f<m;f++)g[f]=p[f].fn;return g},o.prototype.listenerCount=function(h){var d=r?r+h:h,p=this._events[d];return p?p.fn?1:p.length:0},o.prototype.emit=function(h,d,p,f,m,g){var v=r?r+h:h;if(!this._events[v])return!1;var b=this._events[v],_=arguments.length,w,S;if(b.fn){switch(b.once&&this.removeListener(h,b.fn,void 0,!0),_){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,d),!0;case 3:return b.fn.call(b.context,d,p),!0;case 4:return b.fn.call(b.context,d,p,f),!0;case 5:return b.fn.call(b.context,d,p,f,m),!0;case 6:return b.fn.call(b.context,d,p,f,m,g),!0}for(S=1,w=new Array(_-1);S<_;S++)w[S-1]=arguments[S];b.fn.apply(b.context,w)}else{var x=b.length,A;for(S=0;S<x;S++)switch(b[S].once&&this.removeListener(h,b[S].fn,void 0,!0),_){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,d);break;case 3:b[S].fn.call(b[S].context,d,p);break;case 4:b[S].fn.call(b[S].context,d,p,f);break;default:if(!w)for(A=1,w=new Array(_-1);A<_;A++)w[A-1]=arguments[A];b[S].fn.apply(b[S].context,w)}}return!0},o.prototype.on=function(h,d,p){return s(this,h,d,p,!1)},o.prototype.once=function(h,d,p){return s(this,h,d,p,!0)},o.prototype.removeListener=function(h,d,p,f){var m=r?r+h:h;if(!this._events[m])return this;if(!d)return a(this,m),this;var g=this._events[m];if(g.fn)g.fn===d&&(!f||g.once)&&(!p||g.context===p)&&a(this,m);else{for(var v=0,b=[],_=g.length;v<_;v++)(g[v].fn!==d||f&&!g[v].once||p&&g[v].context!==p)&&b.push(g[v]);b.length?this._events[m]=b.length===1?b[0]:b:a(this,m)}return this},o.prototype.removeAllListeners=function(h){var d;return h?(d=r?r+h:h,this._events[d]&&a(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(xd);var m_=xd.exports;const _n=ni(m_);var Su={exports:{}};Su.exports=qa,Su.exports.default=qa;function qa(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=wd(e,0,i,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,c,h,d,p,f,m;if(n&&(s=b_(e,t,s,r)),e.length>80*r){o=h=e[0],c=d=e[1];for(var g=r;g<i;g+=r)p=e[g],f=e[g+1],p<o&&(o=p),f<c&&(c=f),p>h&&(h=p),f>d&&(d=f);m=Math.max(h-o,d-c),m=m!==0?32767/m:0}return Ns(s,a,r,o,c,m,0),a}function wd(e,t,r,n,i){var s,a;if(i===Au(e,t,r,n)>0)for(s=t;s<r;s+=n)a=Ed(s,e[s],e[s+1],a);else for(s=r-n;s>=t;s-=n)a=Ed(s,e[s],e[s+1],a);return a&&Va(a,a.next)&&(Ls(a),a=a.next),a}function ai(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Va(r,r.next)||de(r.prev,r,r.next)===0)){if(Ls(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function Ns(e,t,r,n,i,s,a){if(e){!a&&s&&E_(e,n,i,s);for(var o=e,c,h;e.prev!==e.next;){if(c=e.prev,h=e.next,s?y_(e,n,i,s):g_(e)){t.push(c.i/r|0),t.push(e.i/r|0),t.push(h.i/r|0),Ls(e),e=h.next,o=h.next;continue}if(e=h,e===o){a?a===1?(e=v_(ai(e),t,r),Ns(e,t,r,n,i,s,2)):a===2&&__(e,t,r,n,i,s):Ns(ai(e),t,r,n,i,s,1);break}}}}function g_(e){var t=e.prev,r=e,n=e.next;if(de(t,r,n)>=0)return!1;for(var i=t.x,s=r.x,a=n.x,o=t.y,c=r.y,h=n.y,d=i<s?i<a?i:a:s<a?s:a,p=o<c?o<h?o:h:c<h?c:h,f=i>s?i>a?i:a:s>a?s:a,m=o>c?o>h?o:h:c>h?c:h,g=n.next;g!==t;){if(g.x>=d&&g.x<=f&&g.y>=p&&g.y<=m&&Bi(i,o,s,c,a,h,g.x,g.y)&&de(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function y_(e,t,r,n){var i=e.prev,s=e,a=e.next;if(de(i,s,a)>=0)return!1;for(var o=i.x,c=s.x,h=a.x,d=i.y,p=s.y,f=a.y,m=o<c?o<h?o:h:c<h?c:h,g=d<p?d<f?d:f:p<f?p:f,v=o>c?o>h?o:h:c>h?c:h,b=d>p?d>f?d:f:p>f?p:f,_=Tu(m,g,t,r,n),w=Tu(v,b,t,r,n),S=e.prevZ,x=e.nextZ;S&&S.z>=_&&x&&x.z<=w;){if(S.x>=m&&S.x<=v&&S.y>=g&&S.y<=b&&S!==i&&S!==a&&Bi(o,d,c,p,h,f,S.x,S.y)&&de(S.prev,S,S.next)>=0||(S=S.prevZ,x.x>=m&&x.x<=v&&x.y>=g&&x.y<=b&&x!==i&&x!==a&&Bi(o,d,c,p,h,f,x.x,x.y)&&de(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;S&&S.z>=_;){if(S.x>=m&&S.x<=v&&S.y>=g&&S.y<=b&&S!==i&&S!==a&&Bi(o,d,c,p,h,f,S.x,S.y)&&de(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;x&&x.z<=w;){if(x.x>=m&&x.x<=v&&x.y>=g&&x.y<=b&&x!==i&&x!==a&&Bi(o,d,c,p,h,f,x.x,x.y)&&de(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function v_(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!Va(i,s)&&Sd(i,n,n.next,s)&&Ms(i,s)&&Ms(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Ls(n),Ls(n.next),n=e=s),n=n.next}while(n!==e);return ai(n)}function __(e,t,r,n,i,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&O_(a,o)){var c=Td(a,o);a=ai(a,a.next),c=ai(c,c.next),Ns(a,t,r,n,i,s,0),Ns(c,t,r,n,i,s,0);return}o=o.next}a=a.next}while(a!==e)}function b_(e,t,r,n){var i=[],s,a,o,c,h;for(s=0,a=t.length;s<a;s++)o=t[s]*n,c=s<a-1?t[s+1]*n:e.length,h=wd(e,o,c,n,!1),h===h.next&&(h.steiner=!0),i.push(C_(h));for(i.sort(x_),s=0;s<i.length;s++)r=w_(i[s],r);return r}function x_(e,t){return e.x-t.x}function w_(e,t){var r=S_(e,t);if(!r)return t;var n=Td(r,e);return ai(n,n.next),ai(r,r.next)}function S_(e,t){var r=t,n=e.x,i=e.y,s=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=n&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===n))return a}r=r.next}while(r!==t);if(!a)return null;var c=a,h=a.x,d=a.y,p=1/0,f;r=a;do n>=r.x&&r.x>=h&&n!==r.x&&Bi(i<d?n:s,i,h,d,i<d?s:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),Ms(r,e)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&T_(a,r)))&&(a=r,p=f)),r=r.next;while(r!==c);return a}function T_(e,t){return de(e.prev,e,t.prev)<0&&de(t.next,e,e.next)<0}function E_(e,t,r,n){var i=e;do i.z===0&&(i.z=Tu(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,A_(i)}function A_(e){var t,r,n,i,s,a,o,c,h=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,n=r,o=0,t=0;t<h&&(o++,n=n.nextZ,!!n);t++);for(c=h;o>0||c>0&&n;)o!==0&&(c===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,o--):(i=n,n=n.nextZ,c--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,h*=2}while(a>1);return e}function Tu(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function C_(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Bi(e,t,r,n,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(n-o)>=(r-a)*(t-o)&&(r-a)*(s-o)>=(i-a)*(n-o)}function O_(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!P_(e,t)&&(Ms(e,t)&&Ms(t,e)&&I_(e,t)&&(de(e.prev,e,t.prev)||de(e,t.prev,t))||Va(e,t)&&de(e.prev,e,e.next)>0&&de(t.prev,t,t.next)>0)}function de(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Va(e,t){return e.x===t.x&&e.y===t.y}function Sd(e,t,r,n){var i=Xa(de(e,t,r)),s=Xa(de(e,t,n)),a=Xa(de(r,n,e)),o=Xa(de(r,n,t));return!!(i!==s&&a!==o||i===0&&Wa(e,r,t)||s===0&&Wa(e,n,t)||a===0&&Wa(r,e,n)||o===0&&Wa(r,t,n))}function Wa(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Xa(e){return e>0?1:e<0?-1:0}function P_(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Sd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Ms(e,t){return de(e.prev,e,e.next)<0?de(e,t,e.next)>=0&&de(e,e.prev,t)>=0:de(e,t,e.prev)<0||de(e,e.next,t)<0}function I_(e,t){var r=e,n=!1,i=(e.x+t.x)/2,s=(e.y+t.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Td(e,t){var r=new Eu(e.i,e.x,e.y),n=new Eu(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Ed(e,t,r,n){var i=new Eu(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ls(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Eu(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}qa.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,a=Math.abs(Au(e,0,s,r));if(i)for(var o=0,c=t.length;o<c;o++){var h=t[o]*r,d=o<c-1?t[o+1]*r:e.length;a-=Math.abs(Au(e,h,d,r))}var p=0;for(o=0;o<n.length;o+=3){var f=n[o]*r,m=n[o+1]*r,g=n[o+2]*r;p+=Math.abs((e[f]-e[g])*(e[m+1]-e[f+1])-(e[f]-e[m])*(e[g+1]-e[f+1]))}return a===0&&p===0?0:Math.abs((p-a)/a)};function Au(e,t,r,n){for(var i=0,s=t,a=r-n;s<r;s+=n)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}qa.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var s=0;s<e[i].length;s++)for(var a=0;a<t;a++)r.vertices.push(e[i][s][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r};var k_=Su.exports;const R_=ni(k_);var Ya={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Ya.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof Nn=="object"&&Nn;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,c=36,h=1,d=26,p=38,f=700,m=72,g=128,v="-",b=/^xn--/,_=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-h,A=Math.floor,N=String.fromCharCode,O;function P(D){throw new RangeError(S[D])}function B(D,L){for(var U=D.length,H=[];U--;)H[U]=L(D[U]);return H}function I(D,L){var U=D.split("@"),H="";U.length>1&&(H=U[0]+"@",D=U[1]),D=D.replace(w,".");var Y=D.split("."),K=B(Y,L).join(".");return H+K}function C(D){for(var L=[],U=0,H=D.length,Y,K;U<H;)Y=D.charCodeAt(U++),Y>=55296&&Y<=56319&&U<H?(K=D.charCodeAt(U++),(K&64512)==56320?L.push(((Y&1023)<<10)+(K&1023)+65536):(L.push(Y),U--)):L.push(Y);return L}function k(D){return B(D,function(L){var U="";return L>65535&&(L-=65536,U+=N(L>>>10&1023|55296),L=56320|L&1023),U+=N(L),U}).join("")}function M(D){return D-48<10?D-22:D-65<26?D-65:D-97<26?D-97:c}function F(D,L){return D+22+75*(D<26)-((L!=0)<<5)}function $(D,L,U){var H=0;for(D=U?A(D/f):D>>1,D+=A(D/L);D>x*d>>1;H+=c)D=A(D/x);return A(H+(x+1)*D/(D+p))}function V(D){var L=[],U=D.length,H,Y=0,K=g,j=m,W,Q,tt,rt,ct,_t,yt,Nt,Ft;for(W=D.lastIndexOf(v),W<0&&(W=0),Q=0;Q<W;++Q)D.charCodeAt(Q)>=128&&P("not-basic"),L.push(D.charCodeAt(Q));for(tt=W>0?W+1:0;tt<U;){for(rt=Y,ct=1,_t=c;tt>=U&&P("invalid-input"),yt=M(D.charCodeAt(tt++)),(yt>=c||yt>A((o-Y)/ct))&&P("overflow"),Y+=yt*ct,Nt=_t<=j?h:_t>=j+d?d:_t-j,!(yt<Nt);_t+=c)Ft=c-Nt,ct>A(o/Ft)&&P("overflow"),ct*=Ft;H=L.length+1,j=$(Y-rt,H,rt==0),A(Y/H)>o-K&&P("overflow"),K+=A(Y/H),Y%=H,L.splice(Y++,0,K)}return k(L)}function q(D){var L,U,H,Y,K,j,W,Q,tt,rt,ct,_t=[],yt,Nt,Ft,ie;for(D=C(D),yt=D.length,L=g,U=0,K=m,j=0;j<yt;++j)ct=D[j],ct<128&&_t.push(N(ct));for(H=Y=_t.length,Y&&_t.push(v);H<yt;){for(W=o,j=0;j<yt;++j)ct=D[j],ct>=L&&ct<W&&(W=ct);for(Nt=H+1,W-L>A((o-U)/Nt)&&P("overflow"),U+=(W-L)*Nt,L=W,j=0;j<yt;++j)if(ct=D[j],ct<L&&++U>o&&P("overflow"),ct==L){for(Q=U,tt=c;rt=tt<=K?h:tt>=K+d?d:tt-K,!(Q<rt);tt+=c)ie=Q-rt,Ft=c-rt,_t.push(N(F(rt+ie%Ft,0))),Q=A(ie/Ft);_t.push(N(F(Q,0))),K=$(U,Nt,H==Y),U=0,++H}++U,++L}return _t.join("")}function X(D){return I(D,function(L){return b.test(L)?V(L.slice(4).toLowerCase()):L})}function G(D){return I(D,function(L){return _.test(L)?"xn--"+q(L):L})}if(a={version:"1.4.1",ucs2:{decode:C,encode:k},decode:V,encode:q,toASCII:G,toUnicode:X},n&&i)if(e.exports==n)i.exports=a;else for(O in a)a.hasOwnProperty(O)&&(n[O]=a[O]);else r.punycode=a})(Nn)}(Ya,Ya.exports);var N_=Ya.exports,M_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r 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 s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0},Ad=typeof Symbol<"u"&&Symbol,L_=M_,B_=function(){return typeof Ad!="function"||typeof Symbol!="function"||typeof Ad("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:L_()},Cd={foo:{}},F_=Object,D_=function(){return{__proto__:Cd}.foo===Cd.foo&&!({__proto__:null}instanceof F_)},U_="Function.prototype.bind called on incompatible ",Cu=Array.prototype.slice,j_=Object.prototype.toString,$_="[object Function]",z_=function(t){var r=this;if(typeof r!="function"||j_.call(r)!==$_)throw new TypeError(U_+r);for(var n=Cu.call(arguments,1),i,s=function(){if(this instanceof i){var d=r.apply(this,n.concat(Cu.call(arguments)));return Object(d)===d?d:this}else return r.apply(t,n.concat(Cu.call(arguments)))},a=Math.max(0,r.length-n.length),o=[],c=0;c<a;c++)o.push("$"+c);if(i=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=function(){};h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},H_=z_,Ou=Function.prototype.bind||H_,G_=Ou,q_=G_.call(Function.call,Object.prototype.hasOwnProperty),zt,Fi=SyntaxError,Od=Function,Di=TypeError,Pu=function(e){try{return Od('"use strict"; return ('+e+").constructor;")()}catch{}},oi=Object.getOwnPropertyDescriptor;if(oi)try{oi({},"")}catch{oi=null}var Iu=function(){throw new Di},V_=oi?function(){try{return arguments.callee,Iu}catch{try{return oi(arguments,"callee").get}catch{return Iu}}}():Iu,Ui=B_(),W_=D_(),Re=Object.getPrototypeOf||(W_?function(e){return e.__proto__}:null),ji={},X_=typeof Uint8Array>"u"||!Re?zt:Re(Uint8Array),li={"%AggregateError%":typeof AggregateError>"u"?zt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?zt:ArrayBuffer,"%ArrayIteratorPrototype%":Ui&&Re?Re([][Symbol.iterator]()):zt,"%AsyncFromSyncIteratorPrototype%":zt,"%AsyncFunction%":ji,"%AsyncGenerator%":ji,"%AsyncGeneratorFunction%":ji,"%AsyncIteratorPrototype%":ji,"%Atomics%":typeof Atomics>"u"?zt:Atomics,"%BigInt%":typeof BigInt>"u"?zt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?zt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?zt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?zt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?zt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?zt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?zt:FinalizationRegistry,"%Function%":Od,"%GeneratorFunction%":ji,"%Int8Array%":typeof Int8Array>"u"?zt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?zt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?zt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ui&&Re?Re(Re([][Symbol.iterator]())):zt,"%JSON%":typeof JSON=="object"?JSON:zt,"%Map%":typeof Map>"u"?zt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ui||!Re?zt:Re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?zt:Promise,"%Proxy%":typeof Proxy>"u"?zt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?zt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?zt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ui||!Re?zt:Re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?zt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ui&&Re?Re(""[Symbol.iterator]()):zt,"%Symbol%":Ui?Symbol:zt,"%SyntaxError%":Fi,"%ThrowTypeError%":V_,"%TypedArray%":X_,"%TypeError%":Di,"%Uint8Array%":typeof Uint8Array>"u"?zt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?zt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?zt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?zt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?zt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?zt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?zt:WeakSet};if(Re)try{null.error}catch(e){var Y_=Re(Re(e));li["%Error.prototype%"]=Y_}var K_=function e(t){var r;if(t==="%AsyncFunction%")r=Pu("async function () {}");else if(t==="%GeneratorFunction%")r=Pu("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Pu("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Re&&(r=Re(i.prototype))}return li[t]=r,r},Pd={"%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"]},Bs=Ou,Ka=q_,Z_=Bs.call(Function.call,Array.prototype.concat),Q_=Bs.call(Function.apply,Array.prototype.splice),Id=Bs.call(Function.call,String.prototype.replace),Za=Bs.call(Function.call,String.prototype.slice),J_=Bs.call(Function.call,RegExp.prototype.exec),tb=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,eb=/\\(\\)?/g,rb=function(t){var r=Za(t,0,1),n=Za(t,-1);if(r==="%"&&n!=="%")throw new Fi("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Fi("invalid intrinsic syntax, expected opening `%`");var i=[];return Id(t,tb,function(s,a,o,c){i[i.length]=o?Id(c,eb,"$1"):a||s}),i},nb=function(t,r){var n=t,i;if(Ka(Pd,n)&&(i=Pd[n],n="%"+i[0]+"%"),Ka(li,n)){var s=li[n];if(s===ji&&(s=K_(n)),typeof s>"u"&&!r)throw new Di("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Fi("intrinsic "+t+" does not exist!")},ku=function(t,r){if(typeof t!="string"||t.length===0)throw new Di("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Di('"allowMissing" argument must be a boolean');if(J_(/^%?[^%]*%?$/,t)===null)throw new Fi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=rb(t),i=n.length>0?n[0]:"",s=nb("%"+i+"%",r),a=s.name,o=s.value,c=!1,h=s.alias;h&&(i=h[0],Q_(n,Z_([0,1],h)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],m=Za(f,0,1),g=Za(f,-1);if((m==='"'||m==="'"||m==="`"||g==='"'||g==="'"||g==="`")&&m!==g)throw new Fi("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),i+="."+f,a="%"+i+"%",Ka(li,a))o=li[a];else if(o!=null){if(!(f in o)){if(!r)throw new Di("base intrinsic for "+t+" exists, but the property is not available.");return}if(oi&&d+1>=n.length){var v=oi(o,f);p=!!v,p&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[f]}else p=Ka(o,f),o=o[f];p&&!c&&(li[a]=o)}}return o},kd={exports:{}};(function(e){var t=Ou,r=ku,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||t.call(i,n),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}e.exports=function(p){var f=s(t,i,arguments);if(a&&o){var m=a(f,"length");m.configurable&&o(f,"length",{value:1+c(0,p.length-(arguments.length-1))})}return f};var h=function(){return s(t,n,arguments)};o?o(e.exports,"apply",{value:h}):e.exports.apply=h})(kd);var ib=kd.exports,Rd=ku,Nd=ib,sb=Nd(Rd("String.prototype.indexOf")),ab=function(t,r){var n=Rd(t,!!r);return typeof n=="function"&&sb(t,".prototype.")>-1?Nd(n):n};const ob=id(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ru=typeof Map=="function"&&Map.prototype,Nu=Object.getOwnPropertyDescriptor&&Ru?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qa=Ru&&Nu&&typeof Nu.get=="function"?Nu.get:null,Md=Ru&&Map.prototype.forEach,Mu=typeof Set=="function"&&Set.prototype,Lu=Object.getOwnPropertyDescriptor&&Mu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ja=Mu&&Lu&&typeof Lu.get=="function"?Lu.get:null,Ld=Mu&&Set.prototype.forEach,lb=typeof WeakMap=="function"&&WeakMap.prototype,Fs=lb?WeakMap.prototype.has:null,ub=typeof WeakSet=="function"&&WeakSet.prototype,Ds=ub?WeakSet.prototype.has:null,cb=typeof WeakRef=="function"&&WeakRef.prototype,Bd=cb?WeakRef.prototype.deref:null,hb=Boolean.prototype.valueOf,fb=Object.prototype.toString,db=Function.prototype.toString,pb=String.prototype.match,Bu=String.prototype.slice,Ln=String.prototype.replace,mb=String.prototype.toUpperCase,Fd=String.prototype.toLowerCase,Dd=RegExp.prototype.test,Ud=Array.prototype.concat,Yr=Array.prototype.join,gb=Array.prototype.slice,jd=Math.floor,Fu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Du=Object.getOwnPropertySymbols,Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$i=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ze=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$i||"symbol")?Symbol.toStringTag:null,$d=Object.prototype.propertyIsEnumerable,zd=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Hd(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Dd.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-jd(-e):jd(e);if(n!==e){var i=String(n),s=Bu.call(t,i.length+1);return Ln.call(i,r,"$&_")+"."+Ln.call(Ln.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ln.call(t,r,"$&_")}var ju=ob,Gd=ju.custom,qd=Xd(Gd)?Gd:null,yb=function e(t,r,n,i){var s=r||{};if(Bn(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Bn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Bn(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Bn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Bn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.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 Kd(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return o?Hd(t,c):c}if(typeof t=="bigint"){var h=String(t)+"n";return o?Hd(t,h):h}var d=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof t=="object")return $u(t)?"[Array]":"[Object]";var p=Lb(s,n);if(typeof i>"u")i=[];else if(Yd(i,t)>=0)return"[Circular]";function f(M,F,$){if(F&&(i=gb.call(i),i.push(F)),$){var V={depth:s.depth};return Bn(s,"quoteStyle")&&(V.quoteStyle=s.quoteStyle),e(M,V,n+1,i)}return e(M,s,n+1,i)}if(typeof t=="function"&&!Wd(t)){var m=Ab(t),g=to(t,f);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(g.length>0?" { "+Yr.call(g,", ")+" }":"")}if(Xd(t)){var v=$i?Ln.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Uu.call(t);return typeof t=="object"&&!$i?Us(v):v}if(Rb(t)){for(var b="<"+Fd.call(String(t.nodeName)),_=t.attributes||[],w=0;w<_.length;w++)b+=" "+_[w].name+"="+Vd(vb(_[w].value),"double",s);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+Fd.call(String(t.nodeName))+">",b}if($u(t)){if(t.length===0)return"[]";var S=to(t,f);return p&&!Mb(S)?"["+Hu(S,p)+"]":"[ "+Yr.call(S,", ")+" ]"}if(bb(t)){var x=to(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!$d.call(t,"cause")?"{ ["+String(t)+"] "+Yr.call(Ud.call("[cause]: "+f(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Yr.call(x,", ")+" }"}if(typeof t=="object"&&a){if(qd&&typeof t[qd]=="function"&&ju)return ju(t,{depth:d-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Cb(t)){var A=[];return Md&&Md.call(t,function(M,F){A.push(f(F,t,!0)+" => "+f(M,t))}),Zd("Map",Qa.call(t),A,p)}if(Ib(t)){var N=[];return Ld&&Ld.call(t,function(M){N.push(f(M,t))}),Zd("Set",Ja.call(t),N,p)}if(Ob(t))return zu("WeakMap");if(kb(t))return zu("WeakSet");if(Pb(t))return zu("WeakRef");if(wb(t))return Us(f(Number(t)));if(Tb(t))return Us(f(Fu.call(t)));if(Sb(t))return Us(hb.call(t));if(xb(t))return Us(f(String(t)));if(!_b(t)&&!Wd(t)){var O=to(t,f),P=zd?zd(t)===Object.prototype:t instanceof Object||t.constructor===Object,B=t instanceof Object?"":"null prototype",I=!P&&ze&&Object(t)===t&&ze in t?Bu.call(Fn(t),8,-1):B?"Object":"",C=P||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",k=C+(I||B?"["+Yr.call(Ud.call([],I||[],B||[]),": ")+"] ":"");return O.length===0?k+"{}":p?k+"{"+Hu(O,p)+"}":k+"{ "+Yr.call(O,", ")+" }"}return String(t)};function Vd(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function vb(e){return Ln.call(String(e),/"/g,"&quot;")}function $u(e){return Fn(e)==="[object Array]"&&(!ze||!(typeof e=="object"&&ze in e))}function _b(e){return Fn(e)==="[object Date]"&&(!ze||!(typeof e=="object"&&ze in e))}function Wd(e){return Fn(e)==="[object RegExp]"&&(!ze||!(typeof e=="object"&&ze in e))}function bb(e){return Fn(e)==="[object Error]"&&(!ze||!(typeof e=="object"&&ze in e))}function xb(e){return Fn(e)==="[object String]"&&(!ze||!(typeof e=="object"&&ze in e))}function wb(e){return Fn(e)==="[object Number]"&&(!ze||!(typeof e=="object"&&ze in e))}function Sb(e){return Fn(e)==="[object Boolean]"&&(!ze||!(typeof e=="object"&&ze in e))}function Xd(e){if($i)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Uu)return!1;try{return Uu.call(e),!0}catch{}return!1}function Tb(e){if(!e||typeof e!="object"||!Fu)return!1;try{return Fu.call(e),!0}catch{}return!1}var Eb=Object.prototype.hasOwnProperty||function(e){return e in this};function Bn(e,t){return Eb.call(e,t)}function Fn(e){return fb.call(e)}function Ab(e){if(e.name)return e.name;var t=pb.call(db.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Yd(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Cb(e){if(!Qa||!e||typeof e!="object")return!1;try{Qa.call(e);try{Ja.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Ob(e){if(!Fs||!e||typeof e!="object")return!1;try{Fs.call(e,Fs);try{Ds.call(e,Ds)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Pb(e){if(!Bd||!e||typeof e!="object")return!1;try{return Bd.call(e),!0}catch{}return!1}function Ib(e){if(!Ja||!e||typeof e!="object")return!1;try{Ja.call(e);try{Qa.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function kb(e){if(!Ds||!e||typeof e!="object")return!1;try{Ds.call(e,Ds);try{Fs.call(e,Fs)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Rb(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Kd(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Kd(Bu.call(e,0,t.maxStringLength),t)+n}var i=Ln.call(Ln.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Nb);return Vd(i,"single",t)}function Nb(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+mb.call(t.toString(16))}function Us(e){return"Object("+e+")"}function zu(e){return e+" { ? }"}function Zd(e,t,r,n){var i=n?Hu(r,n):Yr.call(r,", ");return e+" ("+t+") {"+i+"}"}function Mb(e){for(var t=0;t<e.length;t++)if(Yd(e[t],`
10
- `)>=0)return!1;return!0}function Lb(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Yr.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Yr.call(Array(t+1),r)}}function Hu(e,t){if(e.length===0)return"";var r=`
11
- `+t.prev+t.base;return r+Yr.call(e,","+r)+`
12
- `+t.prev}function to(e,t){var r=$u(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Bn(e,i)?t(e[i],e):""}var s=typeof Du=="function"?Du(e):[],a;if($i){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var c in e)Bn(e,c)&&(r&&String(Number(c))===c&&c<e.length||$i&&a["$"+c]instanceof Symbol||(Dd.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof Du=="function")for(var h=0;h<s.length;h++)$d.call(e,s[h])&&n.push("["+t(s[h])+"]: "+t(e[s[h]],e));return n}var Gu=ku,zi=ab,Bb=yb,Fb=Gu("%TypeError%"),eo=Gu("%WeakMap%",!0),ro=Gu("%Map%",!0),Db=zi("WeakMap.prototype.get",!0),Ub=zi("WeakMap.prototype.set",!0),jb=zi("WeakMap.prototype.has",!0),$b=zi("Map.prototype.get",!0),zb=zi("Map.prototype.set",!0),Hb=zi("Map.prototype.has",!0),qu=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},Gb=function(e,t){var r=qu(e,t);return r&&r.value},qb=function(e,t,r){var n=qu(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},Vb=function(e,t){return!!qu(e,t)},Wb=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new Fb("Side channel does not contain "+Bb(s))},get:function(s){if(eo&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Db(t,s)}else if(ro){if(r)return $b(r,s)}else if(n)return Gb(n,s)},has:function(s){if(eo&&s&&(typeof s=="object"||typeof s=="function")){if(t)return jb(t,s)}else if(ro){if(r)return Hb(r,s)}else if(n)return Vb(n,s);return!1},set:function(s,a){eo&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new eo),Ub(t,s,a)):ro?(r||(r=new ro),zb(r,s,a)):(n||(n={key:{},next:null}),qb(n,s,a))}};return i},Xb=String.prototype.replace,Yb=/%20/g,Vu={RFC1738:"RFC1738",RFC3986:"RFC3986"},Wu={default:Vu.RFC3986,formatters:{RFC1738:function(e){return Xb.call(e,Yb,"+")},RFC3986:function(e){return String(e)}},RFC1738:Vu.RFC1738,RFC3986:Vu.RFC3986},Kb=Wu,Xu=Object.prototype.hasOwnProperty,ui=Array.isArray,Kr=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Zb=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(ui(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Qd=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},Qb=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(ui(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Xu.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return ui(t)&&!ui(r)&&(i=Qd(t,n)),ui(t)&&ui(r)?(r.forEach(function(s,a){if(Xu.call(t,a)){var o=t[a];o&&typeof o=="object"&&s&&typeof s=="object"?t[a]=e(o,s,n):t.push(s)}else t[a]=s}),t):Object.keys(r).reduce(function(s,a){var o=r[a];return Xu.call(s,a)?s[a]=e(s[a],o,n):s[a]=o,s},i)},Jb=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},t1=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},e1=function(t,r,n,i,s){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var o="",c=0;c<a.length;++c){var h=a.charCodeAt(c);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===Kb.RFC1738&&(h===40||h===41)){o+=a.charAt(c);continue}if(h<128){o=o+Kr[h];continue}if(h<2048){o=o+(Kr[192|h>>6]+Kr[128|h&63]);continue}if(h<55296||h>=57344){o=o+(Kr[224|h>>12]+Kr[128|h>>6&63]+Kr[128|h&63]);continue}c+=1,h=65536+((h&1023)<<10|a.charCodeAt(c)&1023),o+=Kr[240|h>>18]+Kr[128|h>>12&63]+Kr[128|h>>6&63]+Kr[128|h&63]}return o},r1=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],a=s.obj[s.prop],o=Object.keys(a),c=0;c<o.length;++c){var h=o[c],d=a[h];typeof d=="object"&&d!==null&&n.indexOf(d)===-1&&(r.push({obj:a,prop:h}),n.push(d))}return Zb(r),t},n1=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},i1=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},s1=function(t,r){return[].concat(t,r)},a1=function(t,r){if(ui(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},Jd={arrayToObject:Qd,assign:Jb,combine:s1,compact:r1,decode:t1,encode:e1,isBuffer:i1,isRegExp:n1,maybeMap:a1,merge:Qb},tp=Wb,no=Jd,js=Wu,o1=Object.prototype.hasOwnProperty,ep={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},bn=Array.isArray,l1=Array.prototype.push,rp=function(e,t){l1.apply(e,bn(t)?t:[t])},u1=Date.prototype.toISOString,np=js.default,He={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:no.encode,encodeValuesOnly:!1,format:np,formatter:js.formatters[np],indices:!1,serializeDate:function(t){return u1.call(t)},skipNulls:!1,strictNullHandling:!1},c1=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Yu={},h1=function e(t,r,n,i,s,a,o,c,h,d,p,f,m,g,v,b){for(var _=t,w=b,S=0,x=!1;(w=w.get(Yu))!==void 0&&!x;){var A=w.get(t);if(S+=1,typeof A<"u"){if(A===S)throw new RangeError("Cyclic object value");x=!0}typeof w.get(Yu)>"u"&&(S=0)}if(typeof c=="function"?_=c(r,_):_ instanceof Date?_=p(_):n==="comma"&&bn(_)&&(_=no.maybeMap(_,function(V){return V instanceof Date?p(V):V})),_===null){if(s)return o&&!g?o(r,He.encoder,v,"key",f):r;_=""}if(c1(_)||no.isBuffer(_)){if(o){var N=g?r:o(r,He.encoder,v,"key",f);return[m(N)+"="+m(o(_,He.encoder,v,"value",f))]}return[m(r)+"="+m(String(_))]}var O=[];if(typeof _>"u")return O;var P;if(n==="comma"&&bn(_))g&&o&&(_=no.maybeMap(_,o)),P=[{value:_.length>0?_.join(",")||null:void 0}];else if(bn(c))P=c;else{var B=Object.keys(_);P=h?B.sort(h):B}for(var I=i&&bn(_)&&_.length===1?r+"[]":r,C=0;C<P.length;++C){var k=P[C],M=typeof k=="object"&&typeof k.value<"u"?k.value:_[k];if(!(a&&M===null)){var F=bn(_)?typeof n=="function"?n(I,k):I:I+(d?"."+k:"["+k+"]");b.set(t,S);var $=tp();$.set(Yu,b),rp(O,e(M,F,n,i,s,a,n==="comma"&&g&&bn(_)?null:o,c,h,d,p,f,m,g,v,$))}}return O},f1=function(t){if(!t)return He;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||He.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 n=js.default;if(typeof t.format<"u"){if(!o1.call(js.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=js.formatters[n],s=He.filter;return(typeof t.filter=="function"||bn(t.filter))&&(s=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:He.addQueryPrefix,allowDots:typeof t.allowDots>"u"?He.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:He.charsetSentinel,delimiter:typeof t.delimiter>"u"?He.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:He.encode,encoder:typeof t.encoder=="function"?t.encoder:He.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:He.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:He.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:He.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:He.strictNullHandling}},d1=function(e,t){var r=e,n=f1(t),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):bn(n.filter)&&(s=n.filter,i=s);var a=[];if(typeof r!="object"||r===null)return"";var o;t&&t.arrayFormat in ep?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var c=ep[o];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=c==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var d=tp(),p=0;p<i.length;++p){var f=i[p];n.skipNulls&&r[f]===null||rp(a,h1(r[f],f,c,h,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var m=a.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),m.length>0?g+m:""},Hi=Jd,Ku=Object.prototype.hasOwnProperty,p1=Array.isArray,Ne={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Hi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},m1=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},ip=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},g1="utf8=%26%2310003%3B",y1="utf8=%E2%9C%93",v1=function(t,r){var n={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=i.split(r.delimiter,s),o=-1,c,h=r.charset;if(r.charsetSentinel)for(c=0;c<a.length;++c)a[c].indexOf("utf8=")===0&&(a[c]===y1?h="utf-8":a[c]===g1&&(h="iso-8859-1"),o=c,c=a.length);for(c=0;c<a.length;++c)if(c!==o){var d=a[c],p=d.indexOf("]="),f=p===-1?d.indexOf("="):p+1,m,g;f===-1?(m=r.decoder(d,Ne.decoder,h,"key"),g=r.strictNullHandling?null:""):(m=r.decoder(d.slice(0,f),Ne.decoder,h,"key"),g=Hi.maybeMap(ip(d.slice(f+1),r),function(v){return r.decoder(v,Ne.decoder,h,"value")})),g&&r.interpretNumericEntities&&h==="iso-8859-1"&&(g=m1(g)),d.indexOf("[]=")>-1&&(g=p1(g)?[g]:g),Ku.call(n,m)?n[m]=Hi.combine(n[m],g):n[m]=g}return n},_1=function(e,t,r,n){for(var i=n?t:ip(t,r),s=e.length-1;s>=0;--s){var a,o=e[s];if(o==="[]"&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,h=parseInt(c,10);!r.parseArrays&&c===""?a={0:i}:!isNaN(h)&&o!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[],a[h]=i):c!=="__proto__"&&(a[c]=i)}i=a}return i},b1=function(t,r,n,i){if(t){var s=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,c=n.depth>0&&a.exec(s),h=c?s.slice(0,c.index):s,d=[];if(h){if(!n.plainObjects&&Ku.call(Object.prototype,h)&&!n.allowPrototypes)return;d.push(h)}for(var p=0;n.depth>0&&(c=o.exec(s))!==null&&p<n.depth;){if(p+=1,!n.plainObjects&&Ku.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}return c&&d.push("["+s.slice(c.index)+"]"),_1(d,r,n,i)}},x1=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 r=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:r,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"||Hi.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}},w1=function(e,t){var r=x1(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?v1(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),a=0;a<s.length;++a){var o=s[a],c=b1(o,n[o],r,typeof e=="string");i=Hi.merge(i,c,r)}return r.allowSparse===!0?i:Hi.compact(i)},S1=d1,T1=w1,E1=Wu,A1={formats:E1,parse:T1,stringify:S1},C1=N_;function Or(){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 O1=/^([a-z0-9.+-]+:)/i,P1=/:[0-9]*$/,I1=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,k1=["<",">",'"',"`"," ","\r",`
13
- `," "],R1=["{","}","|","\\","^","`"].concat(k1),Zu=["'"].concat(R1),sp=["%","/","?",";","#"].concat(Zu),ap=["/","?","#"],N1=255,op=/^[+a-z0-9A-Z_-]{0,63}$/,M1=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,L1={javascript:!0,"javascript:":!0},Qu={javascript:!0,"javascript:":!0},Gi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Ju=A1;function io(e,t,r){if(e&&typeof e=="object"&&e instanceof Or)return e;var n=new Or;return n.parse(e,t,r),n}Or.prototype.parse=function(e,t,r){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n<e.indexOf("#")?"?":"#",s=e.split(i),a=/\\/g;s[0]=s[0].replace(a,"/"),e=s.join(i);var o=e;if(o=o.trim(),!r&&e.split("#").length===1){var c=I1.exec(o);if(c)return this.path=o,this.href=o,this.pathname=c[1],c[2]?(this.search=c[2],t?this.query=Ju.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=O1.exec(o);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@/]+@[^@/]+/)){var p=o.substr(0,2)==="//";p&&!(h&&Qu[h])&&(o=o.substr(2),this.slashes=!0)}if(!Qu[h]&&(p||h&&!Gi[h])){for(var f=-1,m=0;m<ap.length;m++){var g=o.indexOf(ap[m]);g!==-1&&(f===-1||g<f)&&(f=g)}var v,b;f===-1?b=o.lastIndexOf("@"):b=o.lastIndexOf("@",f),b!==-1&&(v=o.slice(0,b),o=o.slice(b+1),this.auth=decodeURIComponent(v)),f=-1;for(var m=0;m<sp.length;m++){var g=o.indexOf(sp[m]);g!==-1&&(f===-1||g<f)&&(f=g)}f===-1&&(f=o.length),this.host=o.slice(0,f),o=o.slice(f),this.parseHost(),this.hostname=this.hostname||"";var _=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!_)for(var w=this.hostname.split(/\./),m=0,S=w.length;m<S;m++){var x=w[m];if(x&&!x.match(op)){for(var A="",N=0,O=x.length;N<O;N++)x.charCodeAt(N)>127?A+="x":A+=x[N];if(!A.match(op)){var P=w.slice(0,m),B=w.slice(m+1),I=x.match(M1);I&&(P.push(I[1]),B.unshift(I[2])),B.length&&(o="/"+B.join(".")+o),this.hostname=P.join(".");break}}}this.hostname.length>N1?this.hostname="":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=C1.toASCII(this.hostname));var C=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+C,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!L1[d])for(var m=0,S=Zu.length;m<S;m++){var M=Zu[m];if(o.indexOf(M)!==-1){var F=encodeURIComponent(M);F===M&&(F=escape(M)),o=o.split(M).join(F)}}var $=o.indexOf("#");$!==-1&&(this.hash=o.substr($),o=o.slice(0,$));var V=o.indexOf("?");if(V!==-1?(this.search=o.substr(V),this.query=o.substr(V+1),t&&(this.query=Ju.parse(this.query)),o=o.slice(0,V)):t&&(this.search="",this.query={}),o&&(this.pathname=o),Gi[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var C=this.pathname||"",q=this.search||"";this.path=C+q}return this.href=this.format(),this};function B1(e){return typeof e=="string"&&(e=io(e)),e instanceof Or?e.format():Or.prototype.format.call(e)}Or.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=Ju.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Gi[t])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),t+i+r+a+n};function F1(e,t){return io(e,!1,!0).resolve(t)}Or.prototype.resolve=function(e){return this.resolveObject(io(e,!1,!0)).format()},Or.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new Or;t.parse(e,!1,!0),e=t}for(var r=new Or,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),o=0;o<a.length;o++){var c=a[o];c!=="protocol"&&(r[c]=e[c])}return Gi[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!Gi[e.protocol]){for(var h=Object.keys(e),d=0;d<h.length;d++){var p=h[d];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!Qu[e.protocol]){for(var S=(e.pathname||"").split("/");S.length&&!(e.host=S.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),S[0]!==""&&S.unshift(""),S.length<2&&S.unshift(""),r.pathname=S.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var f=r.pathname||"",m=r.search||"";r.path=f+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&r.pathname.charAt(0)==="/",v=e.host||e.pathname&&e.pathname.charAt(0)==="/",b=v||g||r.host&&e.pathname,_=b,w=r.pathname&&r.pathname.split("/")||[],S=e.pathname&&e.pathname.split("/")||[],x=r.protocol&&!Gi[r.protocol];if(x&&(r.hostname="",r.port=null,r.host&&(w[0]===""?w[0]=r.host:w.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(S[0]===""?S[0]=e.host:S.unshift(e.host)),e.host=null),b=b&&(S[0]===""||w[0]==="")),v)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,w=S;else if(S.length)w||(w=[]),w.pop(),w=w.concat(S),r.search=e.search,r.query=e.query;else if(e.search!=null){if(x){r.host=w.shift(),r.hostname=r.host;var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.hostname=A.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var N=w.slice(-1)[0],O=(r.host||e.host||w.length>1)&&(N==="."||N==="..")||N==="",P=0,B=w.length;B>=0;B--)N=w[B],N==="."?w.splice(B,1):N===".."?(w.splice(B,1),P++):P&&(w.splice(B,1),P--);if(!b&&!_)for(;P--;P)w.unshift("..");b&&w[0]!==""&&(!w[0]||w[0].charAt(0)!=="/")&&w.unshift(""),O&&w.join("/").substr(-1)!=="/"&&w.push("");var I=w[0]===""||w[0]&&w[0].charAt(0)==="/";if(x){r.hostname=I?"":w.length?w.shift():"",r.host=r.hostname;var A=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;A&&(r.auth=A.shift(),r.hostname=A.shift(),r.host=r.hostname)}return b=b||r.host&&w.length,b&&!I&&w.unshift(""),w.length>0?r.pathname=w.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},Or.prototype.parseHost=function(){var e=this.host,t=P1.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var D1=io,U1=F1,j1=B1;const $1={parse:D1,format:j1,resolve:U1};function Pr(e){if(typeof e!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function $s(e){return e.split("?")[0].split("#")[0]}function z1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function H1(e,t,r){return e.replace(new RegExp(z1(t),"g"),r)}function G1(e,t){let r="",n=0,i=-1,s=0,a=-1;for(let o=0;o<=e.length;++o){if(o<e.length)a=e.charCodeAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){const c=r.lastIndexOf("/");if(c!==r.length-1){c===-1?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=o,s=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+=`/${e.slice(i+1,o)}`:r=e.slice(i+1,o),n=o-i-1;i=o,s=0}else a===46&&s!==-1?++s:s=-1}return r}const Ye={toPosix(e){return H1(e,"\\","/")},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},hasProtocol(e){return/^[^/:]+:\//.test(this.toPosix(e))},getProtocol(e){Pr(e),e=this.toPosix(e);let t="";const r=/^file:\/\/\//.exec(e),n=/^[^/:]+:\/\//.exec(e),i=/^[^/:]+:\//.exec(e);if(r||n||i){const s=(r==null?void 0:r[0])||(n==null?void 0:n[0])||(i==null?void 0:i[0]);t=s,e=e.slice(s.length)}return t},toAbsolute(e,t,r){if(this.isDataUrl(e))return e;const n=$s(this.toPosix(t??Pt.ADAPTER.getBaseUrl())),i=$s(this.toPosix(r??this.rootname(n)));return Pr(e),e=this.toPosix(e),e.startsWith("/")?Ye.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(n,e)},normalize(e){if(e=this.toPosix(e),Pr(e),e.length===0)return".";let t="";const r=e.startsWith("/");this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));const n=e.endsWith("/");return e=G1(e,!1),e.length>0&&n&&(e+="/"),r?`/${e}`:t+e},isAbsolute(e){return Pr(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith("/")},join(...e){if(e.length===0)return".";let t;for(let r=0;r<e.length;++r){const n=e[r];if(Pr(n),n.length>0)if(t===void 0)t=n;else{const i=e[r-1]??"";this.extname(i)?t+=`/../${n}`:t+=`/${n}`}}return t===void 0?".":this.normalize(t)},dirname(e){if(Pr(e),e.length===0)return".";e=this.toPosix(e);let t=e.charCodeAt(0);const r=t===47;let n=-1,i=!0;const s=this.getProtocol(e),a=e;e=e.slice(s.length);for(let o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!i){n=o;break}}else i=!1;return n===-1?r?"/":this.isUrl(a)?s+e:s:r&&n===1?"//":s+e.slice(0,n)},rootname(e){Pr(e),e=this.toPosix(e);let t="";if(e.startsWith("/")?t="/":t=this.getProtocol(e),this.isUrl(e)){const r=e.indexOf("/",t.length);r!==-1?t=e.slice(0,r):t=e,t.endsWith("/")||(t+="/")}return t},basename(e,t){Pr(e),t&&Pr(t),e=$s(this.toPosix(e));let r=0,n=-1,i=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let a=t.length-1,o=-1;for(s=e.length-1;s>=0;--s){const c=e.charCodeAt(s);if(c===47){if(!i){r=s+1;break}}else o===-1&&(i=!1,o=s+1),a>=0&&(c===t.charCodeAt(a)?--a===-1&&(n=s):(a=-1,n=o))}return r===n?n=o:n===-1&&(n=e.length),e.slice(r,n)}for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!i){r=s+1;break}}else n===-1&&(i=!1,n=s+1);return n===-1?"":e.slice(r,n)},extname(e){Pr(e),e=$s(this.toPosix(e));let t=-1,r=0,n=-1,i=!0,s=0;for(let a=e.length-1;a>=0;--a){const o=e.charCodeAt(a);if(o===47){if(!i){r=a+1;break}continue}n===-1&&(i=!1,n=a+1),o===46?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||n===-1||s===0||s===1&&t===n-1&&t===r+1?"":e.slice(t,n)},parse(e){Pr(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;e=$s(this.toPosix(e));let r=e.charCodeAt(0);const n=this.isAbsolute(e);let i;t.root=this.rootname(e),n||this.hasProtocol(e)?i=1:i=0;let s=-1,a=0,o=-1,c=!0,h=e.length-1,d=0;for(;h>=i;--h){if(r=e.charCodeAt(h),r===47){if(!c){a=h+1;break}continue}o===-1&&(c=!1,o=h+1),r===46?s===-1?s=h:d!==1&&(d=1):s!==-1&&(d=-1)}return s===-1||o===-1||d===0||d===1&&s===o-1&&s===a+1?o!==-1&&(a===0&&n?t.base=t.name=e.slice(1,o):t.base=t.name=e.slice(a,o)):(a===0&&n?(t.name=e.slice(1,s),t.base=e.slice(1,o)):(t.name=e.slice(a,s),t.base=e.slice(a,o)),t.ext=e.slice(s,o)),t.dir=this.dirname(e),t},sep:"/",delimiter:":"},lp={};function Kt(e,t,r=3){if(lp[t])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
9
+ */var Hh=J,zh=Symbol.for("react.element"),Vh=Symbol.for("react.fragment"),Xh=Object.prototype.hasOwnProperty,Wh=Hh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Yh={key:!0,ref:!0,__self:!0,__source:!0};function Ba(e,t,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)Xh.call(t,n)&&!Yh.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:zh,type:e,key:s,ref:a,props:i,_owner:Wh.current}}gn.Fragment=Vh,gn.jsx=Ba,gn.jsxs=Ba,Fa.exports=gn;var ft=Fa.exports,$e=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))($e||{}),Da=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(Da||{}),Di=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Di||{}),ut=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR",e))(ut||{}),Pe=(e=>(e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e))(Pe||{}),rt=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(rt||{}),lr=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(lr||{}),mt=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(mt||{}),Ui=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(Ui||{}),we=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(we||{}),$r=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))($r||{}),qe=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(qe||{}),Me=(e=>(e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",e))(Me||{}),He=(e=>(e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT",e))(He||{}),ji=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(ji||{}),Jt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Jt||{}),Ut=(e=>(e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE",e[e.COLOR=4]="COLOR",e))(Ut||{}),Dt=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(Dt||{}),ve=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(ve||{});const vt={ADAPTER:{createCanvas:(e,t)=>{const r=document.createElement("canvas");return r.width=e,r.height=t,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Gi=/iPhone/i,Ua=/iPod/i,ja=/iPad/i,Ga=/\biOS-universal(?:.+)Mac\b/i,$i=/\bAndroid(?:.+)Mobile\b/i,$a=/Android/i,ur=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,bn=/Silk/i,Ee=/Windows Phone/i,qa=/\bWindows(?:.+)ARM\b/i,Ha=/BlackBerry/i,za=/BB10/i,Va=/Opera Mini/i,Xa=/\b(CriOS|Chrome)(?:.+)Mobile/i,Wa=/Mobile(?:.+)Firefox\b/i,Ya=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function Kh(e){return function(t){return t.test(e)}}function Ka(e){var t={userAgent:"",platform:"",maxTouchPoints:0};!e&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e=="string"?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var r=t.userAgent,n=r.split("[FBAN");typeof n[1]<"u"&&(r=n[0]),n=r.split("Twitter"),typeof n[1]<"u"&&(r=n[0]);var i=Kh(r),s={apple:{phone:i(Gi)&&!i(Ee),ipod:i(Ua),tablet:!i(Gi)&&(i(ja)||Ya(t))&&!i(Ee),universal:i(Ga),device:(i(Gi)||i(Ua)||i(ja)||i(Ga)||Ya(t))&&!i(Ee)},amazon:{phone:i(ur),tablet:!i(ur)&&i(bn),device:i(ur)||i(bn)},android:{phone:!i(Ee)&&i(ur)||!i(Ee)&&i($i),tablet:!i(Ee)&&!i(ur)&&!i($i)&&(i(bn)||i($a)),device:!i(Ee)&&(i(ur)||i(bn)||i($i)||i($a))||i(/\bokhttp\b/i)},windows:{phone:i(Ee),tablet:i(qa),device:i(Ee)||i(qa)},other:{blackberry:i(Ha),blackberry10:i(za),opera:i(Va),firefox:i(Wa),chrome:i(Xa),device:i(Ha)||i(za)||i(Va)||i(Wa)||i(Xa)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const hr=(Ka.default??Ka)(globalThis.navigator);vt.RETINA_PREFIX=/@([0-9\.]+)x/,vt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Za={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,h,c){this.fn=l,this.context=h,this.once=c||!1}function s(l,h,c,f,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,f||l,u),p=r?r+h:h;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function a(l,h){--l._eventsCount===0?l._events=new n:delete l._events[h]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],c,f;if(this._eventsCount===0)return h;for(f in c=this._events)t.call(c,f)&&h.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(c)):h},o.prototype.listeners=function(h){var c=r?r+h:h,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var u=0,d=f.length,p=new Array(d);u<d;u++)p[u]=f[u].fn;return p},o.prototype.listenerCount=function(h){var c=r?r+h:h,f=this._events[c];return f?f.fn?1:f.length:0},o.prototype.emit=function(h,c,f,u,d,p){var v=r?r+h:h;if(!this._events[v])return!1;var g=this._events[v],y=arguments.length,b,_;if(g.fn){switch(g.once&&this.removeListener(h,g.fn,void 0,!0),y){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,f),!0;case 4:return g.fn.call(g.context,c,f,u),!0;case 5:return g.fn.call(g.context,c,f,u,d),!0;case 6:return g.fn.call(g.context,c,f,u,d,p),!0}for(_=1,b=new Array(y-1);_<y;_++)b[_-1]=arguments[_];g.fn.apply(g.context,b)}else{var m=g.length,x;for(_=0;_<m;_++)switch(g[_].once&&this.removeListener(h,g[_].fn,void 0,!0),y){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,c);break;case 3:g[_].fn.call(g[_].context,c,f);break;case 4:g[_].fn.call(g[_].context,c,f,u);break;default:if(!b)for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];g[_].fn.apply(g[_].context,b)}}return!0},o.prototype.on=function(h,c,f){return s(this,h,c,f,!1)},o.prototype.once=function(h,c,f){return s(this,h,c,f,!0)},o.prototype.removeListener=function(h,c,f,u){var d=r?r+h:h;if(!this._events[d])return this;if(!c)return a(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!u||p.once)&&(!f||p.context===f)&&a(this,d);else{for(var v=0,g=[],y=p.length;v<y;v++)(p[v].fn!==c||u&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[d]=g.length===1?g[0]:g:a(this,d)}return this},o.prototype.removeAllListeners=function(h){var c;return h?(c=r?r+h:h,this._events[c]&&a(this,c)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(Za);var Zh=Za.exports;const _n=or(Zh);var qi={exports:{}};qi.exports=xn,qi.exports.default=xn;function xn(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=Qa(e,0,i,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,l,h,c,f,u,d;if(n&&(s=rc(e,t,s,r)),e.length>80*r){o=h=e[0],l=c=e[1];for(var p=r;p<i;p+=r)f=e[p],u=e[p+1],f<o&&(o=f),u<l&&(l=u),f>h&&(h=f),u>c&&(c=u);d=Math.max(h-o,c-l),d=d!==0?32767/d:0}return qr(s,a,r,o,l,d,0),a}function Qa(e,t,r,n,i){var s,a;if(i===Vi(e,t,r,n)>0)for(s=t;s<r;s+=n)a=eo(s,e[s],e[s+1],a);else for(s=r-n;s>=t;s-=n)a=eo(s,e[s],e[s+1],a);return a&&wn(a,a.next)&&(zr(a),a=a.next),a}function ze(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(wn(r,r.next)||kt(r.prev,r,r.next)===0)){if(zr(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function qr(e,t,r,n,i,s,a){if(e){!a&&s&&oc(e,n,i,s);for(var o=e,l,h;e.prev!==e.next;){if(l=e.prev,h=e.next,s?Jh(e,n,i,s):Qh(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(h.i/r|0),zr(e),e=h.next,o=h.next;continue}if(e=h,e===o){a?a===1?(e=tc(ze(e),t,r),qr(e,t,r,n,i,s,2)):a===2&&ec(e,t,r,n,i,s):qr(ze(e),t,r,n,i,s,1);break}}}}function Qh(e){var t=e.prev,r=e,n=e.next;if(kt(t,r,n)>=0)return!1;for(var i=t.x,s=r.x,a=n.x,o=t.y,l=r.y,h=n.y,c=i<s?i<a?i:a:s<a?s:a,f=o<l?o<h?o:h:l<h?l:h,u=i>s?i>a?i:a:s>a?s:a,d=o>l?o>h?o:h:l>h?l:h,p=n.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=f&&p.y<=d&&cr(i,o,s,l,a,h,p.x,p.y)&&kt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Jh(e,t,r,n){var i=e.prev,s=e,a=e.next;if(kt(i,s,a)>=0)return!1;for(var o=i.x,l=s.x,h=a.x,c=i.y,f=s.y,u=a.y,d=o<l?o<h?o:h:l<h?l:h,p=c<f?c<u?c:u:f<u?f:u,v=o>l?o>h?o:h:l>h?l:h,g=c>f?c>u?c:u:f>u?f:u,y=Hi(d,p,t,r,n),b=Hi(v,g,t,r,n),_=e.prevZ,m=e.nextZ;_&&_.z>=y&&m&&m.z<=b;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&cr(o,c,l,f,h,u,_.x,_.y)&&kt(_.prev,_,_.next)>=0||(_=_.prevZ,m.x>=d&&m.x<=v&&m.y>=p&&m.y<=g&&m!==i&&m!==a&&cr(o,c,l,f,h,u,m.x,m.y)&&kt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;_&&_.z>=y;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&cr(o,c,l,f,h,u,_.x,_.y)&&kt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;m&&m.z<=b;){if(m.x>=d&&m.x<=v&&m.y>=p&&m.y<=g&&m!==i&&m!==a&&cr(o,c,l,f,h,u,m.x,m.y)&&kt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function tc(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!wn(i,s)&&Ja(i,n,n.next,s)&&Hr(i,s)&&Hr(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),zr(n),zr(n.next),n=e=s),n=n.next}while(n!==e);return ze(n)}function ec(e,t,r,n,i,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&hc(a,o)){var l=to(a,o);a=ze(a,a.next),l=ze(l,l.next),qr(a,t,r,n,i,s,0),qr(l,t,r,n,i,s,0);return}o=o.next}a=a.next}while(a!==e)}function rc(e,t,r,n){var i=[],s,a,o,l,h;for(s=0,a=t.length;s<a;s++)o=t[s]*n,l=s<a-1?t[s+1]*n:e.length,h=Qa(e,o,l,n,!1),h===h.next&&(h.steiner=!0),i.push(uc(h));for(i.sort(nc),s=0;s<i.length;s++)r=ic(i[s],r);return r}function nc(e,t){return e.x-t.x}function ic(e,t){var r=sc(e,t);if(!r)return t;var n=to(r,e);return ze(n,n.next),ze(r,r.next)}function sc(e,t){var r=t,n=e.x,i=e.y,s=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=n&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,h=a.x,c=a.y,f=1/0,u;r=a;do n>=r.x&&r.x>=h&&n!==r.x&&cr(i<c?n:s,i,h,c,i<c?s:n,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(n-r.x),Hr(r,e)&&(u<f||u===f&&(r.x>a.x||r.x===a.x&&ac(a,r)))&&(a=r,f=u)),r=r.next;while(r!==l);return a}function ac(e,t){return kt(e.prev,e,t.prev)<0&&kt(t.next,e,e.next)<0}function oc(e,t,r,n){var i=e;do i.z===0&&(i.z=Hi(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,lc(i)}function lc(e){var t,r,n,i,s,a,o,l,h=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,n=r,o=0,t=0;t<h&&(o++,n=n.nextZ,!!n);t++);for(l=h;o>0||l>0&&n;)o!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,o--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,h*=2}while(a>1);return e}function Hi(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function uc(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function cr(e,t,r,n,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(n-o)>=(r-a)*(t-o)&&(r-a)*(s-o)>=(i-a)*(n-o)}function hc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!cc(e,t)&&(Hr(e,t)&&Hr(t,e)&&fc(e,t)&&(kt(e.prev,e,t.prev)||kt(e,t.prev,t))||wn(e,t)&&kt(e.prev,e,e.next)>0&&kt(t.prev,t,t.next)>0)}function kt(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function wn(e,t){return e.x===t.x&&e.y===t.y}function Ja(e,t,r,n){var i=Tn(kt(e,t,r)),s=Tn(kt(e,t,n)),a=Tn(kt(r,n,e)),o=Tn(kt(r,n,t));return!!(i!==s&&a!==o||i===0&&En(e,r,t)||s===0&&En(e,n,t)||a===0&&En(r,e,n)||o===0&&En(r,t,n))}function En(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Tn(e){return e>0?1:e<0?-1:0}function cc(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Ja(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Hr(e,t){return kt(e.prev,e,e.next)<0?kt(e,t,e.next)>=0&&kt(e,e.prev,t)>=0:kt(e,t,e.prev)<0||kt(e,e.next,t)<0}function fc(e,t){var r=e,n=!1,i=(e.x+t.x)/2,s=(e.y+t.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function to(e,t){var r=new zi(e.i,e.x,e.y),n=new zi(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function eo(e,t,r,n){var i=new zi(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function zr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function zi(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}xn.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,a=Math.abs(Vi(e,0,s,r));if(i)for(var o=0,l=t.length;o<l;o++){var h=t[o]*r,c=o<l-1?t[o+1]*r:e.length;a-=Math.abs(Vi(e,h,c,r))}var f=0;for(o=0;o<n.length;o+=3){var u=n[o]*r,d=n[o+1]*r,p=n[o+2]*r;f+=Math.abs((e[u]-e[p])*(e[d+1]-e[u+1])-(e[u]-e[d])*(e[p+1]-e[u+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Vi(e,t,r,n){for(var i=0,s=t,a=r-n;s<r;s+=n)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}xn.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var s=0;s<e[i].length;s++)for(var a=0;a<t;a++)r.vertices.push(e[i][s][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r};var dc=qi.exports;const pc=or(dc);var An={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */An.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof ke=="object"&&ke;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,l=36,h=1,c=26,f=38,u=700,d=72,p=128,v="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=l-h,x=Math.floor,S=String.fromCharCode,w;function T(k){throw new RangeError(_[k])}function N(k,I){for(var P=k.length,L=[];P--;)L[P]=I(k[P]);return L}function A(k,I){var P=k.split("@"),L="";P.length>1&&(L=P[0]+"@",k=P[1]),k=k.replace(b,".");var G=k.split("."),$=N(G,I).join(".");return L+$}function E(k){for(var I=[],P=0,L=k.length,G,$;P<L;)G=k.charCodeAt(P++),G>=55296&&G<=56319&&P<L?($=k.charCodeAt(P++),($&64512)==56320?I.push(((G&1023)<<10)+($&1023)+65536):(I.push(G),P--)):I.push(G);return I}function O(k){return N(k,function(I){var P="";return I>65535&&(I-=65536,P+=S(I>>>10&1023|55296),I=56320|I&1023),P+=S(I),P}).join("")}function R(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function C(k,I){return k+22+75*(k<26)-((I!=0)<<5)}function F(k,I,P){var L=0;for(k=P?x(k/u):k>>1,k+=x(k/I);k>m*c>>1;L+=l)k=x(k/m);return x(L+(m+1)*k/(k+f))}function U(k){var I=[],P=k.length,L,G=0,$=p,M=d,B,q,H,X,K,et,it,ot,ht;for(B=k.lastIndexOf(v),B<0&&(B=0),q=0;q<B;++q)k.charCodeAt(q)>=128&&T("not-basic"),I.push(k.charCodeAt(q));for(H=B>0?B+1:0;H<P;){for(X=G,K=1,et=l;H>=P&&T("invalid-input"),it=R(k.charCodeAt(H++)),(it>=l||it>x((o-G)/K))&&T("overflow"),G+=it*K,ot=et<=M?h:et>=M+c?c:et-M,!(it<ot);et+=l)ht=l-ot,K>x(o/ht)&&T("overflow"),K*=ht;L=I.length+1,M=F(G-X,L,X==0),x(G/L)>o-$&&T("overflow"),$+=x(G/L),G%=L,I.splice(G++,0,$)}return O(I)}function D(k){var I,P,L,G,$,M,B,q,H,X,K,et=[],it,ot,ht,Ct;for(k=E(k),it=k.length,I=p,P=0,$=d,M=0;M<it;++M)K=k[M],K<128&&et.push(S(K));for(L=G=et.length,G&&et.push(v);L<it;){for(B=o,M=0;M<it;++M)K=k[M],K>=I&&K<B&&(B=K);for(ot=L+1,B-I>x((o-P)/ot)&&T("overflow"),P+=(B-I)*ot,I=B,M=0;M<it;++M)if(K=k[M],K<I&&++P>o&&T("overflow"),K==I){for(q=P,H=l;X=H<=$?h:H>=$+c?c:H-$,!(q<X);H+=l)Ct=q-X,ht=l-X,et.push(S(C(X+Ct%ht,0))),q=x(Ct/ht);et.push(S(C(q,0))),$=F(P,ot,L==G),P=0,++L}++P,++I}return et.join("")}function z(k){return A(k,function(I){return g.test(I)?U(I.slice(4).toLowerCase()):I})}function j(k){return A(k,function(I){return y.test(I)?"xn--"+D(I):I})}if(a={version:"1.4.1",ucs2:{decode:E,encode:O},decode:U,encode:D,toASCII:j,toUnicode:z},n&&i)if(e.exports==n)i.exports=a;else for(w in a)a.hasOwnProperty(w)&&(n[w]=a[w]);else r.punycode=a})(ke)}(An,An.exports);var yc=An.exports,vc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r 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 s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0},ro=typeof Symbol<"u"&&Symbol,mc=vc,gc=function(){return typeof ro!="function"||typeof Symbol!="function"||typeof ro("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mc()},no={foo:{}},bc=Object,_c=function(){return{__proto__:no}.foo===no.foo&&!({__proto__:null}instanceof bc)},xc="Function.prototype.bind called on incompatible ",Xi=Array.prototype.slice,wc=Object.prototype.toString,Ec="[object Function]",Tc=function(t){var r=this;if(typeof r!="function"||wc.call(r)!==Ec)throw new TypeError(xc+r);for(var n=Xi.call(arguments,1),i,s=function(){if(this instanceof i){var c=r.apply(this,n.concat(Xi.call(arguments)));return Object(c)===c?c:this}else return r.apply(t,n.concat(Xi.call(arguments)))},a=Math.max(0,r.length-n.length),o=[],l=0;l<a;l++)o.push("$"+l);if(i=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=function(){};h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},Ac=Tc,Wi=Function.prototype.bind||Ac,Sc=Wi,Oc=Sc.call(Function.call,Object.prototype.hasOwnProperty),dt,fr=SyntaxError,io=Function,dr=TypeError,Yi=function(e){try{return io('"use strict"; return ('+e+").constructor;")()}catch{}},Ve=Object.getOwnPropertyDescriptor;if(Ve)try{Ve({},"")}catch{Ve=null}var Ki=function(){throw new dr},Rc=Ve?function(){try{return arguments.callee,Ki}catch{try{return Ve(arguments,"callee").get}catch{return Ki}}}():Ki,pr=gc(),Ic=_c(),jt=Object.getPrototypeOf||(Ic?function(e){return e.__proto__}:null),yr={},Nc=typeof Uint8Array>"u"||!jt?dt:jt(Uint8Array),Xe={"%AggregateError%":typeof AggregateError>"u"?dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?dt:ArrayBuffer,"%ArrayIteratorPrototype%":pr&&jt?jt([][Symbol.iterator]()):dt,"%AsyncFromSyncIteratorPrototype%":dt,"%AsyncFunction%":yr,"%AsyncGenerator%":yr,"%AsyncGeneratorFunction%":yr,"%AsyncIteratorPrototype%":yr,"%Atomics%":typeof Atomics>"u"?dt:Atomics,"%BigInt%":typeof BigInt>"u"?dt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?dt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?dt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?dt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?dt:FinalizationRegistry,"%Function%":io,"%GeneratorFunction%":yr,"%Int8Array%":typeof Int8Array>"u"?dt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?dt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":pr&&jt?jt(jt([][Symbol.iterator]())):dt,"%JSON%":typeof JSON=="object"?JSON:dt,"%Map%":typeof Map>"u"?dt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!pr||!jt?dt:jt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?dt:Promise,"%Proxy%":typeof Proxy>"u"?dt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?dt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?dt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!pr||!jt?dt:jt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":pr&&jt?jt(""[Symbol.iterator]()):dt,"%Symbol%":pr?Symbol:dt,"%SyntaxError%":fr,"%ThrowTypeError%":Rc,"%TypedArray%":Nc,"%TypeError%":dr,"%Uint8Array%":typeof Uint8Array>"u"?dt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?dt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?dt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?dt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?dt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?dt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?dt:WeakSet};if(jt)try{null.error}catch(e){var Cc=jt(jt(e));Xe["%Error.prototype%"]=Cc}var kc=function e(t){var r;if(t==="%AsyncFunction%")r=Yi("async function () {}");else if(t==="%GeneratorFunction%")r=Yi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Yi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&jt&&(r=jt(i.prototype))}return Xe[t]=r,r},so={"%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"]},Vr=Wi,Sn=Oc,Pc=Vr.call(Function.call,Array.prototype.concat),Mc=Vr.call(Function.apply,Array.prototype.splice),ao=Vr.call(Function.call,String.prototype.replace),On=Vr.call(Function.call,String.prototype.slice),Lc=Vr.call(Function.call,RegExp.prototype.exec),Fc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bc=/\\(\\)?/g,Dc=function(t){var r=On(t,0,1),n=On(t,-1);if(r==="%"&&n!=="%")throw new fr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new fr("invalid intrinsic syntax, expected opening `%`");var i=[];return ao(t,Fc,function(s,a,o,l){i[i.length]=o?ao(l,Bc,"$1"):a||s}),i},Uc=function(t,r){var n=t,i;if(Sn(so,n)&&(i=so[n],n="%"+i[0]+"%"),Sn(Xe,n)){var s=Xe[n];if(s===yr&&(s=kc(n)),typeof s>"u"&&!r)throw new dr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new fr("intrinsic "+t+" does not exist!")},Zi=function(t,r){if(typeof t!="string"||t.length===0)throw new dr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new dr('"allowMissing" argument must be a boolean');if(Lc(/^%?[^%]*%?$/,t)===null)throw new fr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Dc(t),i=n.length>0?n[0]:"",s=Uc("%"+i+"%",r),a=s.name,o=s.value,l=!1,h=s.alias;h&&(i=h[0],Mc(n,Pc([0,1],h)));for(var c=1,f=!0;c<n.length;c+=1){var u=n[c],d=On(u,0,1),p=On(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new fr("property names with quotes must have matching quotes");if((u==="constructor"||!f)&&(l=!0),i+="."+u,a="%"+i+"%",Sn(Xe,a))o=Xe[a];else if(o!=null){if(!(u in o)){if(!r)throw new dr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ve&&c+1>=n.length){var v=Ve(o,u);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[u]}else f=Sn(o,u),o=o[u];f&&!l&&(Xe[a]=o)}}return o},oo={exports:{}};(function(e){var t=Wi,r=Zi,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||t.call(i,n),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}e.exports=function(f){var u=s(t,i,arguments);if(a&&o){var d=a(u,"length");d.configurable&&o(u,"length",{value:1+l(0,f.length-(arguments.length-1))})}return u};var h=function(){return s(t,n,arguments)};o?o(e.exports,"apply",{value:h}):e.exports.apply=h})(oo);var jc=oo.exports,lo=Zi,uo=jc,Gc=uo(lo("String.prototype.indexOf")),$c=function(t,r){var n=lo(t,!!r);return typeof n=="function"&&Gc(t,".prototype.")>-1?uo(n):n};const qc=qh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Qi=typeof Map=="function"&&Map.prototype,Ji=Object.getOwnPropertyDescriptor&&Qi?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Rn=Qi&&Ji&&typeof Ji.get=="function"?Ji.get:null,ho=Qi&&Map.prototype.forEach,ts=typeof Set=="function"&&Set.prototype,es=Object.getOwnPropertyDescriptor&&ts?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,In=ts&&es&&typeof es.get=="function"?es.get:null,co=ts&&Set.prototype.forEach,Hc=typeof WeakMap=="function"&&WeakMap.prototype,Xr=Hc?WeakMap.prototype.has:null,zc=typeof WeakSet=="function"&&WeakSet.prototype,Wr=zc?WeakSet.prototype.has:null,Vc=typeof WeakRef=="function"&&WeakRef.prototype,fo=Vc?WeakRef.prototype.deref:null,Xc=Boolean.prototype.valueOf,Wc=Object.prototype.toString,Yc=Function.prototype.toString,Kc=String.prototype.match,rs=String.prototype.slice,Le=String.prototype.replace,Zc=String.prototype.toUpperCase,po=String.prototype.toLowerCase,yo=RegExp.prototype.test,vo=Array.prototype.concat,me=Array.prototype.join,Qc=Array.prototype.slice,mo=Math.floor,ns=typeof BigInt=="function"?BigInt.prototype.valueOf:null,is=Object.getOwnPropertySymbols,ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,vr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===vr||"symbol")?Symbol.toStringTag:null,go=Object.prototype.propertyIsEnumerable,bo=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function _o(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||yo.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-mo(-e):mo(e);if(n!==e){var i=String(n),s=rs.call(t,i.length+1);return Le.call(i,r,"$&_")+"."+Le.call(Le.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Le.call(t,r,"$&_")}var as=qc,xo=as.custom,wo=Ao(xo)?xo:null,Jc=function e(t,r,n,i){var s=r||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Fe(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.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 Oo(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return o?_o(t,l):l}if(typeof t=="bigint"){var h=String(t)+"n";return o?_o(t,h):h}var c=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof t=="object")return os(t)?"[Array]":"[Object]";var f=gf(s,n);if(typeof i>"u")i=[];else if(So(i,t)>=0)return"[Circular]";function u(R,C,F){if(C&&(i=Qc.call(i),i.push(C)),F){var U={depth:s.depth};return Fe(s,"quoteStyle")&&(U.quoteStyle=s.quoteStyle),e(R,U,n+1,i)}return e(R,s,n+1,i)}if(typeof t=="function"&&!To(t)){var d=uf(t),p=Nn(t,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+me.call(p,", ")+" }":"")}if(Ao(t)){var v=vr?Le.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ss.call(t);return typeof t=="object"&&!vr?Yr(v):v}if(yf(t)){for(var g="<"+po.call(String(t.nodeName)),y=t.attributes||[],b=0;b<y.length;b++)g+=" "+y[b].name+"="+Eo(tf(y[b].value),"double",s);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+po.call(String(t.nodeName))+">",g}if(os(t)){if(t.length===0)return"[]";var _=Nn(t,u);return f&&!mf(_)?"["+us(_,f)+"]":"[ "+me.call(_,", ")+" ]"}if(rf(t)){var m=Nn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!go.call(t,"cause")?"{ ["+String(t)+"] "+me.call(vo.call("[cause]: "+u(t.cause),m),", ")+" }":m.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+me.call(m,", ")+" }"}if(typeof t=="object"&&a){if(wo&&typeof t[wo]=="function"&&as)return as(t,{depth:c-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(hf(t)){var x=[];return ho&&ho.call(t,function(R,C){x.push(u(C,t,!0)+" => "+u(R,t))}),Ro("Map",Rn.call(t),x,f)}if(df(t)){var S=[];return co&&co.call(t,function(R){S.push(u(R,t))}),Ro("Set",In.call(t),S,f)}if(cf(t))return ls("WeakMap");if(pf(t))return ls("WeakSet");if(ff(t))return ls("WeakRef");if(sf(t))return Yr(u(Number(t)));if(of(t))return Yr(u(ns.call(t)));if(af(t))return Yr(Xc.call(t));if(nf(t))return Yr(u(String(t)));if(!ef(t)&&!To(t)){var w=Nn(t,u),T=bo?bo(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",A=!T&&Vt&&Object(t)===t&&Vt in t?rs.call(Be(t),8,-1):N?"Object":"",E=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",O=E+(A||N?"["+me.call(vo.call([],A||[],N||[]),": ")+"] ":"");return w.length===0?O+"{}":f?O+"{"+us(w,f)+"}":O+"{ "+me.call(w,", ")+" }"}return String(t)};function Eo(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function tf(e){return Le.call(String(e),/"/g,"&quot;")}function os(e){return Be(e)==="[object Array]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function ef(e){return Be(e)==="[object Date]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function To(e){return Be(e)==="[object RegExp]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function rf(e){return Be(e)==="[object Error]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function nf(e){return Be(e)==="[object String]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function sf(e){return Be(e)==="[object Number]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function af(e){return Be(e)==="[object Boolean]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Ao(e){if(vr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!ss)return!1;try{return ss.call(e),!0}catch{}return!1}function of(e){if(!e||typeof e!="object"||!ns)return!1;try{return ns.call(e),!0}catch{}return!1}var lf=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,t){return lf.call(e,t)}function Be(e){return Wc.call(e)}function uf(e){if(e.name)return e.name;var t=Kc.call(Yc.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function So(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function hf(e){if(!Rn||!e||typeof e!="object")return!1;try{Rn.call(e);try{In.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function cf(e){if(!Xr||!e||typeof e!="object")return!1;try{Xr.call(e,Xr);try{Wr.call(e,Wr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function ff(e){if(!fo||!e||typeof e!="object")return!1;try{return fo.call(e),!0}catch{}return!1}function df(e){if(!In||!e||typeof e!="object")return!1;try{In.call(e);try{Rn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function pf(e){if(!Wr||!e||typeof e!="object")return!1;try{Wr.call(e,Wr);try{Xr.call(e,Xr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function yf(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Oo(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Oo(rs.call(e,0,t.maxStringLength),t)+n}var i=Le.call(Le.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,vf);return Eo(i,"single",t)}function vf(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Zc.call(t.toString(16))}function Yr(e){return"Object("+e+")"}function ls(e){return e+" { ? }"}function Ro(e,t,r,n){var i=n?us(r,n):me.call(r,", ");return e+" ("+t+") {"+i+"}"}function mf(e){for(var t=0;t<e.length;t++)if(So(e[t],`
10
+ `)>=0)return!1;return!0}function gf(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=me.call(Array(e.indent+1)," ");else return null;return{base:r,prev:me.call(Array(t+1),r)}}function us(e,t){if(e.length===0)return"";var r=`
11
+ `+t.prev+t.base;return r+me.call(e,","+r)+`
12
+ `+t.prev}function Nn(e,t){var r=os(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Fe(e,i)?t(e[i],e):""}var s=typeof is=="function"?is(e):[],a;if(vr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var l in e)Fe(e,l)&&(r&&String(Number(l))===l&&l<e.length||vr&&a["$"+l]instanceof Symbol||(yo.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof is=="function")for(var h=0;h<s.length;h++)go.call(e,s[h])&&n.push("["+t(s[h])+"]: "+t(e[s[h]],e));return n}var hs=Zi,mr=$c,bf=Jc,_f=hs("%TypeError%"),Cn=hs("%WeakMap%",!0),kn=hs("%Map%",!0),xf=mr("WeakMap.prototype.get",!0),wf=mr("WeakMap.prototype.set",!0),Ef=mr("WeakMap.prototype.has",!0),Tf=mr("Map.prototype.get",!0),Af=mr("Map.prototype.set",!0),Sf=mr("Map.prototype.has",!0),cs=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},Of=function(e,t){var r=cs(e,t);return r&&r.value},Rf=function(e,t,r){var n=cs(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},If=function(e,t){return!!cs(e,t)},Nf=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new _f("Side channel does not contain "+bf(s))},get:function(s){if(Cn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return xf(t,s)}else if(kn){if(r)return Tf(r,s)}else if(n)return Of(n,s)},has:function(s){if(Cn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Ef(t,s)}else if(kn){if(r)return Sf(r,s)}else if(n)return If(n,s);return!1},set:function(s,a){Cn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Cn),wf(t,s,a)):kn?(r||(r=new kn),Af(r,s,a)):(n||(n={key:{},next:null}),Rf(n,s,a))}};return i},Cf=String.prototype.replace,kf=/%20/g,fs={RFC1738:"RFC1738",RFC3986:"RFC3986"},ds={default:fs.RFC3986,formatters:{RFC1738:function(e){return Cf.call(e,kf,"+")},RFC3986:function(e){return String(e)}},RFC1738:fs.RFC1738,RFC3986:fs.RFC3986},Pf=ds,ps=Object.prototype.hasOwnProperty,We=Array.isArray,ge=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Mf=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(We(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Io=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},Lf=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(We(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!ps.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return We(t)&&!We(r)&&(i=Io(t,n)),We(t)&&We(r)?(r.forEach(function(s,a){if(ps.call(t,a)){var o=t[a];o&&typeof o=="object"&&s&&typeof s=="object"?t[a]=e(o,s,n):t.push(s)}else t[a]=s}),t):Object.keys(r).reduce(function(s,a){var o=r[a];return ps.call(s,a)?s[a]=e(s[a],o,n):s[a]=o,s},i)},Ff=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},Bf=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Df=function(t,r,n,i,s){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var o="",l=0;l<a.length;++l){var h=a.charCodeAt(l);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===Pf.RFC1738&&(h===40||h===41)){o+=a.charAt(l);continue}if(h<128){o=o+ge[h];continue}if(h<2048){o=o+(ge[192|h>>6]+ge[128|h&63]);continue}if(h<55296||h>=57344){o=o+(ge[224|h>>12]+ge[128|h>>6&63]+ge[128|h&63]);continue}l+=1,h=65536+((h&1023)<<10|a.charCodeAt(l)&1023),o+=ge[240|h>>18]+ge[128|h>>12&63]+ge[128|h>>6&63]+ge[128|h&63]}return o},Uf=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],a=s.obj[s.prop],o=Object.keys(a),l=0;l<o.length;++l){var h=o[l],c=a[h];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:a,prop:h}),n.push(c))}return Mf(r),t},jf=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Gf=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},$f=function(t,r){return[].concat(t,r)},qf=function(t,r){if(We(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},No={arrayToObject:Io,assign:Ff,combine:$f,compact:Uf,decode:Bf,encode:Df,isBuffer:Gf,isRegExp:jf,maybeMap:qf,merge:Lf},Co=Nf,Pn=No,Kr=ds,Hf=Object.prototype.hasOwnProperty,ko={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Te=Array.isArray,zf=Array.prototype.push,Po=function(e,t){zf.apply(e,Te(t)?t:[t])},Vf=Date.prototype.toISOString,Mo=Kr.default,Xt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Pn.encode,encodeValuesOnly:!1,format:Mo,formatter:Kr.formatters[Mo],indices:!1,serializeDate:function(t){return Vf.call(t)},skipNulls:!1,strictNullHandling:!1},Xf=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ys={},Wf=function e(t,r,n,i,s,a,o,l,h,c,f,u,d,p,v,g){for(var y=t,b=g,_=0,m=!1;(b=b.get(ys))!==void 0&&!m;){var x=b.get(t);if(_+=1,typeof x<"u"){if(x===_)throw new RangeError("Cyclic object value");m=!0}typeof b.get(ys)>"u"&&(_=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=f(y):n==="comma"&&Te(y)&&(y=Pn.maybeMap(y,function(U){return U instanceof Date?f(U):U})),y===null){if(s)return o&&!p?o(r,Xt.encoder,v,"key",u):r;y=""}if(Xf(y)||Pn.isBuffer(y)){if(o){var S=p?r:o(r,Xt.encoder,v,"key",u);return[d(S)+"="+d(o(y,Xt.encoder,v,"value",u))]}return[d(r)+"="+d(String(y))]}var w=[];if(typeof y>"u")return w;var T;if(n==="comma"&&Te(y))p&&o&&(y=Pn.maybeMap(y,o)),T=[{value:y.length>0?y.join(",")||null:void 0}];else if(Te(l))T=l;else{var N=Object.keys(y);T=h?N.sort(h):N}for(var A=i&&Te(y)&&y.length===1?r+"[]":r,E=0;E<T.length;++E){var O=T[E],R=typeof O=="object"&&typeof O.value<"u"?O.value:y[O];if(!(a&&R===null)){var C=Te(y)?typeof n=="function"?n(A,O):A:A+(c?"."+O:"["+O+"]");g.set(t,_);var F=Co();F.set(ys,g),Po(w,e(R,C,n,i,s,a,n==="comma"&&p&&Te(y)?null:o,l,h,c,f,u,d,p,v,F))}}return w},Yf=function(t){if(!t)return Xt;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Xt.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 n=Kr.default;if(typeof t.format<"u"){if(!Hf.call(Kr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Kr.formatters[n],s=Xt.filter;return(typeof t.filter=="function"||Te(t.filter))&&(s=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Xt.addQueryPrefix,allowDots:typeof t.allowDots>"u"?Xt.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Xt.charsetSentinel,delimiter:typeof t.delimiter>"u"?Xt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Xt.encode,encoder:typeof t.encoder=="function"?t.encoder:Xt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Xt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Xt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Xt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Xt.strictNullHandling}},Kf=function(e,t){var r=e,n=Yf(t),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Te(n.filter)&&(s=n.filter,i=s);var a=[];if(typeof r!="object"||r===null)return"";var o;t&&t.arrayFormat in ko?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var l=ko[o];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=l==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=Co(),f=0;f<i.length;++f){var u=i[f];n.skipNulls&&r[u]===null||Po(a,Wf(r[u],u,l,h,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=a.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},gr=No,vs=Object.prototype.hasOwnProperty,Zf=Array.isArray,Gt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:gr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Qf=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Lo=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Jf="utf8=%26%2310003%3B",td="utf8=%E2%9C%93",ed=function(t,r){var n={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=i.split(r.delimiter,s),o=-1,l,h=r.charset;if(r.charsetSentinel)for(l=0;l<a.length;++l)a[l].indexOf("utf8=")===0&&(a[l]===td?h="utf-8":a[l]===Jf&&(h="iso-8859-1"),o=l,l=a.length);for(l=0;l<a.length;++l)if(l!==o){var c=a[l],f=c.indexOf("]="),u=f===-1?c.indexOf("="):f+1,d,p;u===-1?(d=r.decoder(c,Gt.decoder,h,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,u),Gt.decoder,h,"key"),p=gr.maybeMap(Lo(c.slice(u+1),r),function(v){return r.decoder(v,Gt.decoder,h,"value")})),p&&r.interpretNumericEntities&&h==="iso-8859-1"&&(p=Qf(p)),c.indexOf("[]=")>-1&&(p=Zf(p)?[p]:p),vs.call(n,d)?n[d]=gr.combine(n[d],p):n[d]=p}return n},rd=function(e,t,r,n){for(var i=n?t:Lo(t,r),s=e.length-1;s>=0;--s){var a,o=e[s];if(o==="[]"&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var l=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,h=parseInt(l,10);!r.parseArrays&&l===""?a={0:i}:!isNaN(h)&&o!==l&&String(h)===l&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[],a[h]=i):l!=="__proto__"&&(a[l]=i)}i=a}return i},nd=function(t,r,n,i){if(t){var s=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=n.depth>0&&a.exec(s),h=l?s.slice(0,l.index):s,c=[];if(h){if(!n.plainObjects&&vs.call(Object.prototype,h)&&!n.allowPrototypes)return;c.push(h)}for(var f=0;n.depth>0&&(l=o.exec(s))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&vs.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),rd(c,r,n,i)}},id=function(t){if(!t)return Gt;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 r=typeof t.charset>"u"?Gt.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Gt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Gt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Gt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Gt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Gt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Gt.comma,decoder:typeof t.decoder=="function"?t.decoder:Gt.decoder,delimiter:typeof t.delimiter=="string"||gr.isRegExp(t.delimiter)?t.delimiter:Gt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Gt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Gt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Gt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Gt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Gt.strictNullHandling}},sd=function(e,t){var r=id(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?ed(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),a=0;a<s.length;++a){var o=s[a],l=nd(o,n[o],r,typeof e=="string");i=gr.merge(i,l,r)}return r.allowSparse===!0?i:gr.compact(i)},ad=Kf,od=sd,ld=ds,ud={formats:ld,parse:od,stringify:ad},hd=yc;function ie(){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 cd=/^([a-z0-9.+-]+:)/i,fd=/:[0-9]*$/,dd=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,pd=["<",">",'"',"`"," ","\r",`
13
+ `," "],yd=["{","}","|","\\","^","`"].concat(pd),ms=["'"].concat(yd),Fo=["%","/","?",";","#"].concat(ms),Bo=["/","?","#"],vd=255,Do=/^[+a-z0-9A-Z_-]{0,63}$/,md=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,gd={javascript:!0,"javascript:":!0},gs={javascript:!0,"javascript:":!0},br={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},bs=ud;function Mn(e,t,r){if(e&&typeof e=="object"&&e instanceof ie)return e;var n=new ie;return n.parse(e,t,r),n}ie.prototype.parse=function(e,t,r){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n<e.indexOf("#")?"?":"#",s=e.split(i),a=/\\/g;s[0]=s[0].replace(a,"/"),e=s.join(i);var o=e;if(o=o.trim(),!r&&e.split("#").length===1){var l=dd.exec(o);if(l)return this.path=o,this.href=o,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=bs.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=cd.exec(o);if(h){h=h[0];var c=h.toLowerCase();this.protocol=c,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@/]+@[^@/]+/)){var f=o.substr(0,2)==="//";f&&!(h&&gs[h])&&(o=o.substr(2),this.slashes=!0)}if(!gs[h]&&(f||h&&!br[h])){for(var u=-1,d=0;d<Bo.length;d++){var p=o.indexOf(Bo[d]);p!==-1&&(u===-1||p<u)&&(u=p)}var v,g;u===-1?g=o.lastIndexOf("@"):g=o.lastIndexOf("@",u),g!==-1&&(v=o.slice(0,g),o=o.slice(g+1),this.auth=decodeURIComponent(v)),u=-1;for(var d=0;d<Fo.length;d++){var p=o.indexOf(Fo[d]);p!==-1&&(u===-1||p<u)&&(u=p)}u===-1&&(u=o.length),this.host=o.slice(0,u),o=o.slice(u),this.parseHost(),this.hostname=this.hostname||"";var y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y)for(var b=this.hostname.split(/\./),d=0,_=b.length;d<_;d++){var m=b[d];if(m&&!m.match(Do)){for(var x="",S=0,w=m.length;S<w;S++)m.charCodeAt(S)>127?x+="x":x+=m[S];if(!x.match(Do)){var T=b.slice(0,d),N=b.slice(d+1),A=m.match(md);A&&(T.push(A[1]),N.unshift(A[2])),N.length&&(o="/"+N.join(".")+o),this.hostname=T.join(".");break}}}this.hostname.length>vd?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=hd.toASCII(this.hostname));var E=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+E,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!gd[c])for(var d=0,_=ms.length;d<_;d++){var R=ms[d];if(o.indexOf(R)!==-1){var C=encodeURIComponent(R);C===R&&(C=escape(R)),o=o.split(R).join(C)}}var F=o.indexOf("#");F!==-1&&(this.hash=o.substr(F),o=o.slice(0,F));var U=o.indexOf("?");if(U!==-1?(this.search=o.substr(U),this.query=o.substr(U+1),t&&(this.query=bs.parse(this.query)),o=o.slice(0,U)):t&&(this.search="",this.query={}),o&&(this.pathname=o),br[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var E=this.pathname||"",D=this.search||"";this.path=E+D}return this.href=this.format(),this};function bd(e){return typeof e=="string"&&(e=Mn(e)),e instanceof ie?e.format():ie.prototype.format.call(e)}ie.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=bs.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||br[t])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),t+i+r+a+n};function _d(e,t){return Mn(e,!1,!0).resolve(t)}ie.prototype.resolve=function(e){return this.resolveObject(Mn(e,!1,!0)).format()},ie.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new ie;t.parse(e,!1,!0),e=t}for(var r=new ie,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];l!=="protocol"&&(r[l]=e[l])}return br[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!br[e.protocol]){for(var h=Object.keys(e),c=0;c<h.length;c++){var f=h[c];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!gs[e.protocol]){for(var _=(e.pathname||"").split("/");_.length&&!(e.host=_.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),_[0]!==""&&_.unshift(""),_.length<2&&_.unshift(""),r.pathname=_.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var u=r.pathname||"",d=r.search||"";r.path=u+d}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",v=e.host||e.pathname&&e.pathname.charAt(0)==="/",g=v||p||r.host&&e.pathname,y=g,b=r.pathname&&r.pathname.split("/")||[],_=e.pathname&&e.pathname.split("/")||[],m=r.protocol&&!br[r.protocol];if(m&&(r.hostname="",r.port=null,r.host&&(b[0]===""?b[0]=r.host:b.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(_[0]===""?_[0]=e.host:_.unshift(e.host)),e.host=null),g=g&&(_[0]===""||b[0]==="")),v)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,b=_;else if(_.length)b||(b=[]),b.pop(),b=b.concat(_),r.search=e.search,r.query=e.query;else if(e.search!=null){if(m){r.host=b.shift(),r.hostname=r.host;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=b.slice(-1)[0],w=(r.host||e.host||b.length>1)&&(S==="."||S==="..")||S==="",T=0,N=b.length;N>=0;N--)S=b[N],S==="."?b.splice(N,1):S===".."?(b.splice(N,1),T++):T&&(b.splice(N,1),T--);if(!g&&!y)for(;T--;T)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),w&&b.join("/").substr(-1)!=="/"&&b.push("");var A=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(m){r.hostname=A?"":b.length?b.shift():"",r.host=r.hostname;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return g=g||r.host&&b.length,g&&!A&&b.unshift(""),b.length>0?r.pathname=b.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},ie.prototype.parseHost=function(){var e=this.host,t=fd.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var xd=Mn,wd=_d,Ed=bd;const Td={parse:xd,format:Ed,resolve:wd},Uo={};function xt(e,t,r=3){if(Uo[t])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
14
14
  Deprecated since v${e}`):(n=n.split(`
15
15
  `).splice(r).join(`
16
16
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
17
17
  Deprecated since v${e}`),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}
18
- Deprecated since v${e}`),console.warn(n))),lp[t]=!0}let tc;function q1(){return typeof tc>"u"&&(tc=function(){var r;const t={stencil:!0,failIfMajorPerformanceCaveat:Pt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Pt.ADAPTER.getWebGLRenderingContext())return!1;const n=Pt.ADAPTER.createCanvas();let i=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);const s=!!((r=i==null?void 0:i.getContextAttributes())!=null&&r.stencil);if(i){const a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,s}catch{return!1}}()),tc}var V1={grad:.9,turn:360,rad:360/(2*Math.PI)},xn=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Me=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},pr=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},up=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},cp=function(e){return{r:pr(e.r,0,255),g:pr(e.g,0,255),b:pr(e.b,0,255),a:pr(e.a)}},ec=function(e){return{r:Me(e.r),g:Me(e.g),b:Me(e.b),a:Me(e.a,3)}},W1=/^#([0-9a-f]{3,8})$/i,so=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},hp=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),o=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:i}},fp=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),o=n*(1-(t-s)*r),c=n*(1-(1-t+s)*r),h=s%6;return{r:255*[n,o,a,a,c,n][h],g:255*[c,n,n,o,a,a][h],b:255*[a,a,c,n,n,o][h],a:i}},dp=function(e){return{h:up(e.h),s:pr(e.s,0,100),l:pr(e.l,0,100),a:pr(e.a)}},pp=function(e){return{h:Me(e.h),s:Me(e.s),l:Me(e.l),a:Me(e.a,3)}},mp=function(e){return fp((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},zs=function(e){return{h:(t=hp(e)).h,s:(i=(200-(r=t.s))*(n=t.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,r,n,i},X1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Y1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,K1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Z1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rc={string:[[function(e){var t=W1.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Me(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Me(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=K1.exec(e)||Z1.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:cp({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=X1.exec(e)||Y1.exec(e);if(!t)return null;var r,n,i=dp({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(V1[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return mp(i)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=i===void 0?1:i;return xn(t)&&xn(r)&&xn(n)?cp({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,i=e.a,s=i===void 0?1:i;if(!xn(t)||!xn(r)||!xn(n))return null;var a=dp({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return mp(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,s=i===void 0?1:i;if(!xn(t)||!xn(r)||!xn(n))return null;var a=function(o){return{h:up(o.h),s:pr(o.s,0,100),v:pr(o.v,0,100),a:pr(o.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return fp(a)},"hsv"]]},gp=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},Q1=function(e){return typeof e=="string"?gp(e.trim(),rc.string):typeof e=="object"&&e!==null?gp(e,rc.object):[null,void 0]},nc=function(e,t){var r=zs(e);return{h:r.h,s:pr(r.s+100*t,0,100),l:r.l,a:r.a}},ic=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},yp=function(e,t){var r=zs(e);return{h:r.h,s:r.s,l:pr(r.l+100*t,0,100),a:r.a}},sc=function(){function e(t){this.parsed=Q1(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Me(ic(this.rgba),2)},e.prototype.isDark=function(){return ic(this.rgba)<.5},e.prototype.isLight=function(){return ic(this.rgba)>=.5},e.prototype.toHex=function(){return t=ec(this.rgba),r=t.r,n=t.g,i=t.b,a=(s=t.a)<1?so(Me(255*s)):"","#"+so(r)+so(n)+so(i)+a;var t,r,n,i,s,a},e.prototype.toRgb=function(){return ec(this.rgba)},e.prototype.toRgbString=function(){return t=ec(this.rgba),r=t.r,n=t.g,i=t.b,(s=t.a)<1?"rgba("+r+", "+n+", "+i+", "+s+")":"rgb("+r+", "+n+", "+i+")";var t,r,n,i,s},e.prototype.toHsl=function(){return pp(zs(this.rgba))},e.prototype.toHslString=function(){return t=pp(zs(this.rgba)),r=t.h,n=t.s,i=t.l,(s=t.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+s+")":"hsl("+r+", "+n+"%, "+i+"%)";var t,r,n,i,s},e.prototype.toHsv=function(){return t=hp(this.rgba),{h:Me(t.h),s:Me(t.s),v:Me(t.v),a:Me(t.a,3)};var t},e.prototype.invert=function(){return Zr({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Zr(nc(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Zr(nc(this.rgba,-t))},e.prototype.grayscale=function(){return Zr(nc(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Zr(yp(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Zr(yp(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Zr({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):Me(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=zs(this.rgba);return typeof t=="number"?Zr({h:t,s:r.s,l:r.l,a:r.a}):Me(r.h)},e.prototype.isEqual=function(t){return this.toHex()===Zr(t).toHex()},e}(),Zr=function(e){return e instanceof sc?e:new sc(e)},vp=[],J1=function(e){e.forEach(function(t){vp.indexOf(t)<0&&(t(sc,rc),vp.push(t))})};function tx(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var s={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,c,h=n[this.toHex()];if(h)return h;if(a!=null&&a.closest){var d=this.toRgb(),p=1/0,f="black";if(!s.length)for(var m in r)s[m]=new e(r[m]).toRgb();for(var g in r){var v=(o=d,c=s[g],Math.pow(o.r-c.r,2)+Math.pow(o.g-c.g,2)+Math.pow(o.b-c.b,2));v<p&&(p=v,f=g)}return f}},t.string.push([function(a){var o=a.toLowerCase(),c=o==="transparent"?"#0000":r[o];return c?new e(c).toRgb():null},"name"])}J1([tx]);const qi=class{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof qi)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}isSourceEqual(e,t){const r=typeof e;if(r!==typeof t)return!1;if(r==="number"||r==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((i,s)=>i===t[s]);if(e!==null&&t!==null){const i=Object.keys(e),s=Object.keys(t);return i.length!==s.length?!1:i.every(a=>e[a]===t[a])}return e===t}toRgba(){const[e,t,r,n]=this._components;return{r:e,g:t,b:r,a:n}}toRgb(){const[e,t,r]=this._components;return{r:e,g:t,b:r}}toRgbaString(){const[e,t,r]=this.toUint8RgbArray();return`rgba(${e},${t},${r},${this.alpha})`}toUint8RgbArray(e){const[t,r,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(r*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,r,n]=this._components;return e[0]=t,e[1]=r,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,r,n,i]=qi.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=r,this._components[2]*=n,this._components[3]*=i,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e){if(e===1)return(e*255<<24)+this._int;if(e===0)return 0;let t=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return t=t*e+.5|0,r=r*e+.5|0,n=n*e+.5|0,(e*255<<24)+(t<<16)+(r<<8)+n}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,r,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(r*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,r,n,i]=this._components;return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}normalize(e){let t;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const r=e;t=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4){e=this._clamp(e);const[r,n,i,s=1]=e;t=[r,n,i,s]}else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4){e=this._clamp(e,0,255);const[r,n,i,s=255]=e;t=[r/255,n/255,i/255,s/255]}else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const n=qi.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=Zr(e);if(r.isValid()){const{r:n,g:i,b:s,a}=r.rgba;t=[n/255,i/255,s/255,a]}}if(t)this._components.set(t),this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,r]=this._components;this._int=(e*255<<16)+(t*255<<8)+(r*255|0)}_clamp(e,t=0,r=1){return typeof e=="number"?Math.min(Math.max(e,t),r):(e.forEach((n,i)=>{e[i]=Math.min(Math.max(n,t),r)}),e)}};let ae=qi;ae.shared=new qi,ae.temp=new qi,ae.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function ex(){const e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[Lt.NORMAL_NPM]=Lt.NORMAL,e[Lt.ADD_NPM]=Lt.ADD,e[Lt.SCREEN_NPM]=Lt.SCREEN,t[Lt.NORMAL]=Lt.NORMAL_NPM,t[Lt.ADD]=Lt.ADD_NPM,t[Lt.SCREEN]=Lt.SCREEN_NPM;const r=[];return r.push(t),r.push(e),r}const _p=ex();function bp(e,t){return _p[t?1:0][e]}function rx(e,t=null){const r=e*6;if(t=t||new Uint16Array(r),t.length!==r)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${r}`);for(let n=0,i=0;n<r;n+=6,i+=4)t[n+0]=i+0,t[n+1]=i+1,t[n+2]=i+2,t[n+3]=i+0,t[n+4]=i+2,t[n+5]=i+3;return t}function xp(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return"Uint16Array"}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return"Uint8Array";return null}function ao(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function wp(e){return!(e&e-1)&&!!e}function Sp(e){let t=(e>65535?1:0)<<4;e>>>=t;let r=(e>255?1:0)<<3;return e>>>=r,t|=r,r=(e>15?1:0)<<2,e>>>=r,t|=r,r=(e>3?1:0)<<1,e>>>=r,t|=r,t|e>>1}function Hs(e,t,r){const n=e.length;let i;if(t>=n||r===0)return;r=t+r>n?n-t:r;const s=n-r;for(i=t;i<s;++i)e[i]=e[i+r];e.length=s}function Vi(e){return e===0?0:e<0?-1:1}let nx=0;function Gs(){return++nx}const Tp=class{constructor(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};let ac=Tp;ac.EMPTY=new Tp(0,0,0,0);const Ep={},Qr=Object.create(null),Dn=Object.create(null);function Ap(e,t,r){for(let n=0,i=4*r*t;n<t;++n,i+=4)if(e[i+3]!==0)return!1;return!0}function Cp(e,t,r,n,i){const s=4*t;for(let a=n,o=n*s+4*r;a<=i;++a,o+=s)if(e[o+3]!==0)return!1;return!0}function ix(e){const{width:t,height:r}=e,n=e.getContext("2d",{willReadFrequently:!0});if(n===null)throw new TypeError("Failed to get canvas 2D context");const s=n.getImageData(0,0,t,r).data;let a=0,o=0,c=t-1,h=r-1;for(;o<r&&Ap(s,t,o);)++o;if(o===r)return ac.EMPTY;for(;Ap(s,t,h);)--h;for(;Cp(s,t,a,o,h);)++a;for(;Cp(s,t,c,o,h);)--c;return++c,++h,new ac(a,o,c,h)}function sx(e){const t=ix(e),{width:r,height:n}=t;let i=null;if(!t.isEmpty()){const s=e.getContext("2d");if(s===null)throw new TypeError("Failed to get canvas 2D context");i=s.getImageData(t.left,t.top,r,n)}return{width:r,height:n,data:i}}let oo;function ax(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,oo||(oo=document.createElement("a")),oo.href=e;const r=$1.parse(oo.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function qs(e,t=1){var n;const r=(n=Pt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var Et=(e=>(e.Renderer="renderer",e.Application="application",e.RendererSystem="renderer-webgl-system",e.RendererPlugin="renderer-webgl-plugin",e.CanvasRendererSystem="renderer-canvas-system",e.CanvasRendererPlugin="renderer-canvas-plugin",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e))(Et||{});const oc=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},Op=(e,t)=>oc(e).priority??t,Bt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(oc).forEach(t=>{t.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,t)})}),this},add(...e){return e.map(oc).forEach(t=>{t.type.forEach(r=>{const n=this._addHandlers,i=this._queue;n[r]?n[r](t):(i[r]=i[r]||[],i[r].push(t))})}),this},handle(e,t,r){const n=this._addHandlers,i=this._removeHandlers;if(n[e]||i[e])throw new Error(`Extension type ${e} already has a handler`);n[e]=t,i[e]=r;const s=this._queue;return s[e]&&(s[e].forEach(a=>t(a)),delete s[e]),this},handleByMap(e,t){return this.handle(e,r=>{t[r.name]=r.ref},r=>{delete t[r.name]})},handleByList(e,t,r=-1){return this.handle(e,n=>{t.includes(n.ref)||(t.push(n.ref),t.sort((i,s)=>Op(s,r)-Op(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class ox{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const lx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
- `);function ux(e){let t="";for(let r=0;r<e;++r)r>0&&(t+=`
20
- else `),r<e-1&&(t+=`if(test == ${r}.0){}`);return t}function cx(e,t){if(e===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=t.createShader(t.FRAGMENT_SHADER);for(;;){const n=lx.replace(/%forloop%/gi,ux(e));if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))e=e/2|0;else break}return e}const lc=0,uc=1,cc=2,hc=3,fc=4,dc=5;let ci=class i_{constructor(){this.data=0,this.blendMode=Lt.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<lc)}set blend(t){!!(this.data&1<<lc)!==t&&(this.data^=1<<lc)}get offsets(){return!!(this.data&1<<uc)}set offsets(t){!!(this.data&1<<uc)!==t&&(this.data^=1<<uc)}get culling(){return!!(this.data&1<<cc)}set culling(t){!!(this.data&1<<cc)!==t&&(this.data^=1<<cc)}get depthTest(){return!!(this.data&1<<hc)}set depthTest(t){!!(this.data&1<<hc)!==t&&(this.data^=1<<hc)}get depthMask(){return!!(this.data&1<<dc)}set depthMask(t){!!(this.data&1<<dc)!==t&&(this.data^=1<<dc)}get clockwiseFrontFace(){return!!(this.data&1<<fc)}set clockwiseFrontFace(t){!!(this.data&1<<fc)!==t&&(this.data^=1<<fc)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==Lt.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new i_;return t.depthTest=!1,t.blend=!0,t}};const pc=[];function Pp(e,t){if(!e)return null;let r="";if(typeof e=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);n&&(r=n[1].toLowerCase())}for(let n=pc.length-1;n>=0;--n){const i=pc[n];if(i.test&&i.test(e,r))return new i(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ir{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,r,n,i,s,a,o,c){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:d}=this;this._aliasCount++;for(let p=0,f=d.length;p<f;p++)d[p][h](t,r,n,i,s,a,o,c);return d===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const r=this.items.indexOf(t);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Ir.prototype,{dispatch:{value:Ir.prototype.emit},run:{value:Ir.prototype.emit}});class Vs{constructor(t=0,r=0){this._width=t,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new Ir("setRealSize"),this.onUpdate=new Ir("update"),this.onError=new Ir("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,r){(t!==this._width||r!==this._height)&&(this._width=t,this._height=r,this.onResize.emit(t,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,r){return!1}}class mc extends Vs{constructor(t,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=t}upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===yn.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const hx={scaleMode:mn.NEAREST,format:wt.RGBA,alphaMode:yn.NPM},Wi=class extends _n{constructor(e=null,t=null){super(),t=Object.assign({},Wi.defaultOptions,t);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:s,width:a,height:o,wrapMode:c,format:h,type:d,target:p,resolution:f,resourceOptions:m}=t;e&&!(e instanceof Vs)&&(e=Pp(e,m),e.internal=!0),this.resolution=f||Pt.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=i,this._wrapMode=c,this._scaleMode=s,this.format=h,this.type=d,this.target=p,this.alphaMode=r,this.uid=Gs(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let r;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this}setSize(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)}setRealSize(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=wp(this.realWidth)&&wp(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Dn[this.cacheId],delete Qr[this.cacheId],this.cacheId=null),this.dispose(),Wi.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,r=Pt.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let i=null;if(n)i=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${Gs()}`}i=e._pixiId}let s=Dn[i];if(n&&r&&!s)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return s||(s=new Wi(e,t),s.cacheId=i,Wi.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new mc(e,{width:t,height:r}),s=e instanceof Float32Array?Ut.FLOAT:Ut.UNSIGNED_BYTE;return new Wi(i,Object.assign({},hx,n||{width:t,height:r,type:s}))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Dn[t]&&Dn[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Dn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Dn[e];if(t){const r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete Dn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete Dn[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};let Ht=Wi;Ht.defaultOptions={mipmap:Mn.POW2,anisotropicLevel:0,scaleMode:mn.LINEAR,wrapMode:gn.CLAMP,alphaMode:yn.UNPACK,target:Ni.TEXTURE_2D,format:wt.RGBA,type:Ut.UNSIGNED_BYTE},Ht._globalBatch=0;class gc{constructor(){this.texArray=null,this.blend=0,this.type=Cr.TRIANGLES,this.start=0,this.size=0,this.data=null}}let fx=0,Oe=class s_{constructor(t,r=!0,n=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=fx++,this.disposeRunner=new Ir("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?Xr.ELEMENT_ARRAY_BUFFER:Xr.ARRAY_BUFFER}get index(){return this.type===Xr.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new s_(t)}};class lo{constructor(t,r=0,n=!1,i=Ut.FLOAT,s,a,o,c=1){this.buffer=t,this.size=r,this.normalized=n,this.type=i,this.stride=s,this.start=a,this.instance=o,this.divisor=c}destroy(){this.buffer=null}static from(t,r,n,i,s){return new lo(t,r,n,i,s)}}const dx={Float32Array,Uint32Array,Int32Array,Uint8Array};function px(e,t){let r=0,n=0;const i={};for(let c=0;c<e.length;c++)n+=t[c],r+=e[c].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let c=0;c<e.length;c++){const h=t[c],d=e[c],p=xp(d);i[p]||(i[p]=new dx[p](s)),a=i[p];for(let f=0;f<d.length;f++){const m=(f/h|0)*n+o,g=f%h;a[m+g]=d[f]}o+=h}return new Float32Array(s)}const Ip={5126:4,5123:2,5121:1};let mx=0;const gx={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Un{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=mx++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Ir("disposeGeometry"),this.refCount=0}addAttribute(t,r,n=0,i=!1,s,a,o,c=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Oe||(r instanceof Array&&(r=new Float32Array(r)),r=new Oe(r));const h=t.split("|");if(h.length>1){for(let p=0;p<h.length;p++)this.addAttribute(h[p],r,n,i,s);return this}let d=this.buffers.indexOf(r);return d===-1&&(this.buffers.push(r),d=this.buffers.length-1),this.attributes[t]=new lo(d,n,i,s,a,o,c),this.instanced=this.instanced||c,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Oe||(t instanceof Array&&(t=new Uint16Array(t)),t=new Oe(t)),t.type=Xr.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const t=[],r=[],n=new Oe;let i;for(i in this.attributes){const s=this.attributes[i],a=this.buffers[s.buffer];t.push(a.data),r.push(s.size*Ip[s.type]/4),s.buffer=0}for(n.data=px(t,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const r=this.attributes[t];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new Un;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Oe(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new lo(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=Xr.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new Un,n=[],i=[],s=[];let a;for(let o=0;o<t.length;o++){a=t[o];for(let c=0;c<a.buffers.length;c++)i[c]=i[c]||0,i[c]+=a.buffers[c].data.length,s[c]=0}for(let o=0;o<a.buffers.length;o++)n[o]=new gx[xp(a.buffers[o].data)](i[o]),r.buffers[o]=new Oe(n[o]);for(let o=0;o<t.length;o++){a=t[o];for(let c=0;c<a.buffers.length;c++)n[c].set(a.buffers[c].data,s[c]),s[c]+=a.buffers[c].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=Xr.ELEMENT_ARRAY_BUFFER;let o=0,c=0,h=0,d=0;for(let p=0;p<a.buffers.length;p++)if(a.buffers[p]!==a.indexBuffer){d=p;break}for(const p in a.attributes){const f=a.attributes[p];(f.buffer|0)===d&&(c+=f.size*Ip[f.type]/4)}for(let p=0;p<t.length;p++){const f=t[p].indexBuffer.data;for(let m=0;m<f.length;m++)r.indexBuffer.data[m+h]+=o;o+=t[p].buffers[d].data.length/c,h+=f.length}}return r}}class kp extends Un{constructor(t=!1){super(),this._buffer=new Oe(null,t,!1),this._indexBuffer=new Oe(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ut.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ut.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ut.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ut.FLOAT).addIndex(this._indexBuffer)}}const uo=Math.PI*2,yx=180/Math.PI,vx=Math.PI/180;var Ue=(e=>(e[e.POLY=0]="POLY",e[e.RECT=1]="RECT",e[e.CIRC=2]="CIRC",e[e.ELIP=3]="ELIP",e[e.RREC=4]="RREC",e))(Ue||{});class xt{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new xt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,r=t){return this.x=t,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const co=[new xt,new xt,new xt,new xt];class Vt{constructor(t=0,r=0,n=0,i=0){this.x=Number(t),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=Ue.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Vt(0,0,0,0)}clone(){return new Vt(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(t,r){if(!r){const P=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=P)return!1;const I=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>I}const n=this.left,i=this.right,s=this.top,a=this.bottom;if(i<=n||a<=s)return!1;const o=co[0].set(t.left,t.top),c=co[1].set(t.left,t.bottom),h=co[2].set(t.right,t.top),d=co[3].set(t.right,t.bottom);if(h.x<=o.x||c.y<=o.y)return!1;const p=Math.sign(r.a*r.d-r.b*r.c);if(p===0||(r.apply(o,o),r.apply(c,c),r.apply(h,h),r.apply(d,d),Math.max(o.x,c.x,h.x,d.x)<=n||Math.min(o.x,c.x,h.x,d.x)>=i||Math.max(o.y,c.y,h.y,d.y)<=s||Math.min(o.y,c.y,h.y,d.y)>=a))return!1;const f=p*(c.y-o.y),m=p*(o.x-c.x),g=f*n+m*s,v=f*i+m*s,b=f*n+m*a,_=f*i+m*a;if(Math.max(g,v,b,_)<=f*o.x+m*o.y||Math.min(g,v,b,_)>=f*d.x+m*d.y)return!1;const w=p*(o.y-h.y),S=p*(h.x-o.x),x=w*n+S*s,A=w*i+S*s,N=w*n+S*a,O=w*i+S*a;return!(Math.max(x,A,N,O)<=w*o.x+S*o.y||Math.min(x,A,N,O)>=w*d.x+S*d.y)}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class yc{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=Ue.CIRC}clone(){return new yc(this.x,this.y,this.radius)}contains(t,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-t,s=this.y-r;return i*=i,s*=s,i+s<=n}getBounds(){return new Vt(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let _x=class a_{constructor(t=0,r=0,n=0,i=0){this.x=t,this.y=r,this.width=n,this.height=i,this.type=Ue.ELIP}clone(){return new a_(this.x,this.y,this.width,this.height)}contains(t,r){if(this.width<=0||this.height<=0)return!1;let n=(t-this.x)/this.width,i=(r-this.y)/this.height;return n*=n,i*=i,n+i<=1}getBounds(){return new Vt(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class Xi{constructor(...t){let r=Array.isArray(t[0])?t[0]:t;if(typeof r[0]!="number"){const n=[];for(let i=0,s=r.length;i<s;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=Ue.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),r=new Xi(t);return r.closeStroke=this.closeStroke,r}contains(t,r){let n=!1;const i=this.points.length/2;for(let s=0,a=i-1;s<i;a=s++){const o=this.points[s*2],c=this.points[s*2+1],h=this.points[a*2],d=this.points[a*2+1];c>r!=d>r&&t<(h-o)*((r-c)/(d-c))+o&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,r)=>`${t}, ${r}`,"")}]`}}class vc{constructor(t=0,r=0,n=0,i=0,s=20){this.x=t,this.y=r,this.width=n,this.height=i,this.radius=s,this.type=Ue.RREC}clone(){return new vc(this.x,this.y,this.width,this.height,this.radius)}contains(t,r){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||t>=this.x+n&&t<=this.x+this.width-n)return!0;let i=t-(this.x+n),s=r-(this.y+n);const a=n*n;if(i*i+s*s<=a||(i=t-(this.x+this.width-n),i*i+s*s<=a)||(s=r-(this.y+this.height-n),i*i+s*s<=a)||(i=t-(this.x+n),i*i+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let ee=class yu{constructor(t=1,r=0,n=0,i=1,s=0,a=0){this.array=null,this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,r,n,i,s,a){return this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a,this}toArray(t,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return t?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(t,r){r=r||new xt;const n=t.x,i=t.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(t,r){r=r||new xt;const n=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return r.x=this.d*n*i+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*s+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(t,r){return this.tx+=t,this.ty+=r,this}scale(t,r){return this.a*=t,this.d*=r,this.c*=t,this.b*=r,this.tx*=t,this.ty*=r,this}rotate(t){const r=Math.cos(t),n=Math.sin(t),i=this.a,s=this.c,a=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=s*r-this.d*n,this.d=s*n+this.d*r,this.tx=a*r-this.ty*n,this.ty=a*n+this.ty*r,this}append(t){const r=this.a,n=this.b,i=this.c,s=this.d;return this.a=t.a*r+t.b*i,this.b=t.a*n+t.b*s,this.c=t.c*r+t.d*i,this.d=t.c*n+t.d*s,this.tx=t.tx*r+t.ty*i+this.tx,this.ty=t.tx*n+t.ty*s+this.ty,this}setTransform(t,r,n,i,s,a,o,c,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-c)*a,this.d=Math.cos(o-c)*a,this.tx=t-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(t){const r=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const n=this.a,i=this.c;this.a=n*t.a+this.b*t.c,this.b=n*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=r*t.a+this.ty*t.c+t.tx,this.ty=r*t.b+this.ty*t.d+t.ty,this}decompose(t){const r=this.a,n=this.b,i=this.c,s=this.d,a=t.pivot,o=-Math.atan2(-i,s),c=Math.atan2(n,r),h=Math.abs(o+c);return h<1e-5||Math.abs(uo-h)<1e-5?(t.rotation=c,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=c),t.scale.x=Math.sqrt(r*r+n*n),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(a.x*r+a.y*i),t.position.y=this.ty+(a.x*n+a.y*s),t}invert(){const t=this.a,r=this.b,n=this.c,i=this.d,s=this.tx,a=t*i-r*n;return this.a=i/a,this.b=-r/a,this.c=-n/a,this.d=t/a,this.tx=(n*this.ty-i*s)/a,this.ty=-(t*this.ty-r*s)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new yu;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new yu}static get TEMP_MATRIX(){return new yu}};const hi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],fi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],di=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],pi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_c=[],Rp=[],ho=Math.sign;function bx(){for(let e=0;e<16;e++){const t=[];_c.push(t);for(let r=0;r<16;r++){const n=ho(hi[e]*hi[r]+di[e]*fi[r]),i=ho(fi[e]*hi[r]+pi[e]*fi[r]),s=ho(hi[e]*di[r]+di[e]*pi[r]),a=ho(fi[e]*di[r]+pi[e]*pi[r]);for(let o=0;o<16;o++)if(hi[o]===n&&fi[o]===i&&di[o]===s&&pi[o]===a){t.push(o);break}}}for(let e=0;e<16;e++){const t=new ee;t.set(hi[e],fi[e],di[e],pi[e],0,0),Rp.push(t)}}bx();const pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>hi[e],uY:e=>fi[e],vX:e=>di[e],vY:e=>pi[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>_c[e][t],sub:(e,t)=>_c[e][pe.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?pe.S:pe.N:Math.abs(t)*2<=Math.abs(e)?e>0?pe.E:pe.W:t>0?e>0?pe.SE:pe.SW:e>0?pe.NE:pe.NW,matrixAppendRotationInv:(e,t,r=0,n=0)=>{const i=Rp[pe.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class Jr{constructor(t,r,n=0,i=0){this._x=n,this._y=i,this.cb=t,this.scope=r}clone(t=this.cb,r=this.scope){return new Jr(t,r,this._x,this._y)}set(t=0,r=t){return(this._x!==t||this._y!==r)&&(this._x=t,this._y=r,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const Np=class{constructor(){this.worldTransform=new ee,this.localTransform=new ee,this.position=new Jr(this.onChange,this,0,0),this.scale=new Jr(this.onChange,this,1,1),this.pivot=new Jr(this.onChange,this,0,0),this.skew=new Jr(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){const r=e.worldTransform,n=this.worldTransform;n.a=t.a*r.a+t.b*r.c,n.b=t.a*r.b+t.b*r.d,n.c=t.c*r.a+t.d*r.c,n.d=t.c*r.b+t.d*r.d,n.tx=t.tx*r.a+t.ty*r.c+r.tx,n.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};let Ws=Np;Ws.IDENTITY=new Np;var xx=`varying vec2 vTextureCoord;
18
+ Deprecated since v${e}`),console.warn(n))),Uo[t]=!0}let _s;function Ad(){return typeof _s>"u"&&(_s=function(){var r;const t={stencil:!0,failIfMajorPerformanceCaveat:vt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!vt.ADAPTER.getWebGLRenderingContext())return!1;const n=vt.ADAPTER.createCanvas();let i=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);const s=!!((r=i==null?void 0:i.getContextAttributes())!=null&&r.stencil);if(i){const a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,s}catch{return!1}}()),_s}var Sd={grad:.9,turn:360,rad:360/(2*Math.PI)},Ae=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},$t=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},te=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},jo=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Go=function(e){return{r:te(e.r,0,255),g:te(e.g,0,255),b:te(e.b,0,255),a:te(e.a)}},xs=function(e){return{r:$t(e.r),g:$t(e.g),b:$t(e.b),a:$t(e.a,3)}},Od=/^#([0-9a-f]{3,8})$/i,Ln=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},$o=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),o=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:i}},qo=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),o=n*(1-(t-s)*r),l=n*(1-(1-t+s)*r),h=s%6;return{r:255*[n,o,a,a,l,n][h],g:255*[l,n,n,o,a,a][h],b:255*[a,a,l,n,n,o][h],a:i}},Ho=function(e){return{h:jo(e.h),s:te(e.s,0,100),l:te(e.l,0,100),a:te(e.a)}},zo=function(e){return{h:$t(e.h),s:$t(e.s),l:$t(e.l),a:$t(e.a,3)}},Vo=function(e){return qo((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},Zr=function(e){return{h:(t=$o(e)).h,s:(i=(200-(r=t.s))*(n=t.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,r,n,i},Rd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Id=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ws={string:[[function(e){var t=Od.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?$t(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?$t(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Nd.exec(e)||Cd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Go({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Rd.exec(e)||Id.exec(e);if(!t)return null;var r,n,i=Ho({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Sd[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Vo(i)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=i===void 0?1:i;return Ae(t)&&Ae(r)&&Ae(n)?Go({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,i=e.a,s=i===void 0?1:i;if(!Ae(t)||!Ae(r)||!Ae(n))return null;var a=Ho({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Vo(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,s=i===void 0?1:i;if(!Ae(t)||!Ae(r)||!Ae(n))return null;var a=function(o){return{h:jo(o.h),s:te(o.s,0,100),v:te(o.v,0,100),a:te(o.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return qo(a)},"hsv"]]},Xo=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},kd=function(e){return typeof e=="string"?Xo(e.trim(),ws.string):typeof e=="object"&&e!==null?Xo(e,ws.object):[null,void 0]},Es=function(e,t){var r=Zr(e);return{h:r.h,s:te(r.s+100*t,0,100),l:r.l,a:r.a}},Ts=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Wo=function(e,t){var r=Zr(e);return{h:r.h,s:r.s,l:te(r.l+100*t,0,100),a:r.a}},As=function(){function e(t){this.parsed=kd(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return $t(Ts(this.rgba),2)},e.prototype.isDark=function(){return Ts(this.rgba)<.5},e.prototype.isLight=function(){return Ts(this.rgba)>=.5},e.prototype.toHex=function(){return t=xs(this.rgba),r=t.r,n=t.g,i=t.b,a=(s=t.a)<1?Ln($t(255*s)):"","#"+Ln(r)+Ln(n)+Ln(i)+a;var t,r,n,i,s,a},e.prototype.toRgb=function(){return xs(this.rgba)},e.prototype.toRgbString=function(){return t=xs(this.rgba),r=t.r,n=t.g,i=t.b,(s=t.a)<1?"rgba("+r+", "+n+", "+i+", "+s+")":"rgb("+r+", "+n+", "+i+")";var t,r,n,i,s},e.prototype.toHsl=function(){return zo(Zr(this.rgba))},e.prototype.toHslString=function(){return t=zo(Zr(this.rgba)),r=t.h,n=t.s,i=t.l,(s=t.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+s+")":"hsl("+r+", "+n+"%, "+i+"%)";var t,r,n,i,s},e.prototype.toHsv=function(){return t=$o(this.rgba),{h:$t(t.h),s:$t(t.s),v:$t(t.v),a:$t(t.a,3)};var t},e.prototype.invert=function(){return be({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),be(Es(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),be(Es(this.rgba,-t))},e.prototype.grayscale=function(){return be(Es(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),be(Wo(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),be(Wo(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?be({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):$t(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Zr(this.rgba);return typeof t=="number"?be({h:t,s:r.s,l:r.l,a:r.a}):$t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===be(t).toHex()},e}(),be=function(e){return e instanceof As?e:new As(e)},Yo=[],Pd=function(e){e.forEach(function(t){Yo.indexOf(t)<0&&(t(As,ws),Yo.push(t))})};function Md(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var s={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,l,h=n[this.toHex()];if(h)return h;if(a!=null&&a.closest){var c=this.toRgb(),f=1/0,u="black";if(!s.length)for(var d in r)s[d]=new e(r[d]).toRgb();for(var p in r){var v=(o=c,l=s[p],Math.pow(o.r-l.r,2)+Math.pow(o.g-l.g,2)+Math.pow(o.b-l.b,2));v<f&&(f=v,u=p)}return u}},t.string.push([function(a){var o=a.toLowerCase(),l=o==="transparent"?"#0000":r[o];return l?new e(l).toRgb():null},"name"])}Pd([Md]);const _r=class{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof _r)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}isSourceEqual(e,t){const r=typeof e;if(r!==typeof t)return!1;if(r==="number"||r==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((i,s)=>i===t[s]);if(e!==null&&t!==null){const i=Object.keys(e),s=Object.keys(t);return i.length!==s.length?!1:i.every(a=>e[a]===t[a])}return e===t}toRgba(){const[e,t,r,n]=this._components;return{r:e,g:t,b:r,a:n}}toRgb(){const[e,t,r]=this._components;return{r:e,g:t,b:r}}toRgbaString(){const[e,t,r]=this.toUint8RgbArray();return`rgba(${e},${t},${r},${this.alpha})`}toUint8RgbArray(e){const[t,r,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(r*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,r,n]=this._components;return e[0]=t,e[1]=r,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,r,n,i]=_r.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=r,this._components[2]*=n,this._components[3]*=i,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e){if(e===1)return(e*255<<24)+this._int;if(e===0)return 0;let t=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return t=t*e+.5|0,r=r*e+.5|0,n=n*e+.5|0,(e*255<<24)+(t<<16)+(r<<8)+n}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,r,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(r*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,r,n,i]=this._components;return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}normalize(e){let t;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const r=e;t=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4){e=this._clamp(e);const[r,n,i,s=1]=e;t=[r,n,i,s]}else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4){e=this._clamp(e,0,255);const[r,n,i,s=255]=e;t=[r/255,n/255,i/255,s/255]}else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const n=_r.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=be(e);if(r.isValid()){const{r:n,g:i,b:s,a}=r.rgba;t=[n/255,i/255,s/255,a]}}if(t)this._components.set(t),this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,r]=this._components;this._int=(e*255<<16)+(t*255<<8)+(r*255|0)}_clamp(e,t=0,r=1){return typeof e=="number"?Math.min(Math.max(e,t),r):(e.forEach((n,i)=>{e[i]=Math.min(Math.max(n,t),r)}),e)}};let Wt=_r;Wt.shared=new _r,Wt.temp=new _r,Wt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function Ld(){const e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[ut.NORMAL_NPM]=ut.NORMAL,e[ut.ADD_NPM]=ut.ADD,e[ut.SCREEN_NPM]=ut.SCREEN,t[ut.NORMAL]=ut.NORMAL_NPM,t[ut.ADD]=ut.ADD_NPM,t[ut.SCREEN]=ut.SCREEN_NPM;const r=[];return r.push(t),r.push(e),r}const Fd=Ld();function Ko(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return"Uint16Array"}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return"Uint8Array";return null}function Fn(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Zo(e){return!(e&e-1)&&!!e}function Qo(e){let t=(e>65535?1:0)<<4;e>>>=t;let r=(e>255?1:0)<<3;return e>>>=r,t|=r,r=(e>15?1:0)<<2,e>>>=r,t|=r,r=(e>3?1:0)<<1,e>>>=r,t|=r,t|e>>1}function Bn(e,t,r){const n=e.length;let i;if(t>=n||r===0)return;r=t+r>n?n-t:r;const s=n-r;for(i=t;i<s;++i)e[i]=e[i+r];e.length=s}let Bd=0;function Qr(){return++Bd}const Jo={},_e=Object.create(null),De=Object.create(null);let Dn;function Dd(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,Dn||(Dn=document.createElement("a")),Dn.href=e;const r=Td.parse(Dn.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function tl(e,t=1){var n;const r=(n=vt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var pt=(e=>(e.Renderer="renderer",e.Application="application",e.RendererSystem="renderer-webgl-system",e.RendererPlugin="renderer-webgl-plugin",e.CanvasRendererSystem="renderer-canvas-system",e.CanvasRendererPlugin="renderer-canvas-plugin",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e))(pt||{});const Ss=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},el=(e,t)=>Ss(e).priority??t,wt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(Ss).forEach(t=>{t.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,t)})}),this},add(...e){return e.map(Ss).forEach(t=>{t.type.forEach(r=>{const n=this._addHandlers,i=this._queue;n[r]?n[r](t):(i[r]=i[r]||[],i[r].push(t))})}),this},handle(e,t,r){const n=this._addHandlers,i=this._removeHandlers;if(n[e]||i[e])throw new Error(`Extension type ${e} already has a handler`);n[e]=t,i[e]=r;const s=this._queue;return s[e]&&(s[e].forEach(a=>t(a)),delete s[e]),this},handleByMap(e,t){return this.handle(e,r=>{t[r.name]=r.ref},r=>{delete t[r.name]})},handleByList(e,t,r=-1){return this.handle(e,n=>{t.includes(n.ref)||(t.push(n.ref),t.sort((i,s)=>el(s,r)-el(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class Ud{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const jd=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
+ `);function Gd(e){let t="";for(let r=0;r<e;++r)r>0&&(t+=`
20
+ else `),r<e-1&&(t+=`if(test == ${r}.0){}`);return t}function $d(e,t){if(e===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=t.createShader(t.FRAGMENT_SHADER);for(;;){const n=jd.replace(/%forloop%/gi,Gd(e));if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))e=e/2|0;else break}return e}const Os=0,Rs=1,Is=2,Ns=3,Cs=4,ks=5;let Un=class Dh{constructor(){this.data=0,this.blendMode=ut.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Os)}set blend(t){!!(this.data&1<<Os)!==t&&(this.data^=1<<Os)}get offsets(){return!!(this.data&1<<Rs)}set offsets(t){!!(this.data&1<<Rs)!==t&&(this.data^=1<<Rs)}get culling(){return!!(this.data&1<<Is)}set culling(t){!!(this.data&1<<Is)!==t&&(this.data^=1<<Is)}get depthTest(){return!!(this.data&1<<Ns)}set depthTest(t){!!(this.data&1<<Ns)!==t&&(this.data^=1<<Ns)}get depthMask(){return!!(this.data&1<<ks)}set depthMask(t){!!(this.data&1<<ks)!==t&&(this.data^=1<<ks)}get clockwiseFrontFace(){return!!(this.data&1<<Cs)}set clockwiseFrontFace(t){!!(this.data&1<<Cs)!==t&&(this.data^=1<<Cs)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==ut.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new Dh;return t.depthTest=!1,t.blend=!0,t}};const Ps=[];function rl(e,t){if(!e)return null;let r="";if(typeof e=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);n&&(r=n[1].toLowerCase())}for(let n=Ps.length-1;n>=0;--n){const i=Ps[n];if(i.test&&i.test(e,r))return new i(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class se{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,r,n,i,s,a,o,l){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:c}=this;this._aliasCount++;for(let f=0,u=c.length;f<u;f++)c[f][h](t,r,n,i,s,a,o,l);return c===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const r=this.items.indexOf(t);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(se.prototype,{dispatch:{value:se.prototype.emit},run:{value:se.prototype.emit}});class Jr{constructor(t=0,r=0){this._width=t,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new se("setRealSize"),this.onUpdate=new se("update"),this.onError=new se("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,r){(t!==this._width||r!==this._height)&&(this._width=t,this._height=r,this.onResize.emit(t,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,r){return!1}}class Ms extends Jr{constructor(t,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=t}upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Me.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const qd={scaleMode:we.NEAREST,format:rt.RGBA,alphaMode:Me.NPM},xr=class extends _n{constructor(e=null,t=null){super(),t=Object.assign({},xr.defaultOptions,t);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:s,width:a,height:o,wrapMode:l,format:h,type:c,target:f,resolution:u,resourceOptions:d}=t;e&&!(e instanceof Jr)&&(e=rl(e,d),e.internal=!0),this.resolution=u||vt.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=i,this._wrapMode=l,this._scaleMode=s,this.format=h,this.type=c,this.target=f,this.alphaMode=r,this.uid=Qr(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let r;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this}setSize(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)}setRealSize(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Zo(this.realWidth)&&Zo(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete De[this.cacheId],delete _e[this.cacheId],this.cacheId=null),this.dispose(),xr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,r=vt.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let i=null;if(n)i=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${Qr()}`}i=e._pixiId}let s=De[i];if(n&&r&&!s)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return s||(s=new xr(e,t),s.cacheId=i,xr.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new Ms(e,{width:t,height:r}),s=e instanceof Float32Array?mt.FLOAT:mt.UNSIGNED_BYTE;return new xr(i,Object.assign({},qd,n||{width:t,height:r,type:s}))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),De[t]&&De[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),De[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=De[e];if(t){const r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete De[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete De[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};let gt=xr;gt.defaultOptions={mipmap:qe.POW2,anisotropicLevel:0,scaleMode:we.LINEAR,wrapMode:$r.CLAMP,alphaMode:Me.UNPACK,target:lr.TEXTURE_2D,format:rt.RGBA,type:mt.UNSIGNED_BYTE},gt._globalBatch=0;class Ls{constructor(){this.texArray=null,this.blend=0,this.type=Pe.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Hd=0,Yt=class Uh{constructor(t,r=!0,n=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=Hd++,this.disposeRunner=new se("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?ve.ELEMENT_ARRAY_BUFFER:ve.ARRAY_BUFFER}get index(){return this.type===ve.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Uh(t)}};class jn{constructor(t,r=0,n=!1,i=mt.FLOAT,s,a,o,l=1){this.buffer=t,this.size=r,this.normalized=n,this.type=i,this.stride=s,this.start=a,this.instance=o,this.divisor=l}destroy(){this.buffer=null}static from(t,r,n,i,s){return new jn(t,r,n,i,s)}}const zd={Float32Array,Uint32Array,Int32Array,Uint8Array};function Vd(e,t){let r=0,n=0;const i={};for(let l=0;l<e.length;l++)n+=t[l],r+=e[l].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let l=0;l<e.length;l++){const h=t[l],c=e[l],f=Ko(c);i[f]||(i[f]=new zd[f](s)),a=i[f];for(let u=0;u<c.length;u++){const d=(u/h|0)*n+o,p=u%h;a[d+p]=c[u]}o+=h}return new Float32Array(s)}const nl={5126:4,5123:2,5121:1};let Xd=0;const Wd={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class wr{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=Xd++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new se("disposeGeometry"),this.refCount=0}addAttribute(t,r,n=0,i=!1,s,a,o,l=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Yt||(r instanceof Array&&(r=new Float32Array(r)),r=new Yt(r));const h=t.split("|");if(h.length>1){for(let f=0;f<h.length;f++)this.addAttribute(h[f],r,n,i,s);return this}let c=this.buffers.indexOf(r);return c===-1&&(this.buffers.push(r),c=this.buffers.length-1),this.attributes[t]=new jn(c,n,i,s,a,o,l),this.instanced=this.instanced||l,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Yt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Yt(t)),t.type=ve.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const t=[],r=[],n=new Yt;let i;for(i in this.attributes){const s=this.attributes[i],a=this.buffers[s.buffer];t.push(a.data),r.push(s.size*nl[s.type]/4),s.buffer=0}for(n.data=Vd(t,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const r=this.attributes[t];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new wr;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Yt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new jn(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=ve.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new wr,n=[],i=[],s=[];let a;for(let o=0;o<t.length;o++){a=t[o];for(let l=0;l<a.buffers.length;l++)i[l]=i[l]||0,i[l]+=a.buffers[l].data.length,s[l]=0}for(let o=0;o<a.buffers.length;o++)n[o]=new Wd[Ko(a.buffers[o].data)](i[o]),r.buffers[o]=new Yt(n[o]);for(let o=0;o<t.length;o++){a=t[o];for(let l=0;l<a.buffers.length;l++)n[l].set(a.buffers[l].data,s[l]),s[l]+=a.buffers[l].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=ve.ELEMENT_ARRAY_BUFFER;let o=0,l=0,h=0,c=0;for(let f=0;f<a.buffers.length;f++)if(a.buffers[f]!==a.indexBuffer){c=f;break}for(const f in a.attributes){const u=a.attributes[f];(u.buffer|0)===c&&(l+=u.size*nl[u.type]/4)}for(let f=0;f<t.length;f++){const u=t[f].indexBuffer.data;for(let d=0;d<u.length;d++)r.indexBuffer.data[d+h]+=o;o+=t[f].buffers[c].data.length/l,h+=u.length}}return r}}class il extends wr{constructor(t=!1){super(),this._buffer=new Yt(null,t,!1),this._indexBuffer=new Yt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,mt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,mt.FLOAT).addAttribute("aColor",this._buffer,4,!0,mt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,mt.FLOAT).addIndex(this._indexBuffer)}}const Gn=Math.PI*2,Yd=180/Math.PI,Kd=Math.PI/180;var qt=(e=>(e[e.POLY=0]="POLY",e[e.RECT=1]="RECT",e[e.CIRC=2]="CIRC",e[e.ELIP=3]="ELIP",e[e.RREC=4]="RREC",e))(qt||{});class nt{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new nt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,r=t){return this.x=t,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const $n=[new nt,new nt,new nt,new nt];class At{constructor(t=0,r=0,n=0,i=0){this.x=Number(t),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=qt.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new At(0,0,0,0)}clone(){return new At(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(t,r){if(!r){const T=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=T)return!1;const A=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>A}const n=this.left,i=this.right,s=this.top,a=this.bottom;if(i<=n||a<=s)return!1;const o=$n[0].set(t.left,t.top),l=$n[1].set(t.left,t.bottom),h=$n[2].set(t.right,t.top),c=$n[3].set(t.right,t.bottom);if(h.x<=o.x||l.y<=o.y)return!1;const f=Math.sign(r.a*r.d-r.b*r.c);if(f===0||(r.apply(o,o),r.apply(l,l),r.apply(h,h),r.apply(c,c),Math.max(o.x,l.x,h.x,c.x)<=n||Math.min(o.x,l.x,h.x,c.x)>=i||Math.max(o.y,l.y,h.y,c.y)<=s||Math.min(o.y,l.y,h.y,c.y)>=a))return!1;const u=f*(l.y-o.y),d=f*(o.x-l.x),p=u*n+d*s,v=u*i+d*s,g=u*n+d*a,y=u*i+d*a;if(Math.max(p,v,g,y)<=u*o.x+d*o.y||Math.min(p,v,g,y)>=u*c.x+d*c.y)return!1;const b=f*(o.y-h.y),_=f*(h.x-o.x),m=b*n+_*s,x=b*i+_*s,S=b*n+_*a,w=b*i+_*a;return!(Math.max(m,x,S,w)<=b*o.x+_*o.y||Math.min(m,x,S,w)>=b*c.x+_*c.y)}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Fs{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=qt.CIRC}clone(){return new Fs(this.x,this.y,this.radius)}contains(t,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-t,s=this.y-r;return i*=i,s*=s,i+s<=n}getBounds(){return new At(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let Zd=class jh{constructor(t=0,r=0,n=0,i=0){this.x=t,this.y=r,this.width=n,this.height=i,this.type=qt.ELIP}clone(){return new jh(this.x,this.y,this.width,this.height)}contains(t,r){if(this.width<=0||this.height<=0)return!1;let n=(t-this.x)/this.width,i=(r-this.y)/this.height;return n*=n,i*=i,n+i<=1}getBounds(){return new At(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class tn{constructor(...t){let r=Array.isArray(t[0])?t[0]:t;if(typeof r[0]!="number"){const n=[];for(let i=0,s=r.length;i<s;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=qt.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),r=new tn(t);return r.closeStroke=this.closeStroke,r}contains(t,r){let n=!1;const i=this.points.length/2;for(let s=0,a=i-1;s<i;a=s++){const o=this.points[s*2],l=this.points[s*2+1],h=this.points[a*2],c=this.points[a*2+1];l>r!=c>r&&t<(h-o)*((r-l)/(c-l))+o&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,r)=>`${t}, ${r}`,"")}]`}}class Bs{constructor(t=0,r=0,n=0,i=0,s=20){this.x=t,this.y=r,this.width=n,this.height=i,this.radius=s,this.type=qt.RREC}clone(){return new Bs(this.x,this.y,this.width,this.height,this.radius)}contains(t,r){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||t>=this.x+n&&t<=this.x+this.width-n)return!0;let i=t-(this.x+n),s=r-(this.y+n);const a=n*n;if(i*i+s*s<=a||(i=t-(this.x+this.width-n),i*i+s*s<=a)||(s=r-(this.y+this.height-n),i*i+s*s<=a)||(i=t-(this.x+n),i*i+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let Ot=class Bi{constructor(t=1,r=0,n=0,i=1,s=0,a=0){this.array=null,this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,r,n,i,s,a){return this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a,this}toArray(t,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return t?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(t,r){r=r||new nt;const n=t.x,i=t.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(t,r){r=r||new nt;const n=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return r.x=this.d*n*i+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*s+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(t,r){return this.tx+=t,this.ty+=r,this}scale(t,r){return this.a*=t,this.d*=r,this.c*=t,this.b*=r,this.tx*=t,this.ty*=r,this}rotate(t){const r=Math.cos(t),n=Math.sin(t),i=this.a,s=this.c,a=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=s*r-this.d*n,this.d=s*n+this.d*r,this.tx=a*r-this.ty*n,this.ty=a*n+this.ty*r,this}append(t){const r=this.a,n=this.b,i=this.c,s=this.d;return this.a=t.a*r+t.b*i,this.b=t.a*n+t.b*s,this.c=t.c*r+t.d*i,this.d=t.c*n+t.d*s,this.tx=t.tx*r+t.ty*i+this.tx,this.ty=t.tx*n+t.ty*s+this.ty,this}setTransform(t,r,n,i,s,a,o,l,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-l)*a,this.d=Math.cos(o-l)*a,this.tx=t-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(t){const r=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const n=this.a,i=this.c;this.a=n*t.a+this.b*t.c,this.b=n*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=r*t.a+this.ty*t.c+t.tx,this.ty=r*t.b+this.ty*t.d+t.ty,this}decompose(t){const r=this.a,n=this.b,i=this.c,s=this.d,a=t.pivot,o=-Math.atan2(-i,s),l=Math.atan2(n,r),h=Math.abs(o+l);return h<1e-5||Math.abs(Gn-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=l),t.scale.x=Math.sqrt(r*r+n*n),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(a.x*r+a.y*i),t.position.y=this.ty+(a.x*n+a.y*s),t}invert(){const t=this.a,r=this.b,n=this.c,i=this.d,s=this.tx,a=t*i-r*n;return this.a=i/a,this.b=-r/a,this.c=-n/a,this.d=t/a,this.tx=(n*this.ty-i*s)/a,this.ty=-(t*this.ty-r*s)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Bi;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Bi}static get TEMP_MATRIX(){return new Bi}};const Ye=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ke=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ze=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Qe=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ds=[],sl=[],qn=Math.sign;function Qd(){for(let e=0;e<16;e++){const t=[];Ds.push(t);for(let r=0;r<16;r++){const n=qn(Ye[e]*Ye[r]+Ze[e]*Ke[r]),i=qn(Ke[e]*Ye[r]+Qe[e]*Ke[r]),s=qn(Ye[e]*Ze[r]+Ze[e]*Qe[r]),a=qn(Ke[e]*Ze[r]+Qe[e]*Qe[r]);for(let o=0;o<16;o++)if(Ye[o]===n&&Ke[o]===i&&Ze[o]===s&&Qe[o]===a){t.push(o);break}}}for(let e=0;e<16;e++){const t=new Ot;t.set(Ye[e],Ke[e],Ze[e],Qe[e],0,0),sl.push(t)}}Qd();const Pt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>Ye[e],uY:e=>Ke[e],vX:e=>Ze[e],vY:e=>Qe[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Ds[e][t],sub:(e,t)=>Ds[e][Pt.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Pt.S:Pt.N:Math.abs(t)*2<=Math.abs(e)?e>0?Pt.E:Pt.W:t>0?e>0?Pt.SE:Pt.SW:e>0?Pt.NE:Pt.NW,matrixAppendRotationInv:(e,t,r=0,n=0)=>{const i=sl[Pt.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class Je{constructor(t,r,n=0,i=0){this._x=n,this._y=i,this.cb=t,this.scope=r}clone(t=this.cb,r=this.scope){return new Je(t,r,this._x,this._y)}set(t=0,r=t){return(this._x!==t||this._y!==r)&&(this._x=t,this._y=r,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const al=class{constructor(){this.worldTransform=new Ot,this.localTransform=new Ot,this.position=new Je(this.onChange,this,0,0),this.scale=new Je(this.onChange,this,1,1),this.pivot=new Je(this.onChange,this,0,0),this.skew=new Je(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){const r=e.worldTransform,n=this.worldTransform;n.a=t.a*r.a+t.b*r.c,n.b=t.a*r.b+t.b*r.d,n.c=t.c*r.a+t.d*r.c,n.d=t.c*r.b+t.d*r.d,n.tx=t.tx*r.a+t.ty*r.c+r.tx,n.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};let Hn=al;Hn.IDENTITY=new al;var Jd=`varying vec2 vTextureCoord;
21
21
 
22
22
  uniform sampler2D uSampler;
23
23
 
24
24
  void main(void){
25
25
  gl_FragColor *= texture2D(uSampler, vTextureCoord);
26
- }`,wx=`attribute vec2 aVertexPosition;
26
+ }`,tp=`attribute vec2 aVertexPosition;
27
27
  attribute vec2 aTextureCoord;
28
28
 
29
29
  uniform mat3 projectionMatrix;
@@ -34,7 +34,7 @@ void main(void){
34
34
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
35
35
  vTextureCoord = aTextureCoord;
36
36
  }
37
- `;function Mp(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function bc(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function Lp(e,t){switch(e){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return bc(2*t);case"bvec3":return bc(3*t);case"bvec4":return bc(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Yi=[{test:e=>e.type==="float"&&e.size===1&&!e.isArray,code:e=>`
37
+ `;function ol(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function Us(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function ll(e,t){switch(e){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return Us(2*t);case"bvec3":return Us(3*t);case"bvec4":return Us(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Er=[{test:e=>e.type==="float"&&e.size===1&&!e.isArray,code:e=>`
38
38
  if(uv["${e}"] !== ud["${e}"].value)
39
39
  {
40
40
  ud["${e}"].value = uv["${e}"]
@@ -154,7 +154,7 @@ void main(void){
154
154
  cv[3] = v[3];
155
155
 
156
156
  gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3])
157
- }`}],Sx={float:`
157
+ }`}],ep={float:`
158
158
  if (cv !== v)
159
159
  {
160
160
  cu.value = v;
@@ -290,7 +290,7 @@ void main(void){
290
290
  cu.value = v;
291
291
 
292
292
  gl.uniform1i(location, v);
293
- }`},Tx={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function Ex(e,t){var n;const r=[`
293
+ }`},rp={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function np(e,t){var n;const r=[`
294
294
  var v = null;
295
295
  var cv = null;
296
296
  var cu = null;
@@ -300,18 +300,18 @@ void main(void){
300
300
  renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');
301
301
  `):r.push(`
302
302
  renderer.shader.syncUniformGroup(uv.${i}, syncData);
303
- `));continue}const a=e.uniforms[i];let o=!1;for(let c=0;c<Yi.length;c++)if(Yi[c].test(s,a)){r.push(Yi[c].code(i,a)),o=!0;break}if(!o){const h=(s.size===1&&!s.isArray?Sx:Tx)[s.type].replace("location",`ud["${i}"].location`);r.push(`
303
+ `));continue}const a=e.uniforms[i];let o=!1;for(let l=0;l<Er.length;l++)if(Er[l].test(s,a)){r.push(Er[l].code(i,a)),o=!0;break}if(!o){const h=(s.size===1&&!s.isArray?ep:rp)[s.type].replace("location",`ud["${i}"].location`);r.push(`
304
304
  cu = ud["${i}"];
305
305
  cv = cu.value;
306
306
  v = uv["${i}"];
307
307
  ${h};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
308
- `))}const Bp={};let Ki=Bp;function Ax(){if(Ki===Bp||Ki!=null&&Ki.isContextLost()){const e=Pt.ADAPTER.createCanvas();let t;Pt.PREFER_ENV>=ii.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Ki=t}return Ki}let fo;function Cx(){if(!fo){fo=dr.MEDIUM;const e=Ax();e&&e.getShaderPrecisionFormat&&(fo=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?dr.HIGH:dr.MEDIUM)}return fo}function Fp(e,t){const r=e.getShaderSource(t).split(`
309
- `).map((h,d)=>`${d}: ${h}`),n=e.getShaderInfoLog(t),i=n.split(`
310
- `),s={},a=i.map(h=>parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(h=>h&&!s[h]?(s[h]=!0,!0):!1),o=[""];a.forEach(h=>{r[h-1]=`%c${r[h-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(`
311
- `);o[0]=c,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function Ox(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||Fp(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||Fp(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const Px={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Dp(e){return Px[e]}let po=null;const Up={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function jp(e,t){if(!po){const r=Object.keys(Up);po={};for(let n=0;n<r.length;++n){const i=r[n];po[e[i]]=Up[i]}}return po[t]}function $p(e,t,r){if(e.substring(0,9)!=="precision"){let n=t;return t===dr.HIGH&&r!==dr.HIGH&&(n=dr.MEDIUM),`precision ${n} float;
312
- ${e}`}else if(r!==dr.HIGH&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}let Xs;function Ix(){if(typeof Xs=="boolean")return Xs;try{Xs=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Xs=!1}return Xs}let kx=0;const mo={},Zi=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=kx++,this.vertexSrc=e||Zi.defaultVertexSrc,this.fragmentSrc=t||Zi.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),mo[r]?(mo[r]++,r+=`-${mo[r]}`):mo[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
308
+ `))}const ul={};let Tr=ul;function ip(){if(Tr===ul||Tr!=null&&Tr.isContextLost()){const e=vt.ADAPTER.createCanvas();let t;vt.PREFER_ENV>=$e.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Tr=t}return Tr}let zn;function sp(){if(!zn){zn=Jt.MEDIUM;const e=ip();e&&e.getShaderPrecisionFormat&&(zn=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Jt.HIGH:Jt.MEDIUM)}return zn}function hl(e,t){const r=e.getShaderSource(t).split(`
309
+ `).map((h,c)=>`${c}: ${h}`),n=e.getShaderInfoLog(t),i=n.split(`
310
+ `),s={},a=i.map(h=>parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(h=>h&&!s[h]?(s[h]=!0,!0):!1),o=[""];a.forEach(h=>{r[h-1]=`%c${r[h-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=r.join(`
311
+ `);o[0]=l,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function ap(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||hl(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||hl(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const op={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function cl(e){return op[e]}let Vn=null;const fl={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function dl(e,t){if(!Vn){const r=Object.keys(fl);Vn={};for(let n=0;n<r.length;++n){const i=r[n];Vn[e[i]]=fl[i]}}return Vn[t]}function pl(e,t,r){if(e.substring(0,9)!=="precision"){let n=t;return t===Jt.HIGH&&r!==Jt.HIGH&&(n=Jt.MEDIUM),`precision ${n} float;
312
+ ${e}`}else if(r!==Jt.HIGH&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}let en;function lp(){if(typeof en=="boolean")return en;try{en=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{en=!1}return en}let up=0;const Xn={},Ar=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=up++,this.vertexSrc=e||Ar.defaultVertexSrc,this.fragmentSrc=t||Ar.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),Xn[r]?(Xn[r]++,r+=`-${Xn[r]}`):Xn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
313
313
  ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
314
- ${this.fragmentSrc}`,this.vertexSrc=$p(this.vertexSrc,Zi.defaultVertexPrecision,dr.HIGH),this.fragmentSrc=$p(this.fragmentSrc,Zi.defaultFragmentPrecision,Cx())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return wx}static get defaultFragmentSrc(){return xx}static from(e,t,r){const n=e+t;let i=Ep[n];return i||(Ep[n]=i=new Zi(e,t,r)),i}};let kr=Zi;kr.defaultVertexPrecision=dr.HIGH,kr.defaultFragmentPrecision=Li.apple.device?dr.HIGH:dr.MEDIUM;let Rx=0;class Rr{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Rx++,this.static=!!r,this.ubo=!!n,t instanceof Oe?(this.buffer=t,this.buffer.type=Xr.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Oe(new Float32Array(1)),this.buffer.type=Xr.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,r,n){if(!this.ubo)this.uniforms[t]=new Rr(r,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(t,r,n){return new Rr(t,r,n)}static uboFrom(t,r){return new Rr(t,r??!0,!0)}}class tn{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof Rr?this.uniformGroup=r:this.uniformGroup=new Rr(r):this.uniformGroup=new Rr({}),this.disposeRunner=new Ir("disposeShader")}checkUniformExists(t,r){if(r.uniforms[t])return!0;for(const n in r.uniforms){const i=r.uniforms[n];if(i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,r,n){const i=kr.from(t,r);return new tn(i,n)}}class Nx{constructor(t,r){if(this.vertexSrc=t,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const n=new Int32Array(t);for(let s=0;s<t;s++)n[s]=s;this.defaultGroupCache[t]=Rr.from({uSamplers:n},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${t}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new kr(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new ee,default:this.defaultGroupCache[t]};return new tn(this.programCache[t],r)}generateSampleSrc(t){let r="";r+=`
314
+ ${this.fragmentSrc}`,this.vertexSrc=pl(this.vertexSrc,Ar.defaultVertexPrecision,Jt.HIGH),this.fragmentSrc=pl(this.fragmentSrc,Ar.defaultFragmentPrecision,sp())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return tp}static get defaultFragmentSrc(){return Jd}static from(e,t,r){const n=e+t;let i=Jo[n];return i||(Jo[n]=i=new Ar(e,t,r)),i}};let Se=Ar;Se.defaultVertexPrecision=Jt.HIGH,Se.defaultFragmentPrecision=hr.apple.device?Jt.HIGH:Jt.MEDIUM;let hp=0;class ae{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=hp++,this.static=!!r,this.ubo=!!n,t instanceof Yt?(this.buffer=t,this.buffer.type=ve.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Yt(new Float32Array(1)),this.buffer.type=ve.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,r,n){if(!this.ubo)this.uniforms[t]=new ae(r,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(t,r,n){return new ae(t,r,n)}static uboFrom(t,r){return new ae(t,r??!0,!0)}}class rn{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof ae?this.uniformGroup=r:this.uniformGroup=new ae(r):this.uniformGroup=new ae({}),this.disposeRunner=new se("disposeShader")}checkUniformExists(t,r){if(r.uniforms[t])return!0;for(const n in r.uniforms){const i=r.uniforms[n];if(i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,r,n){const i=Se.from(t,r);return new rn(i,n)}}class cp{constructor(t,r){if(this.vertexSrc=t,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const n=new Int32Array(t);for(let s=0;s<t;s++)n[s]=s;this.defaultGroupCache[t]=ae.from({uSamplers:n},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${t}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Se(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ot,default:this.defaultGroupCache[t]};return new rn(this.programCache[t],r)}generateSampleSrc(t){let r="";r+=`
315
315
  `,r+=`
316
316
  `;for(let n=0;n<t;n++)n>0&&(r+=`
317
317
  else `),n<t-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
@@ -319,7 +319,7 @@ else `),n<t-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
319
319
  color = texture2D(uSamplers[${n}], vTextureCoord);`,r+=`
320
320
  }`;return r+=`
321
321
  `,r+=`
322
- `,r}}class xc{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}function Mx(){return!Li.apple.device}function Lx(e){let t=!0;const r=Pt.ADAPTER.getNavigator();if(Li.tablet||Li.phone){if(Li.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(Li.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class go{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var Bx=`varying vec2 vTextureCoord;
322
+ `,r}}class js{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}function fp(){return!hr.apple.device}function dp(e){let t=!0;const r=vt.ADAPTER.getNavigator();if(hr.tablet||hr.phone){if(hr.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(hr.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class yl{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var pp=`varying vec2 vTextureCoord;
323
323
  varying vec4 vColor;
324
324
  varying float vTextureId;
325
325
  uniform sampler2D uSamplers[%count%];
@@ -329,7 +329,7 @@ void main(void){
329
329
  %forloop%
330
330
  gl_FragColor = color * vColor;
331
331
  }
332
- `,Fx=`precision highp float;
332
+ `,yp=`precision highp float;
333
333
  attribute vec2 aVertexPosition;
334
334
  attribute vec2 aTextureCoord;
335
335
  attribute vec4 aColor;
@@ -350,14 +350,14 @@ void main(void){
350
350
  vTextureId = aTextureId;
351
351
  vColor = aColor * tint;
352
352
  }
353
- `;const Nr=class extends go{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=kp,this.vertexSize=6,this.state=ci.for2d(),this.size=Nr.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??Lx(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Mx(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return Kt("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return Fx}static get defaultFragmentTemplate(){return Bx}setShaderGenerator({vertex:e=Nr.defaultVertexSrc,fragment:t=Nr.defaultFragmentTemplate}={}){this.shaderGenerator=new Nx(e,t)}contextChange(){const e=this.renderer.gl;Pt.PREFER_ENV===ii.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),Nr.defaultMaxTextures),this.maxTextures=cx(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:t}=Nr,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new gc);for(;t.length<n;)t.push(new xc);for(let i=0;i<this.maxTextures;i++)this._tempBoundTextures[i]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,r=Nr._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++Ht._globalBatch,o=0,c=r[0],h=0;n.copyBoundTextures(i,t);for(let d=0;d<this._bufferSize;++d){const p=e[d];e[d]=null,p._batchEnabled!==a&&(c.count>=t&&(n.boundArray(c,i,a,t),this.buildDrawCalls(c,h,d),h=d,c=r[++o],++a),p._batchEnabled=a,p.touched=s,c.elements[c.count++]=p)}c.count>0&&(n.boundArray(c,i,a,t),this.buildDrawCalls(c,h,this._bufferSize),++o,++a);for(let d=0;d<i.length;d++)i[d]=null;Ht._globalBatch=a}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:a}=this,o=Nr._drawCallPool;let c=this._dcIndex,h=this._aIndex,d=this._iIndex,p=o[c];p.start=this._iIndex,p.texArray=e;for(let f=t;f<r;++f){const m=n[f],g=m._texture.baseTexture,v=_p[g.alphaMode?1:0][m.blendMode];n[f]=null,t<f&&p.blend!==v&&(p.size=d-p.start,t=f,p=o[++c],p.texArray=e,p.start=d),this.packInterleavedGeometry(m,i,s,h,d),h+=m.vertexData.length/2*a,d+=m.indices.length,p.blend=v}t<r&&(p.size=d-p.start,++c),this._dcIndex=c,this._aIndex=h,this._iIndex=d}bindAndClearTexArray(e){const t=this.renderer.texture;for(let r=0;r<e.count;r++)t.bind(e.elements[r],e.ids[r]),e.elements[r]=null;e.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:t,_indexBuffer:r}=this;Nr.canUploadSameBuffer?(e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:t,state:r}=this.renderer,n=Nr._drawCallPool;let i=null;for(let s=0;s<e;s++){const{texArray:a,type:o,size:c,start:h,blend:d}=n[s];i!==a&&(i=a,this.bindAndClearTexArray(a)),this.state.blendMode=d,r.set(this.state),t.drawElements(o,c,t.UNSIGNED_SHORT,h*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),Nr.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(e){const t=ao(Math.ceil(e/8)),r=Sp(t),n=t*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._aBuffers[n];return i||(this._aBuffers[n]=i=new ox(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=ao(Math.ceil(e/12)),r=Sp(t),n=t*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._iBuffers[r];return i||(this._iBuffers[r]=i=new Uint16Array(n)),i}packInterleavedGeometry(e,t,r,n,i){const{uint32View:s,float32View:a}=t,o=n/this.vertexSize,c=e.uvs,h=e.indices,d=e.vertexData,p=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),m=ae.shared.setValue(e._tintRGB).toPremultiplied(f);for(let g=0;g<d.length;g+=2)a[n++]=d[g],a[n++]=d[g+1],a[n++]=c[g],a[n++]=c[g+1],s[n++]=m,a[n++]=p;for(let g=0;g<h.length;g++)r[i++]=o+h[g]}};let Mr=Nr;Mr.defaultBatchSize=4096,Mr.extension={name:"batch",type:Et.RendererPlugin},Mr._drawCallPool=[],Mr._textureArrayPool=[],Bt.add(Mr);var Dx=`varying vec2 vTextureCoord;
353
+ `;const oe=class extends yl{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=il,this.vertexSize=6,this.state=Un.for2d(),this.size=oe.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??dp(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??fp(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return xt("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return yp}static get defaultFragmentTemplate(){return pp}setShaderGenerator({vertex:e=oe.defaultVertexSrc,fragment:t=oe.defaultFragmentTemplate}={}){this.shaderGenerator=new cp(e,t)}contextChange(){const e=this.renderer.gl;vt.PREFER_ENV===$e.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),oe.defaultMaxTextures),this.maxTextures=$d(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:t}=oe,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new Ls);for(;t.length<n;)t.push(new js);for(let i=0;i<this.maxTextures;i++)this._tempBoundTextures[i]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,r=oe._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++gt._globalBatch,o=0,l=r[0],h=0;n.copyBoundTextures(i,t);for(let c=0;c<this._bufferSize;++c){const f=e[c];e[c]=null,f._batchEnabled!==a&&(l.count>=t&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,h,c),h=c,l=r[++o],++a),f._batchEnabled=a,f.touched=s,l.elements[l.count++]=f)}l.count>0&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,h,this._bufferSize),++o,++a);for(let c=0;c<i.length;c++)i[c]=null;gt._globalBatch=a}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:a}=this,o=oe._drawCallPool;let l=this._dcIndex,h=this._aIndex,c=this._iIndex,f=o[l];f.start=this._iIndex,f.texArray=e;for(let u=t;u<r;++u){const d=n[u],p=d._texture.baseTexture,v=Fd[p.alphaMode?1:0][d.blendMode];n[u]=null,t<u&&f.blend!==v&&(f.size=c-f.start,t=u,f=o[++l],f.texArray=e,f.start=c),this.packInterleavedGeometry(d,i,s,h,c),h+=d.vertexData.length/2*a,c+=d.indices.length,f.blend=v}t<r&&(f.size=c-f.start,++l),this._dcIndex=l,this._aIndex=h,this._iIndex=c}bindAndClearTexArray(e){const t=this.renderer.texture;for(let r=0;r<e.count;r++)t.bind(e.elements[r],e.ids[r]),e.elements[r]=null;e.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:t,_indexBuffer:r}=this;oe.canUploadSameBuffer?(e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:t,state:r}=this.renderer,n=oe._drawCallPool;let i=null;for(let s=0;s<e;s++){const{texArray:a,type:o,size:l,start:h,blend:c}=n[s];i!==a&&(i=a,this.bindAndClearTexArray(a)),this.state.blendMode=c,r.set(this.state),t.drawElements(o,l,t.UNSIGNED_SHORT,h*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),oe.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(e){const t=Fn(Math.ceil(e/8)),r=Qo(t),n=t*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._aBuffers[n];return i||(this._aBuffers[n]=i=new Ud(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=Fn(Math.ceil(e/12)),r=Qo(t),n=t*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._iBuffers[r];return i||(this._iBuffers[r]=i=new Uint16Array(n)),i}packInterleavedGeometry(e,t,r,n,i){const{uint32View:s,float32View:a}=t,o=n/this.vertexSize,l=e.uvs,h=e.indices,c=e.vertexData,f=e._texture.baseTexture._batchLocation,u=Math.min(e.worldAlpha,1),d=Wt.shared.setValue(e._tintRGB).toPremultiplied(u);for(let p=0;p<c.length;p+=2)a[n++]=c[p],a[n++]=c[p+1],a[n++]=l[p],a[n++]=l[p+1],s[n++]=d,a[n++]=f;for(let p=0;p<h.length;p++)r[i++]=o+h[p]}};let le=oe;le.defaultBatchSize=4096,le.extension={name:"batch",type:pt.RendererPlugin},le._drawCallPool=[],le._textureArrayPool=[],wt.add(le);var vp=`varying vec2 vTextureCoord;
354
354
 
355
355
  uniform sampler2D uSampler;
356
356
 
357
357
  void main(void){
358
358
  gl_FragColor = texture2D(uSampler, vTextureCoord);
359
359
  }
360
- `,Ux=`attribute vec2 aVertexPosition;
360
+ `,mp=`attribute vec2 aVertexPosition;
361
361
 
362
362
  uniform mat3 projectionMatrix;
363
363
 
@@ -383,7 +383,7 @@ void main(void)
383
383
  gl_Position = filterVertexPosition();
384
384
  vTextureCoord = filterTextureCoord();
385
385
  }
386
- `;const Ys=class extends tn{constructor(e,t,r){const n=kr.from(e||Ys.defaultVertexSrc,t||Ys.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=Ys.defaultResolution,this.multisample=Ys.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new ci}apply(e,t,r,n,i){e.applyFilter(this,t,r,n)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return Ux}static get defaultFragmentSrc(){return Dx}};let wn=Ys;wn.defaultResolution=1,wn.defaultMultisample=Ee.NONE;class yo{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new ae(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=t,s=n??r;s!==void 0&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}yo.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},yo.extension={type:[Et.RendererSystem,Et.CanvasRendererSystem],name:"background"},Bt.add(yo);class zp{constructor(t){this.renderer=t,this.emptyRenderer=new go(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)t[i]=n[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,r,n,i){const{elements:s,ids:a,count:o}=t;let c=0;for(let h=0;h<o;h++){const d=s[h],p=d._batchLocation;if(p>=0&&p<i&&r[p]===d){a[h]=p;continue}for(;c<i;){const f=r[c];if(f&&f._batchEnabled===n&&f._batchLocation===c){c++;continue}a[h]=c,d._batchLocation=c,r[c]=d;break}}}destroy(){this.renderer=null}}zp.extension={type:Et.RendererSystem,name:"batch"},Bt.add(zp);let Hp=0;class vo{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Hp++}init(t){if(t.context)this.initFromContext(t.context);else{const r=this.renderer.background.alpha<1,n=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Hp++,this.renderer.runners.contextChange.emit(t);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const r=this.createContext(this.renderer.view,t);this.initFromContext(r)}createContext(t,r){let n;if(Pt.PREFER_ENV>=ii.WEBGL2&&(n=t.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=t.getContext("webgl",r)||t.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,r={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const r=t.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}vo.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},vo.extension={type:Et.RendererSystem,name:"context"},Bt.add(vo);class jx extends mc{upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===yn.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}}class wc{constructor(t,r){this.width=Math.round(t||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ir("disposeFramebuffer"),this.multisample=Ee.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,r){return this.colorTextures[t]=r||new Ht(null,{scaleMode:mn.NEAREST,resolution:1,mipmap:Mn.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new Ht(new jx(null,{width:this.width,height:this.height}),{scaleMode:mn.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Mn.OFF,format:wt.DEPTH_COMPONENT,type:Ut.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,r){if(t=Math.round(t),r=Math.round(r),!(t===this.width&&r===this.height)){this.width=t,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],s=i.resolution;i.setSize(t/s,r/s)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Gp extends Ht{constructor(t={}){if(typeof t=="number"){const r=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];t={width:r,height:n,scaleMode:i,resolution:s}}t.width=t.width||100,t.height=t.height||100,t.multisample??(t.multisample=Ee.NONE),super(null,t),this.mipmap=Mn.OFF,this.valid=!0,this._clear=new ae([0,0,0,0]),this.framebuffer=new wc(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(t,r){this.framebuffer.resize(t*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class jn extends Vs{constructor(t){const r=t,n=r.naturalWidth||r.videoWidth||r.width,i=r.naturalHeight||r.videoHeight||r.height;super(n,i),this.source=t,this.noSubImage=!1}static crossOrigin(t,r,n){n===void 0&&!r.startsWith("data:")?t.crossOrigin=ax(r):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")}upload(t,r,n,i){const s=t.gl,a=r.realWidth,o=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1&&i.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===yn.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&n.width===a&&n.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=a,n.height=o,s.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const t=this.source,r=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class qp extends jn{constructor(t,r){if(r=r||{},typeof t=="string"){const n=new Image;jn.crossOrigin(n,t,r.crossorigin),n.src=t,t=n}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??Pt.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(t){return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const s=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.resize(i.width,i.height),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?s():(i.onload=s,i.onerror=a=>{n(a),this.onError.emit(a)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===yn.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==n&&o.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Vp{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,r,n){const i=r.width,s=r.height;if(n){const a=t.width/2/i,o=t.height/2/s,c=t.x/i+a,h=t.y/s+o;n=pe.add(n,pe.NW),this.x0=c+a*pe.uX(n),this.y0=h+o*pe.uY(n),n=pe.add(n,2),this.x1=c+a*pe.uX(n),this.y1=h+o*pe.uY(n),n=pe.add(n,2),this.x2=c+a*pe.uX(n),this.y2=h+o*pe.uY(n),n=pe.add(n,2),this.x3=c+a*pe.uX(n),this.y3=h+o*pe.uY(n)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const Wp=new Vp;function _o(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class Tt extends _n{constructor(t,r,n,i,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new Vt(0,0,1,1)),t instanceof Tt&&(t=t.baseTexture),this.baseTexture=t,this._frame=r,this.trim=i,this.valid=!1,this._uvs=Wp,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new xt(a.x,a.y):new xt(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=r:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:r}=this.baseTexture;r!=null&&r.url&&Qr[r.url]&&Tt.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Tt.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new Tt(this.baseTexture,!this.noFrame&&t,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=t),n}updateUvs(){this._uvs===Wp&&(this._uvs=new Vp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,r={},n=Pt.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let s=null;if(i)s=t;else if(t instanceof Ht){if(!t.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Gs()}`,Ht.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Gs()}`}s=t._pixiId}let a=Qr[s];if(i&&n&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(t instanceof Ht)?(r.resolution||(r.resolution=qs(t)),a=new Tt(new Ht(t,r)),a.baseTexture.cacheId=s,Ht.addToCache(a.baseTexture,s),Tt.addToCache(a,s)):!a&&t instanceof Ht&&(a=new Tt(t),Tt.addToCache(a,s)),a}static fromURL(t,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=Tt.from(t,Object.assign({resourceOptions:n},r),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then(()=>Promise.resolve(i))}static fromBuffer(t,r,n,i){return new Tt(Ht.fromBuffer(t,r,n,i))}static fromLoader(t,r,n,i){const s=new Ht(t,Object.assign({scaleMode:Ht.defaultOptions.scaleMode,resolution:qs(r)},i)),{resource:a}=s;a instanceof qp&&(a.url=r);const o=new Tt(s);return n||(n=r),Ht.addToCache(o.baseTexture,n),Tt.addToCache(o,n),n!==r&&(Ht.addToCache(o.baseTexture,r),Tt.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(c=>{o.baseTexture.once("loaded",()=>c(o))})}static addToCache(t,r){r&&(t.textureCacheIds.includes(r)||t.textureCacheIds.push(r),Qr[r]&&Qr[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),Qr[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=Qr[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete Qr[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)Qr[t.textureCacheIds[r]]===t&&delete Qr[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:r,y:n,width:i,height:s}=t,a=r+i>this.baseTexture.width,o=n+s>this.baseTexture.height;if(a||o){const c=a&&o?"and":"or",h=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,d=`Y: ${n} + ${s} = ${n+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${h} ${c} ${d}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Tt._EMPTY||(Tt._EMPTY=new Tt(new Ht),_o(Tt._EMPTY),_o(Tt._EMPTY.baseTexture)),Tt._EMPTY}static get WHITE(){if(!Tt._WHITE){const t=Pt.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),Tt._WHITE=new Tt(Ht.from(t)),_o(Tt._WHITE),_o(Tt._WHITE.baseTexture)}return Tt._WHITE}}class bo extends Tt{constructor(t,r){super(t,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,r,n=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,a=Math.round(r*i)/i;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(t){const{baseTexture:r}=this;r.resolution!==t&&(r.setResolution(t),this.resize(r.width,r.height,!1))}static create(t){return new bo(new Gp(t))}}class Xp{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,r,n=Ee.NONE){const i=new Gp(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new bo(i)}getOptimalTexture(t,r,n=1,i=Ee.NONE){let s;t=Math.ceil(t*n-1e-6),r=Math.ceil(r*n-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||r!==this._pixelsHeight?(t=ao(t),r=ao(r),s=((t&65535)<<16|r&65535)>>>0,i>1&&(s+=i*4294967296)):s=i>1?-i:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(t,r,i)),a.filterPoolKey=s,a.setResolution(n),a}getFilterTexture(t,r,n){const i=this.getOptimalTexture(t.width,t.height,r||t.resolution,n||Ee.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const r=t.filterPoolKey;t.filterFrame=null,this.texturePool[r].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}Xp.SCREEN_KEY=-1;class $x extends Un{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Yp extends Un{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Oe(this.vertices),this.uvBuffer=new Oe(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/t.width,this.uvs[3]=i,this.uvs[4]=n+r.width/t.width,this.uvs[5]=i+r.height/t.height,this.uvs[6]=n,this.uvs[7]=i+r.height/t.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class zx{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ee.NONE,this.sourceFrame=new Vt,this.destinationFrame=new Vt,this.bindingSourceFrame=new Vt,this.bindingDestinationFrame=new Vt,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const xo=[new xt,new xt,new xt,new xt],Sc=new ee;class Kp{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new Xp,this.statePool=[],this.quad=new $x,this.quadUv=new Yp,this.tempRect=new Vt,this.activeState={},this.globalUniforms=new Rr({outputFrame:new Vt,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,r){const n=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new zx,a=this.renderer.renderTexture;let o=r[0].resolution,c=r[0].multisample,h=r[0].padding,d=r[0].autoFit,p=r[0].legacy??!0;for(let g=1;g<r.length;g++){const v=r[g];o=Math.min(o,v.resolution),c=Math.min(c,v.multisample),h=this.useMaxPadding?Math.max(h,v.padding):h+v.padding,d=d&&v.autoFit,p=p||(v.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),i.push(s),s.resolution=o,s.multisample=c,s.legacy=p,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(h);const f=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(Sc.copyFrom(n.projection.transform).invert(),f),d?(s.sourceFrame.fit(f),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(f)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,c),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const m=this.tempRect;m.x=0,m.y=0,m.width=s.sourceFrame.width,m.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,m),n.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,r=t.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const s=i.inputSize,a=i.inputPixel,o=i.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const h=i.filterArea;h[0]=r.destinationFrame.width,h[1]=r.destinationFrame.height,h[2]=r.sourceFrame.x,h[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const c=t[t.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,c.renderTexture,si.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let h=r.renderTexture,d=this.getOptimalFilterTexture(h.width,h.height,r.resolution);d.filterFrame=h.filterFrame;let p=0;for(p=0;p<n.length-1;++p){p===1&&r.multisample>1&&(d=this.getOptimalFilterTexture(h.width,h.height,r.resolution),d.filterFrame=h.filterFrame),n[p].apply(this,h,d,si.CLEAR,r);const f=h;h=d,d=f}n[p].apply(this,h,c.renderTexture,si.BLEND,r),p>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}r.clear(),this.statePool.push(r)}bindAndClear(t,r=si.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t!=null&&t.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,n.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=i.stateId&1||this.forceClear;(r===si.CLEAR||r===si.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,r,n,i){const s=this.renderer;s.state.set(t.state),this.bindAndClear(n,i),t.uniforms.uSampler=r,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Cr.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Cr.TRIANGLE_STRIP))}calculateSpriteMatrix(t,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:s}=r._texture,a=t.set(i.width,0,0,i.height,n.x,n.y),o=r.worldTransform.copyTo(ee.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,r,n=1,i=Ee.NONE){return this.texturePool.getOptimalTexture(t,r,n,i)}getFilterTexture(t,r,n){if(typeof t=="number"){const s=t;t=r,r=s}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,r||t.resolution,n||Ee.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,r){const n=xo[0],i=xo[1],s=xo[2],a=xo[3];n.set(r.left,r.top),i.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),t.apply(n,n),t.apply(i,i),t.apply(s,s),t.apply(a,a);const o=Math.min(n.x,i.x,s.x,a.x),c=Math.min(n.y,i.y,s.y,a.y),h=Math.max(n.x,i.x,s.x,a.x),d=Math.max(n.y,i.y,s.y,a.y);r.x=o,r.y=c,r.width=h-o,r.height=d-c}roundFrame(t,r,n,i,s){if(!(t.width<=0||t.height<=0||n.width<=0||n.height<=0)){if(s){const{a,b:o,c,d:h}=s;if((Math.abs(o)>1e-4||Math.abs(c)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}s=s?Sc.copyFrom(s):Sc.identity(),s.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(r),this.transformAABB(s.invert(),t)}}}Kp.extension={type:Et.RendererSystem,name:"filter"},Bt.add(Kp);class Hx{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ee.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Gx=new Vt;class Zp{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new wc(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Vt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;Pt.PREFER_ENV===ii.WEBGL_LEGACY&&(r=null,n=null),r?t.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,t.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,r,n=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==n&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=n),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,n)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let a=0;a<t.colorTextures.length;a++){const o=t.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),r){const a=r.width>>n,o=r.height>>n,c=a/r.width;this.setViewport(r.x*c,r.y*c,a,o)}else{const a=t.width>>n,o=t.height>>n;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,r,n,i){const s=this.viewport;t=Math.round(t),r=Math.round(r),n=Math.round(n),i=Math.round(i),(s.width!==n||s.height!==i||s.x!==t||s.y!==r)&&(s.x=t,s.y=r,s.width=n,s.height=i,this.gl.viewport(t,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,r,n,i,s=vu.COLOR|vu.DEPTH){const{gl:a}=this;a.clearColor(t,r,n,i),a.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new Hx(r.createFramebuffer());return n.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(t),t.disposeRunner.add(this),n}resizeFramebuffer(t){const{gl:r}=this,n=t.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height));const i=t.colorTextures;let s=i.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=i[a],c=o.parentTextureArray||o;this.renderer.texture.bind(c,0),a===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,r){const{gl:n}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let a=s.length;n.drawBuffers||(a=Math.min(a,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let c=0;c<a;c++){const h=s[c],d=h.parentTextureArray||h;this.renderer.texture.bind(d,0),c===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,d._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+c,h.target,d._glTextures[this.CONTEXT_UID].texture,r),o.push(n.COLOR_ATTACHMENT0+c))}if(o.length>1&&n.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,r)}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:r}=this;let n=Ee.NONE;if(t<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=t){n=r[i];break}return n===1&&(n=Ee.NONE),n}blit(t,r,n){const{current:i,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!i)return;const c=i.glFramebuffers[o];if(!c)return;if(!t){if(!c.msaaBuffer)return;const d=i.colorTextures[0];if(!d)return;c.blitFramebuffer||(c.blitFramebuffer=new wc(i.width,i.height),c.blitFramebuffer.addColorTexture(0,d)),t=c.blitFramebuffer,t.colorTextures[0]!==d&&(t.colorTextures[0]=d,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}r||(r=Gx,r.width=i.width,r.height=i.height),n||(n=r);const h=r.width===n.width&&r.height===n.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,c.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,a.COLOR_BUFFER_BIT,h?a.NEAREST:a.LINEAR)}disposeFramebuffer(t,r){const n=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(t){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],t)}forceStencil(){const t=this.current;if(!t)return;const r=t.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;t.stencil=!0;const n=t.width,i=t.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,n,i):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,n,i),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Vt}destroy(){this.renderer=null}}Zp.extension={type:Et.RendererSystem,name:"framebuffer"},Bt.add(Zp);const Tc={5126:4,5123:2,5121:1};class Qp{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;Pt.PREFER_ENV===ii.WEBGL_LEGACY&&(n=null),n?(t.createVertexArray=()=>n.createVertexArrayOES(),t.bindVertexArray=i=>n.bindVertexArrayOES(i),t.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=t.getExtension("ANGLE_instanced_arrays");n?(t.vertexAttribDivisor=(i,s)=>n.vertexAttribDivisorANGLE(i,s),t.drawElementsInstanced=(i,s,a,o,c)=>n.drawElementsInstancedANGLE(i,s,a,o,c),t.drawArraysInstanced=(i,s,a,o)=>n.drawArraysInstancedANGLE(i,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(t,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const a=i[r.program.id]||this.initGeometryVao(t,r,s);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?n.bindVertexArray(a):this.activateVao(t,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<t.buffers.length;n++){const i=t.buffers[n];r.update(i)}}checkCompatibility(t,r){const n=t.attributes,i=r.attributeData;for(const s in i)if(!n[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(t,r){const n=t.attributes,i=r.attributeData,s=["g",t.id];for(const a in n)i[a]&&s.push(a,i[a].location);return s.join("-")}initGeometryVao(t,r,n=!0){const i=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(t,o);const c=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID];let d=h[c];if(d)return h[o.id]=d,d;const p=t.buffers,f=t.attributes,m={},g={};for(const v in p)m[v]=0,g[v]=0;for(const v in f)!f[v].size&&o.attributeData[v]?f[v].size=o.attributeData[v].size:f[v].size||console.warn(`PIXI Geometry attribute '${v}' size cannot be determined (likely the bound shader does not have the attribute)`),m[f[v].buffer]+=f[v].size*Tc[f[v].type];for(const v in f){const b=f[v],_=b.size;b.stride===void 0&&(m[b.buffer]===_*Tc[b.type]?b.stride=0:b.stride=m[b.buffer]),b.start===void 0&&(b.start=g[b.buffer],g[b.buffer]+=_*Tc[b.type])}d=i.createVertexArray(),i.bindVertexArray(d);for(let v=0;v<p.length;v++){const b=p[v];a.bind(b),n&&b._glBuffers[s].refCount++}return this.activateVao(t,o),h[o.id]=d,h[c]=d,i.bindVertexArray(null),a.unbind(Xr.ARRAY_BUFFER),d}disposeGeometry(t,r){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const n=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(t.disposeRunner.remove(this),!!n){if(a)for(let c=0;c<s.length;c++){const h=s[c]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(s[c],r))}if(!r){for(const c in n)if(c[0]==="g"){const h=n[c];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],t)}activateVao(t,r){const n=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,a=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let c=null;for(const h in o){const d=o[h],p=a[d.buffer],f=p._glBuffers[i];if(r.attributeData[h]){c!==f&&(s.bind(p),c=f);const m=r.attributeData[h].location;if(n.enableVertexAttribArray(m),n.vertexAttribPointer(m,d.size,d.type||n.FLOAT,d.normalized,d.stride,d.start),d.instance)if(this.hasInstance)n.vertexAttribDivisor(m,d.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,r,n,i){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,c=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(t,r||a.indexBuffer.data.length,c,(n||0)*o,i||1):s.drawElements(t,r||a.indexBuffer.data.length,c,(n||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(t,n,r||a.getSize(),i||1):s.drawArrays(t,n,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Qp.extension={type:Et.RendererSystem,name:"geometry"},Bt.add(Qp);const Jp=new ee;class Ec{constructor(t,r){this._texture=t,this.mapCoord=new ee,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,r){r===void 0&&(r=t);const n=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],a=t[i+1];r[i]=s*n.a+a*n.c+n.tx,r[i+1]=s*n.b+a*n.d+n.ty}return r}update(t){const r=this._texture;if(!r||!r.valid||!t&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,s=r.trim;s&&(Jp.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Jp));const a=r.baseTexture,o=this.uClampFrame,c=this.clampMargin/a.resolution,h=this.clampOffset;return o[0]=(r._frame.x+c+h)/a.width,o[1]=(r._frame.y+c+h)/a.height,o[2]=(r._frame.x+r._frame.width-c+h)/a.width,o[3]=(r._frame.y+r._frame.height-c+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var qx=`varying vec2 vMaskCoord;
386
+ `;const nn=class extends rn{constructor(e,t,r){const n=Se.from(e||nn.defaultVertexSrc,t||nn.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=nn.defaultResolution,this.multisample=nn.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Un}apply(e,t,r,n,i){e.applyFilter(this,t,r,n)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return mp}static get defaultFragmentSrc(){return vp}};let Oe=nn;Oe.defaultResolution=1,Oe.defaultMultisample=Dt.NONE;class Wn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Wt(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=t,s=n??r;s!==void 0&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}Wn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Wn.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"background"},wt.add(Wn);class vl{constructor(t){this.renderer=t,this.emptyRenderer=new yl(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)t[i]=n[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,r,n,i){const{elements:s,ids:a,count:o}=t;let l=0;for(let h=0;h<o;h++){const c=s[h],f=c._batchLocation;if(f>=0&&f<i&&r[f]===c){a[h]=f;continue}for(;l<i;){const u=r[l];if(u&&u._batchEnabled===n&&u._batchLocation===l){l++;continue}a[h]=l,c._batchLocation=l,r[l]=c;break}}}destroy(){this.renderer=null}}vl.extension={type:pt.RendererSystem,name:"batch"},wt.add(vl);let ml=0;class Yn{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=ml++}init(t){if(t.context)this.initFromContext(t.context);else{const r=this.renderer.background.alpha<1,n=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=ml++,this.renderer.runners.contextChange.emit(t);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const r=this.createContext(this.renderer.view,t);this.initFromContext(r)}createContext(t,r){let n;if(vt.PREFER_ENV>=$e.WEBGL2&&(n=t.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=t.getContext("webgl",r)||t.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,r={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const r=t.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Yn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Yn.extension={type:pt.RendererSystem,name:"context"},wt.add(Yn);class gp extends Ms{upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Me.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}}class Gs{constructor(t,r){this.width=Math.round(t||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new se("disposeFramebuffer"),this.multisample=Dt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,r){return this.colorTextures[t]=r||new gt(null,{scaleMode:we.NEAREST,resolution:1,mipmap:qe.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new gt(new gp(null,{width:this.width,height:this.height}),{scaleMode:we.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:qe.OFF,format:rt.DEPTH_COMPONENT,type:mt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,r){if(t=Math.round(t),r=Math.round(r),!(t===this.width&&r===this.height)){this.width=t,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],s=i.resolution;i.setSize(t/s,r/s)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class gl extends gt{constructor(t={}){if(typeof t=="number"){const r=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];t={width:r,height:n,scaleMode:i,resolution:s}}t.width=t.width||100,t.height=t.height||100,t.multisample??(t.multisample=Dt.NONE),super(null,t),this.mipmap=qe.OFF,this.valid=!0,this._clear=new Wt([0,0,0,0]),this.framebuffer=new Gs(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(t,r){this.framebuffer.resize(t*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Ue extends Jr{constructor(t){const r=t,n=r.naturalWidth||r.videoWidth||r.width,i=r.naturalHeight||r.videoHeight||r.height;super(n,i),this.source=t,this.noSubImage=!1}static crossOrigin(t,r,n){n===void 0&&!r.startsWith("data:")?t.crossOrigin=Dd(r):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")}upload(t,r,n,i){const s=t.gl,a=r.realWidth,o=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1&&i.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Me.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&n.width===a&&n.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=a,n.height=o,s.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const t=this.source,r=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class bl extends Ue{constructor(t,r){if(r=r||{},typeof t=="string"){const n=new Image;Ue.crossOrigin(n,t,r.crossorigin),n.src=t,t=n}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??vt.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(t){return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const s=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.resize(i.width,i.height),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?s():(i.onload=s,i.onerror=a=>{n(a),this.onError.emit(a)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Me.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==n&&o.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class _l{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,r,n){const i=r.width,s=r.height;if(n){const a=t.width/2/i,o=t.height/2/s,l=t.x/i+a,h=t.y/s+o;n=Pt.add(n,Pt.NW),this.x0=l+a*Pt.uX(n),this.y0=h+o*Pt.uY(n),n=Pt.add(n,2),this.x1=l+a*Pt.uX(n),this.y1=h+o*Pt.uY(n),n=Pt.add(n,2),this.x2=l+a*Pt.uX(n),this.y2=h+o*Pt.uY(n),n=Pt.add(n,2),this.x3=l+a*Pt.uX(n),this.y3=h+o*Pt.uY(n)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const xl=new _l;function Kn(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class bt extends _n{constructor(t,r,n,i,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new At(0,0,1,1)),t instanceof bt&&(t=t.baseTexture),this.baseTexture=t,this._frame=r,this.trim=i,this.valid=!1,this._uvs=xl,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new nt(a.x,a.y):new nt(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=r:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:r}=this.baseTexture;r!=null&&r.url&&_e[r.url]&&bt.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,bt.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new bt(this.baseTexture,!this.noFrame&&t,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=t),n}updateUvs(){this._uvs===xl&&(this._uvs=new _l),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,r={},n=vt.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let s=null;if(i)s=t;else if(t instanceof gt){if(!t.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Qr()}`,gt.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Qr()}`}s=t._pixiId}let a=_e[s];if(i&&n&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(t instanceof gt)?(r.resolution||(r.resolution=tl(t)),a=new bt(new gt(t,r)),a.baseTexture.cacheId=s,gt.addToCache(a.baseTexture,s),bt.addToCache(a,s)):!a&&t instanceof gt&&(a=new bt(t),bt.addToCache(a,s)),a}static fromURL(t,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=bt.from(t,Object.assign({resourceOptions:n},r),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then(()=>Promise.resolve(i))}static fromBuffer(t,r,n,i){return new bt(gt.fromBuffer(t,r,n,i))}static fromLoader(t,r,n,i){const s=new gt(t,Object.assign({scaleMode:gt.defaultOptions.scaleMode,resolution:tl(r)},i)),{resource:a}=s;a instanceof bl&&(a.url=r);const o=new bt(s);return n||(n=r),gt.addToCache(o.baseTexture,n),bt.addToCache(o,n),n!==r&&(gt.addToCache(o.baseTexture,r),bt.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(l=>{o.baseTexture.once("loaded",()=>l(o))})}static addToCache(t,r){r&&(t.textureCacheIds.includes(r)||t.textureCacheIds.push(r),_e[r]&&_e[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),_e[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=_e[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete _e[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)_e[t.textureCacheIds[r]]===t&&delete _e[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:r,y:n,width:i,height:s}=t,a=r+i>this.baseTexture.width,o=n+s>this.baseTexture.height;if(a||o){const l=a&&o?"and":"or",h=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,c=`Y: ${n} + ${s} = ${n+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${h} ${l} ${c}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return bt._EMPTY||(bt._EMPTY=new bt(new gt),Kn(bt._EMPTY),Kn(bt._EMPTY.baseTexture)),bt._EMPTY}static get WHITE(){if(!bt._WHITE){const t=vt.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),bt._WHITE=new bt(gt.from(t)),Kn(bt._WHITE),Kn(bt._WHITE.baseTexture)}return bt._WHITE}}class Zn extends bt{constructor(t,r){super(t,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,r,n=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,a=Math.round(r*i)/i;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(t){const{baseTexture:r}=this;r.resolution!==t&&(r.setResolution(t),this.resize(r.width,r.height,!1))}static create(t){return new Zn(new gl(t))}}class wl{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,r,n=Dt.NONE){const i=new gl(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new Zn(i)}getOptimalTexture(t,r,n=1,i=Dt.NONE){let s;t=Math.ceil(t*n-1e-6),r=Math.ceil(r*n-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||r!==this._pixelsHeight?(t=Fn(t),r=Fn(r),s=((t&65535)<<16|r&65535)>>>0,i>1&&(s+=i*4294967296)):s=i>1?-i:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(t,r,i)),a.filterPoolKey=s,a.setResolution(n),a}getFilterTexture(t,r,n){const i=this.getOptimalTexture(t.width,t.height,r||t.resolution,n||Dt.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const r=t.filterPoolKey;t.filterFrame=null,this.texturePool[r].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}wl.SCREEN_KEY=-1;class bp extends wr{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class _p extends wr{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Yt(this.vertices),this.uvBuffer=new Yt(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/t.width,this.uvs[3]=i,this.uvs[4]=n+r.width/t.width,this.uvs[5]=i+r.height/t.height,this.uvs[6]=n,this.uvs[7]=i+r.height/t.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class xp{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Dt.NONE,this.sourceFrame=new At,this.destinationFrame=new At,this.bindingSourceFrame=new At,this.bindingDestinationFrame=new At,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Qn=[new nt,new nt,new nt,new nt],$s=new Ot;class El{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new wl,this.statePool=[],this.quad=new bp,this.quadUv=new _p,this.tempRect=new At,this.activeState={},this.globalUniforms=new ae({outputFrame:new At,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,r){const n=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new xp,a=this.renderer.renderTexture;let o=r[0].resolution,l=r[0].multisample,h=r[0].padding,c=r[0].autoFit,f=r[0].legacy??!0;for(let p=1;p<r.length;p++){const v=r[p];o=Math.min(o,v.resolution),l=Math.min(l,v.multisample),h=this.useMaxPadding?Math.max(h,v.padding):h+v.padding,c=c&&v.autoFit,f=f||(v.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),i.push(s),s.resolution=o,s.multisample=l,s.legacy=f,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(h);const u=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB($s.copyFrom(n.projection.transform).invert(),u),c?(s.sourceFrame.fit(u),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(u)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,l),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const d=this.tempRect;d.x=0,d.y=0,d.width=s.sourceFrame.width,d.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,d),n.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,r=t.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const s=i.inputSize,a=i.inputPixel,o=i.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const h=i.filterArea;h[0]=r.destinationFrame.width,h[1]=r.destinationFrame.height,h[2]=r.sourceFrame.x,h[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const l=t[t.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,l.renderTexture,He.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let h=r.renderTexture,c=this.getOptimalFilterTexture(h.width,h.height,r.resolution);c.filterFrame=h.filterFrame;let f=0;for(f=0;f<n.length-1;++f){f===1&&r.multisample>1&&(c=this.getOptimalFilterTexture(h.width,h.height,r.resolution),c.filterFrame=h.filterFrame),n[f].apply(this,h,c,He.CLEAR,r);const u=h;h=c,c=u}n[f].apply(this,h,l.renderTexture,He.BLEND,r),f>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)}bindAndClear(t,r=He.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t!=null&&t.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,n.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=i.stateId&1||this.forceClear;(r===He.CLEAR||r===He.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,r,n,i){const s=this.renderer;s.state.set(t.state),this.bindAndClear(n,i),t.uniforms.uSampler=r,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Pe.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Pe.TRIANGLE_STRIP))}calculateSpriteMatrix(t,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:s}=r._texture,a=t.set(i.width,0,0,i.height,n.x,n.y),o=r.worldTransform.copyTo(Ot.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,r,n=1,i=Dt.NONE){return this.texturePool.getOptimalTexture(t,r,n,i)}getFilterTexture(t,r,n){if(typeof t=="number"){const s=t;t=r,r=s}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,r||t.resolution,n||Dt.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,r){const n=Qn[0],i=Qn[1],s=Qn[2],a=Qn[3];n.set(r.left,r.top),i.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),t.apply(n,n),t.apply(i,i),t.apply(s,s),t.apply(a,a);const o=Math.min(n.x,i.x,s.x,a.x),l=Math.min(n.y,i.y,s.y,a.y),h=Math.max(n.x,i.x,s.x,a.x),c=Math.max(n.y,i.y,s.y,a.y);r.x=o,r.y=l,r.width=h-o,r.height=c-l}roundFrame(t,r,n,i,s){if(!(t.width<=0||t.height<=0||n.width<=0||n.height<=0)){if(s){const{a,b:o,c:l,d:h}=s;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}s=s?$s.copyFrom(s):$s.identity(),s.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(r),this.transformAABB(s.invert(),t)}}}El.extension={type:pt.RendererSystem,name:"filter"},wt.add(El);class wp{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Dt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Ep=new At;class Tl{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Gs(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new At,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;vt.PREFER_ENV===$e.WEBGL_LEGACY&&(r=null,n=null),r?t.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,t.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,r,n=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==n&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=n),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,n)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let a=0;a<t.colorTextures.length;a++){const o=t.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),r){const a=r.width>>n,o=r.height>>n,l=a/r.width;this.setViewport(r.x*l,r.y*l,a,o)}else{const a=t.width>>n,o=t.height>>n;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,r,n,i){const s=this.viewport;t=Math.round(t),r=Math.round(r),n=Math.round(n),i=Math.round(i),(s.width!==n||s.height!==i||s.x!==t||s.y!==r)&&(s.x=t,s.y=r,s.width=n,s.height=i,this.gl.viewport(t,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,r,n,i,s=Di.COLOR|Di.DEPTH){const{gl:a}=this;a.clearColor(t,r,n,i),a.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new wp(r.createFramebuffer());return n.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(t),t.disposeRunner.add(this),n}resizeFramebuffer(t){const{gl:r}=this,n=t.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height));const i=t.colorTextures;let s=i.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=i[a],l=o.parentTextureArray||o;this.renderer.texture.bind(l,0),a===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,l._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,r){const{gl:n}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let a=s.length;n.drawBuffers||(a=Math.min(a,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let l=0;l<a;l++){const h=s[l],c=h.parentTextureArray||h;this.renderer.texture.bind(c,0),l===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+l,h.target,c._glTextures[this.CONTEXT_UID].texture,r),o.push(n.COLOR_ATTACHMENT0+l))}if(o.length>1&&n.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,r)}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:r}=this;let n=Dt.NONE;if(t<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=t){n=r[i];break}return n===1&&(n=Dt.NONE),n}blit(t,r,n){const{current:i,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!i)return;const l=i.glFramebuffers[o];if(!l)return;if(!t){if(!l.msaaBuffer)return;const c=i.colorTextures[0];if(!c)return;l.blitFramebuffer||(l.blitFramebuffer=new Gs(i.width,i.height),l.blitFramebuffer.addColorTexture(0,c)),t=l.blitFramebuffer,t.colorTextures[0]!==c&&(t.colorTextures[0]=c,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}r||(r=Ep,r.width=i.width,r.height=i.height),n||(n=r);const h=r.width===n.width&&r.height===n.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,l.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,a.COLOR_BUFFER_BIT,h?a.NEAREST:a.LINEAR)}disposeFramebuffer(t,r){const n=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(t){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],t)}forceStencil(){const t=this.current;if(!t)return;const r=t.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;t.stencil=!0;const n=t.width,i=t.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,n,i):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,n,i),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new At}destroy(){this.renderer=null}}Tl.extension={type:pt.RendererSystem,name:"framebuffer"},wt.add(Tl);const qs={5126:4,5123:2,5121:1};class Al{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;vt.PREFER_ENV===$e.WEBGL_LEGACY&&(n=null),n?(t.createVertexArray=()=>n.createVertexArrayOES(),t.bindVertexArray=i=>n.bindVertexArrayOES(i),t.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=t.getExtension("ANGLE_instanced_arrays");n?(t.vertexAttribDivisor=(i,s)=>n.vertexAttribDivisorANGLE(i,s),t.drawElementsInstanced=(i,s,a,o,l)=>n.drawElementsInstancedANGLE(i,s,a,o,l),t.drawArraysInstanced=(i,s,a,o)=>n.drawArraysInstancedANGLE(i,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(t,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const a=i[r.program.id]||this.initGeometryVao(t,r,s);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?n.bindVertexArray(a):this.activateVao(t,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<t.buffers.length;n++){const i=t.buffers[n];r.update(i)}}checkCompatibility(t,r){const n=t.attributes,i=r.attributeData;for(const s in i)if(!n[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(t,r){const n=t.attributes,i=r.attributeData,s=["g",t.id];for(const a in n)i[a]&&s.push(a,i[a].location);return s.join("-")}initGeometryVao(t,r,n=!0){const i=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(t,o);const l=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID];let c=h[l];if(c)return h[o.id]=c,c;const f=t.buffers,u=t.attributes,d={},p={};for(const v in f)d[v]=0,p[v]=0;for(const v in u)!u[v].size&&o.attributeData[v]?u[v].size=o.attributeData[v].size:u[v].size||console.warn(`PIXI Geometry attribute '${v}' size cannot be determined (likely the bound shader does not have the attribute)`),d[u[v].buffer]+=u[v].size*qs[u[v].type];for(const v in u){const g=u[v],y=g.size;g.stride===void 0&&(d[g.buffer]===y*qs[g.type]?g.stride=0:g.stride=d[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=y*qs[g.type])}c=i.createVertexArray(),i.bindVertexArray(c);for(let v=0;v<f.length;v++){const g=f[v];a.bind(g),n&&g._glBuffers[s].refCount++}return this.activateVao(t,o),h[o.id]=c,h[l]=c,i.bindVertexArray(null),a.unbind(ve.ARRAY_BUFFER),c}disposeGeometry(t,r){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const n=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(t.disposeRunner.remove(this),!!n){if(a)for(let l=0;l<s.length;l++){const h=s[l]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(s[l],r))}if(!r){for(const l in n)if(l[0]==="g"){const h=n[l];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],t)}activateVao(t,r){const n=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,a=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let l=null;for(const h in o){const c=o[h],f=a[c.buffer],u=f._glBuffers[i];if(r.attributeData[h]){l!==u&&(s.bind(f),l=u);const d=r.attributeData[h].location;if(n.enableVertexAttribArray(d),n.vertexAttribPointer(d,c.size,c.type||n.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)n.vertexAttribDivisor(d,c.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,r,n,i){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,l=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(t,r||a.indexBuffer.data.length,l,(n||0)*o,i||1):s.drawElements(t,r||a.indexBuffer.data.length,l,(n||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(t,n,r||a.getSize(),i||1):s.drawArrays(t,n,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Al.extension={type:pt.RendererSystem,name:"geometry"},wt.add(Al);const Sl=new Ot;class Tp{constructor(t,r){this._texture=t,this.mapCoord=new Ot,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,r){r===void 0&&(r=t);const n=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],a=t[i+1];r[i]=s*n.a+a*n.c+n.tx,r[i+1]=s*n.b+a*n.d+n.ty}return r}update(t){const r=this._texture;if(!r||!r.valid||!t&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,s=r.trim;s&&(Sl.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Sl));const a=r.baseTexture,o=this.uClampFrame,l=this.clampMargin/a.resolution,h=this.clampOffset;return o[0]=(r._frame.x+l+h)/a.width,o[1]=(r._frame.y+l+h)/a.height,o[2]=(r._frame.x+r._frame.width-l+h)/a.width,o[3]=(r._frame.y+r._frame.height-l+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var Ap=`varying vec2 vMaskCoord;
387
387
  varying vec2 vTextureCoord;
388
388
 
389
389
  uniform sampler2D uSampler;
@@ -408,7 +408,7 @@ void main(void)
408
408
 
409
409
  gl_FragColor = original;
410
410
  }
411
- `,Vx=`attribute vec2 aVertexPosition;
411
+ `,Sp=`attribute vec2 aVertexPosition;
412
412
  attribute vec2 aTextureCoord;
413
413
 
414
414
  uniform mat3 projectionMatrix;
@@ -424,7 +424,7 @@ void main(void)
424
424
  vTextureCoord = aTextureCoord;
425
425
  vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
426
426
  }
427
- `;class Wx extends wn{constructor(t,r,n){let i=null;typeof t!="string"&&r===void 0&&n===void 0&&(i=t,t=void 0,r=void 0,n=void 0),super(t||Vx,r||qx,n),this.maskSprite=i,this.maskMatrix=new ee}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,r,n,i){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new Ec(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,r,n,i))}}class Xx{constructor(t=null){this.type=Ce.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=wn.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ce.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class tm{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,r){let n=r;if(!n.isMaskData){const s=this.maskDataPool.pop()||new Xx;s.pooled=!0,s.maskObject=r,n=s}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=t,n.type!==Ce.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ce.SCISSOR:this.renderer.scissor.push(n);break;case Ce.STENCIL:this.renderer.stencil.push(n);break;case Ce.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ce.COLOR:this.pushColorMask(n);break}n.type===Ce.SPRITE&&this.maskStack.push(n)}pop(t){const r=this.maskStack.pop();if(!(!r||r._target!==t)){if(r.enabled)switch(r.type){case Ce.SCISSOR:this.renderer.scissor.pop(r);break;case Ce.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ce.SPRITE:this.popSpriteMask(r);break;case Ce.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===Ce.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(t){const r=t.maskObject;r?r.isSprite?t.type=Ce.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Ce.SCISSOR:t.type=Ce.STENCIL:t.type=Ce.COLOR}pushSpriteMask(t){const{maskObject:r}=t,n=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Wx]));const s=this.renderer,a=s.renderTexture;let o,c;if(a.current){const d=a.current;o=t.resolution||d.resolution,c=t.multisample??d.multisample}else o=t.resolution||s.resolution,c=t.multisample??s.multisample;i[0].resolution=o,i[0].multisample=c,i[0].maskSprite=r;const h=n.filterArea;n.filterArea=r.getBounds(!0),s.filter.push(n,i),n.filterArea=h,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const r=t._colorMask,n=t._colorMask=r&t.colorMask;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}popColorMask(t){const r=t._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}destroy(){this.renderer=null}}tm.extension={type:Et.RendererSystem,name:"mask"},Bt.add(tm);class em{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const rm=new ee,nm=[],wo=class extends em{constructor(e){super(e),this.glConst=Pt.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:r}=e,{renderer:n}=this,i=n.renderTexture,s=r.getBounds(!0,nm.pop()??new Vt);this.roundFrameToPixels(s,i.current?i.current.resolution:n.resolution,i.sourceFrame,i.destinationFrame,n.projection.transform),t&&s.fit(t),e._scissorRectLocal=s}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:r,c:n,d:i}=e;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||wo.isMatrixRotated(t.worldTransform)||wo.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const r=e._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(e,t,r,n,i){wo.isMatrixRotated(i)||(i=i?rm.copyFrom(i):rm.identity(),i.translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(i,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&nm.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};let im=wo;im.extension={type:Et.RendererSystem,name:"scissor"},Bt.add(im);class sm extends em{constructor(t){super(t),this.glConst=Pt.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const r=t.maskObject,{gl:n}=this.renderer,i=t._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;s!==0&&(t._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(t._colorMask=s,n.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(t){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}sm.extension={type:Et.RendererSystem,name:"stencil"},Bt.add(sm);class am{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Kt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return Kt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return Kt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const r in t)this.plugins[r]=new t[r](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}am.extension={type:[Et.RendererSystem,Et.CanvasRendererSystem],name:"_plugin"},Bt.add(am);class om{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ee,this.transform=null}update(t,r,n,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,r,n,i){const s=this.projectionMatrix,a=i?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(t){}destroy(){this.renderer=null}}om.extension={type:Et.RendererSystem,name:"projection"},Bt.add(om);const Yx=new Ws;class lm{constructor(t){this.renderer=t,this._tempMatrix=new ee}generateTexture(t,r){const{region:n,...i}=r||{},s=n||t.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=bo.create({width:s.width,height:s.height,...i});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=t.transform;return t.transform=Yx,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}lm.extension={type:[Et.RendererSystem,Et.CanvasRendererSystem],name:"textureGenerator"},Bt.add(lm);const mi=new Vt,Ks=new Vt;class um{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Vt,this.destinationFrame=new Vt,this.viewportFrame=new Vt}bind(t=null,r,n){const i=this.renderer;this.current=t;let s,a,o;t?(s=t.baseTexture,o=s.resolution,r||(mi.width=t.frame.width,mi.height=t.frame.height,r=mi),n||(Ks.x=t.frame.x,Ks.y=t.frame.y,Ks.width=r.width,Ks.height=r.height,n=Ks),a=s.framebuffer):(o=i.resolution,r||(mi.width=i._view.screen.width,mi.height=i._view.screen.height,r=mi),n||(n=mi,n.width=r.width,n.height=r.height));const c=this.viewportFrame;c.x=n.x*o,c.y=n.y*o,c.width=n.width*o,c.height=n.height*o,t||(c.y=i.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(a,c),this.renderer.projection.update(n,r,o,!a),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(t,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=t?ae.shared.setValue(t):n,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:c,y:h,width:d,height:p}=this.viewportFrame;c=Math.round(c),h=Math.round(h),d=Math.round(d),p=Math.round(p),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(c,h,d,p)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}um.extension={type:Et.RendererSystem,name:"renderTexture"},Bt.add(um);class Kx{constructor(t,r){this.program=t,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Zx(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=t.getActiveAttrib(e,i);if(s.name.startsWith("gl_"))continue;const a=jp(t,s.type),o={type:a,name:s.name,size:Dp(a),location:t.getAttribLocation(e,s.name)};r[s.name]=o}return r}function Qx(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const s=t.getActiveUniform(e,i),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),c=jp(t,s.type);r[a]={name:a,index:i,type:c,size:s.size,isArray:o,value:Lp(c,s.size)}}return r}function Jx(e,t){var c;const r=Mp(e,e.VERTEX_SHADER,t.vertexSrc),n=Mp(e,e.FRAGMENT_SHADER,t.fragmentSrc),i=e.createProgram();e.attachShader(i,r),e.attachShader(i,n);const s=(c=t.extra)==null?void 0:c.transformFeedbackVaryings;if(s&&(typeof e.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):e.transformFeedbackVaryings(i,s.names,s.bufferMode==="separate"?e.SEPARATE_ATTRIBS:e.INTERLEAVED_ATTRIBS)),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||Ox(e,i,r,n),t.attributeData=Zx(i,e),t.uniformData=Qx(i,e),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){const h=Object.keys(t.attributeData);h.sort((d,p)=>d>p?1:-1);for(let d=0;d<h.length;d++)t.attributeData[h[d]].location=d,e.bindAttribLocation(i,d,h[d]);e.linkProgram(i)}e.deleteShader(r),e.deleteShader(n);const a={};for(const h in t.uniformData){const d=t.uniformData[h];a[h]={location:e.getUniformLocation(i,h),value:Lp(d.type,d.size)}}return new Kx(i,a)}function tw(e,t,r,n,i){r.buffer.update(i)}const ew={float:`
427
+ `;class Op extends Oe{constructor(t,r,n){let i=null;typeof t!="string"&&r===void 0&&n===void 0&&(i=t,t=void 0,r=void 0,n=void 0),super(t||Sp,r||Ap,n),this.maskSprite=i,this.maskMatrix=new Ot}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,r,n,i){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new Tp(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,r,n,i))}}class Rp{constructor(t=null){this.type=Ut.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Oe.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ut.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class Ol{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,r){let n=r;if(!n.isMaskData){const s=this.maskDataPool.pop()||new Rp;s.pooled=!0,s.maskObject=r,n=s}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=t,n.type!==Ut.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ut.SCISSOR:this.renderer.scissor.push(n);break;case Ut.STENCIL:this.renderer.stencil.push(n);break;case Ut.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ut.COLOR:this.pushColorMask(n);break}n.type===Ut.SPRITE&&this.maskStack.push(n)}pop(t){const r=this.maskStack.pop();if(!(!r||r._target!==t)){if(r.enabled)switch(r.type){case Ut.SCISSOR:this.renderer.scissor.pop(r);break;case Ut.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ut.SPRITE:this.popSpriteMask(r);break;case Ut.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===Ut.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(t){const r=t.maskObject;r?r.isSprite?t.type=Ut.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Ut.SCISSOR:t.type=Ut.STENCIL:t.type=Ut.COLOR}pushSpriteMask(t){const{maskObject:r}=t,n=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Op]));const s=this.renderer,a=s.renderTexture;let o,l;if(a.current){const c=a.current;o=t.resolution||c.resolution,l=t.multisample??c.multisample}else o=t.resolution||s.resolution,l=t.multisample??s.multisample;i[0].resolution=o,i[0].multisample=l,i[0].maskSprite=r;const h=n.filterArea;n.filterArea=r.getBounds(!0),s.filter.push(n,i),n.filterArea=h,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const r=t._colorMask,n=t._colorMask=r&t.colorMask;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}popColorMask(t){const r=t._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}destroy(){this.renderer=null}}Ol.extension={type:pt.RendererSystem,name:"mask"},wt.add(Ol);class Rl{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Il=new Ot,Nl=[],Jn=class extends Rl{constructor(e){super(e),this.glConst=vt.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:r}=e,{renderer:n}=this,i=n.renderTexture,s=r.getBounds(!0,Nl.pop()??new At);this.roundFrameToPixels(s,i.current?i.current.resolution:n.resolution,i.sourceFrame,i.destinationFrame,n.projection.transform),t&&s.fit(t),e._scissorRectLocal=s}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:r,c:n,d:i}=e;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Jn.isMatrixRotated(t.worldTransform)||Jn.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const r=e._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(e,t,r,n,i){Jn.isMatrixRotated(i)||(i=i?Il.copyFrom(i):Il.identity(),i.translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(i,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&Nl.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};let Cl=Jn;Cl.extension={type:pt.RendererSystem,name:"scissor"},wt.add(Cl);class kl extends Rl{constructor(t){super(t),this.glConst=vt.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const r=t.maskObject,{gl:n}=this.renderer,i=t._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;s!==0&&(t._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(t._colorMask=s,n.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(t){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}kl.extension={type:pt.RendererSystem,name:"stencil"},wt.add(kl);class Pl{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return xt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return xt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return xt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const r in t)this.plugins[r]=new t[r](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Pl.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"_plugin"},wt.add(Pl);class Ml{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ot,this.transform=null}update(t,r,n,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,r,n,i){const s=this.projectionMatrix,a=i?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Ml.extension={type:pt.RendererSystem,name:"projection"},wt.add(Ml);const Ip=new Hn;class Ll{constructor(t){this.renderer=t,this._tempMatrix=new Ot}generateTexture(t,r){const{region:n,...i}=r||{},s=n||t.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=Zn.create({width:s.width,height:s.height,...i});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=t.transform;return t.transform=Ip,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}Ll.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"textureGenerator"},wt.add(Ll);const tr=new At,sn=new At;class Fl{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new At,this.destinationFrame=new At,this.viewportFrame=new At}bind(t=null,r,n){const i=this.renderer;this.current=t;let s,a,o;t?(s=t.baseTexture,o=s.resolution,r||(tr.width=t.frame.width,tr.height=t.frame.height,r=tr),n||(sn.x=t.frame.x,sn.y=t.frame.y,sn.width=r.width,sn.height=r.height,n=sn),a=s.framebuffer):(o=i.resolution,r||(tr.width=i._view.screen.width,tr.height=i._view.screen.height,r=tr),n||(n=tr,n.width=r.width,n.height=r.height));const l=this.viewportFrame;l.x=n.x*o,l.y=n.y*o,l.width=n.width*o,l.height=n.height*o,t||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(a,l),this.renderer.projection.update(n,r,o,!a),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(t,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=t?Wt.shared.setValue(t):n,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:l,y:h,width:c,height:f}=this.viewportFrame;l=Math.round(l),h=Math.round(h),c=Math.round(c),f=Math.round(f),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,h,c,f)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Fl.extension={type:pt.RendererSystem,name:"renderTexture"},wt.add(Fl);class Np{constructor(t,r){this.program=t,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Cp(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=t.getActiveAttrib(e,i);if(s.name.startsWith("gl_"))continue;const a=dl(t,s.type),o={type:a,name:s.name,size:cl(a),location:t.getAttribLocation(e,s.name)};r[s.name]=o}return r}function kp(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const s=t.getActiveUniform(e,i),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),l=dl(t,s.type);r[a]={name:a,index:i,type:l,size:s.size,isArray:o,value:ll(l,s.size)}}return r}function Pp(e,t){var l;const r=ol(e,e.VERTEX_SHADER,t.vertexSrc),n=ol(e,e.FRAGMENT_SHADER,t.fragmentSrc),i=e.createProgram();e.attachShader(i,r),e.attachShader(i,n);const s=(l=t.extra)==null?void 0:l.transformFeedbackVaryings;if(s&&(typeof e.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):e.transformFeedbackVaryings(i,s.names,s.bufferMode==="separate"?e.SEPARATE_ATTRIBS:e.INTERLEAVED_ATTRIBS)),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||ap(e,i,r,n),t.attributeData=Cp(i,e),t.uniformData=kp(i,e),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){const h=Object.keys(t.attributeData);h.sort((c,f)=>c>f?1:-1);for(let c=0;c<h.length;c++)t.attributeData[h[c]].location=c,e.bindAttribLocation(i,c,h[c]);e.linkProgram(i)}e.deleteShader(r),e.deleteShader(n);const a={};for(const h in t.uniformData){const c=t.uniformData[h];a[h]={location:e.getUniformLocation(i,h),value:ll(c.type,c.size)}}return new Np(i,a)}function Mp(e,t,r,n,i){r.buffer.update(i)}const Lp={float:`
428
428
  data[offset] = v;
429
429
  `,vec2:`
430
430
  data[offset] = v[0];
@@ -462,7 +462,7 @@ void main(void)
462
462
  {
463
463
  data[offset + i] = v[i];
464
464
  }
465
- `},cm={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function rw(e){const t=e.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,n=0,i=0;for(let s=0;s<t.length;s++){const a=t[s];if(r=cm[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!==0&&n<16){const o=n%r%16;n+=o,i+=o}n+r>16?(i=Math.ceil(i/16)*16,a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function nw(e,t){const r=[];for(const n in e)t[n]&&r.push(t[n]);return r.sort((n,i)=>n.index-i.index),r}function iw(e,t){if(!e.autoManage)return{size:0,syncFunc:tw};const r=nw(e.uniforms,t),{uboElements:n,size:i}=rw(r),s=[`
465
+ `},Bl={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Fp(e){const t=e.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,n=0,i=0;for(let s=0;s<t.length;s++){const a=t[s];if(r=Bl[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!==0&&n<16){const o=n%r%16;n+=o,i+=o}n+r>16?(i=Math.ceil(i/16)*16,a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function Bp(e,t){const r=[];for(const n in e)t[n]&&r.push(t[n]);return r.sort((n,i)=>n.index-i.index),r}function Dp(e,t){if(!e.autoManage)return{size:0,syncFunc:Mp};const r=Bp(e.uniforms,t),{uboElements:n,size:i}=Fp(r),s=[`
466
466
  var v = null;
467
467
  var v2 = null;
468
468
  var cv = null;
@@ -470,335 +470,31 @@ void main(void)
470
470
  var gl = renderer.gl
471
471
  var index = 0;
472
472
  var data = buffer.data;
473
- `];for(let a=0;a<n.length;a++){const o=n[a],c=e.uniforms[o.data.name],h=o.data.name;let d=!1;for(let p=0;p<Yi.length;p++){const f=Yi[p];if(f.codeUbo&&f.test(o.data,c)){s.push(`offset = ${o.offset/4};`,Yi[p].codeUbo(o.data.name,c)),d=!0;break}}if(!d)if(o.data.size>1){const p=Dp(o.data.type),f=Math.max(cm[o.data.type]/16,1),m=p/f,g=(4-m%4)%4;s.push(`
473
+ `];for(let a=0;a<n.length;a++){const o=n[a],l=e.uniforms[o.data.name],h=o.data.name;let c=!1;for(let f=0;f<Er.length;f++){const u=Er[f];if(u.codeUbo&&u.test(o.data,l)){s.push(`offset = ${o.offset/4};`,Er[f].codeUbo(o.data.name,l)),c=!0;break}}if(!c)if(o.data.size>1){const f=cl(o.data.type),u=Math.max(Bl[o.data.type]/16,1),d=f/u,p=(4-d%4)%4;s.push(`
474
474
  cv = ud.${h}.value;
475
475
  v = uv.${h};
476
476
  offset = ${o.offset/4};
477
477
 
478
478
  t = 0;
479
479
 
480
- for(var i=0; i < ${o.data.size*f}; i++)
480
+ for(var i=0; i < ${o.data.size*u}; i++)
481
481
  {
482
- for(var j = 0; j < ${m}; j++)
482
+ for(var j = 0; j < ${d}; j++)
483
483
  {
484
484
  data[offset++] = v[t++];
485
485
  }
486
- offset += ${g};
486
+ offset += ${p};
487
487
  }
488
488
 
489
- `)}else{const p=ew[o.data.type];s.push(`
489
+ `)}else{const f=Lp[o.data.type];s.push(`
490
490
  cv = ud.${h}.value;
491
491
  v = uv.${h};
492
492
  offset = ${o.offset/4};
493
- ${p};
493
+ ${f};
494
494
  `)}}return s.push(`
495
495
  renderer.buffer.update(buffer);
496
496
  `),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
497
- `))}}let sw=0;const So={textureCount:0,uboCount:0};class hm{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=sw++}systemCheck(){if(!Ix())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,r){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const n=t.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(So.textureCount=0,So.uboCount=0,this.syncUniformGroup(t.uniformGroup,So)),i}setUniforms(t){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,t,this.renderer)}syncUniformGroup(t,r){const n=this.getGlProgram();(!t.static||t.dirtyId!==n.uniformDirtyGroups[t.id])&&(n.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,n,r))}syncUniforms(t,r,n){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(r.uniformData,t.uniforms,this.renderer,n)}createSyncGroups(t){const r=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=Ex(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[r],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,r){const n=this.getGlProgram();if(!t.static||t.dirtyId!==0||!n.uniformGroups[t.id]){t.dirtyId=0;const i=n.uniformGroups[t.id]||this.createSyncBufferGroup(t,n,r);t.buffer.update(),i(n.uniformData,t.uniforms,this.renderer,So,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(t,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=iw(t,this.shader.program.uniformData)),t.autoManage){const c=new Float32Array(o.size/4);t.buffer.update(c)}return r.uniformGroups[t.id]=o.syncFunc,r.uniformGroups[t.id]}getSignature(t,r,n){const i=t.uniforms,s=[`${n}-`];for(const a in i)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const r=this.gl,n=t.program,i=Jx(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}hm.extension={type:Et.RendererSystem,name:"shader"},Bt.add(hm);class To{constructor(t){this.renderer=t}run(t){const{renderer:r}=this;r.runners.init.emit(r.options),t.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}To.defaultOptions={hello:!1},To.extension={type:[Et.RendererSystem,Et.CanvasRendererSystem],name:"startup"},Bt.add(To);function aw(e,t=[]){return t[Lt.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.ADD]=[e.ONE,e.ONE],t[Lt.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.NONE]=[0,0],t[Lt.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[Lt.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[Lt.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[Lt.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[Lt.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[Lt.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[Lt.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[Lt.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[Lt.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[Lt.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[Lt.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const ow=0,lw=1,uw=2,cw=3,hw=4,fw=5,Ac=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Lt.NONE,this._blendEq=!1,this.map=[],this.map[ow]=this.setBlend,this.map[lw]=this.setOffset,this.map[uw]=this.setCullFace,this.map[cw]=this.setDepthTest,this.map[hw]=this.setFrontFace,this.map[fw]=this.setDepthMask,this.checks=[],this.defaultState=new ci,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=aw(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,r=0;for(;t;)t&1&&this.map[r].call(this,!!(e.data&1<<r)),t=t>>1,r++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e=e||this.defaultState;for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(e){this.updateCheck(Ac.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Ac.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;const t=this.blendModes[e],r=this.gl;t.length===2?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,t){const r=this.checks.indexOf(e);t&&r===-1?this.checks.push(e):!t&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null}};let fm=Ac;fm.extension={type:Et.RendererSystem,name:"state"},Bt.add(fm);class dw extends _n{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const r=(t.priority??[]).filter(i=>t.systems[i]),n=[...r,...Object.keys(t.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(t.systems[i],i)}addRunners(...t){t.forEach(r=>{this.runners[r]=new Ir(r)})}addSystem(t,r){const n=new t(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(t,r){const n=Object.keys(this._systemsHash);t.items.forEach(i=>{const s=n.find(a=>this._systemsHash[a]===i);i[t.name](r[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const Eo=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Eo.defaultMaxIdle,this.checkCountMax=Eo.defaultCheckCountMax,this.mode=Eo.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==bu.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let r=!1;for(let n=0;n<t.length;n++){const i=t[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){let n=0;for(let i=0;i<t.length;i++)t[i]!==null&&(t[n++]=t[i]);t.length=n}}unload(e){const t=this.renderer.texture,r=e._texture;r&&!r.framebuffer&&t.destroyTexture(r);for(let n=e.children.length-1;n>=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};let Lr=Eo;Lr.defaultMode=bu.AUTO,Lr.defaultMaxIdle=60*60,Lr.defaultCheckCountMax=60*10,Lr.extension={type:Et.RendererSystem,name:"textureGC"},Bt.add(Lr);class Cc{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ut.UNSIGNED_BYTE,this.internalFormat=wt.RGBA,this.samplerType=0}}function pw(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[Ut.UNSIGNED_BYTE]:{[wt.RGBA]:e.RGBA8,[wt.RGB]:e.RGB8,[wt.RG]:e.RG8,[wt.RED]:e.R8,[wt.RGBA_INTEGER]:e.RGBA8UI,[wt.RGB_INTEGER]:e.RGB8UI,[wt.RG_INTEGER]:e.RG8UI,[wt.RED_INTEGER]:e.R8UI,[wt.ALPHA]:e.ALPHA,[wt.LUMINANCE]:e.LUMINANCE,[wt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[Ut.BYTE]:{[wt.RGBA]:e.RGBA8_SNORM,[wt.RGB]:e.RGB8_SNORM,[wt.RG]:e.RG8_SNORM,[wt.RED]:e.R8_SNORM,[wt.RGBA_INTEGER]:e.RGBA8I,[wt.RGB_INTEGER]:e.RGB8I,[wt.RG_INTEGER]:e.RG8I,[wt.RED_INTEGER]:e.R8I},[Ut.UNSIGNED_SHORT]:{[wt.RGBA_INTEGER]:e.RGBA16UI,[wt.RGB_INTEGER]:e.RGB16UI,[wt.RG_INTEGER]:e.RG16UI,[wt.RED_INTEGER]:e.R16UI,[wt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[Ut.SHORT]:{[wt.RGBA_INTEGER]:e.RGBA16I,[wt.RGB_INTEGER]:e.RGB16I,[wt.RG_INTEGER]:e.RG16I,[wt.RED_INTEGER]:e.R16I},[Ut.UNSIGNED_INT]:{[wt.RGBA_INTEGER]:e.RGBA32UI,[wt.RGB_INTEGER]:e.RGB32UI,[wt.RG_INTEGER]:e.RG32UI,[wt.RED_INTEGER]:e.R32UI,[wt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[Ut.INT]:{[wt.RGBA_INTEGER]:e.RGBA32I,[wt.RGB_INTEGER]:e.RGB32I,[wt.RG_INTEGER]:e.RG32I,[wt.RED_INTEGER]:e.R32I},[Ut.FLOAT]:{[wt.RGBA]:e.RGBA32F,[wt.RGB]:e.RGB32F,[wt.RG]:e.RG32F,[wt.RED]:e.R32F,[wt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[Ut.HALF_FLOAT]:{[wt.RGBA]:e.RGBA16F,[wt.RGB]:e.RGB16F,[wt.RG]:e.RG16F,[wt.RED]:e.R16F},[Ut.UNSIGNED_SHORT_5_6_5]:{[wt.RGB]:e.RGB565},[Ut.UNSIGNED_SHORT_4_4_4_4]:{[wt.RGBA]:e.RGBA4},[Ut.UNSIGNED_SHORT_5_5_5_1]:{[wt.RGBA]:e.RGB5_A1},[Ut.UNSIGNED_INT_2_10_10_10_REV]:{[wt.RGBA]:e.RGB10_A2,[wt.RGBA_INTEGER]:e.RGB10_A2UI},[Ut.UNSIGNED_INT_10F_11F_11F_REV]:{[wt.RGB]:e.R11F_G11F_B10F},[Ut.UNSIGNED_INT_5_9_9_9_REV]:{[wt.RGB]:e.RGB9_E5},[Ut.UNSIGNED_INT_24_8]:{[wt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[Ut.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[wt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[Ut.UNSIGNED_BYTE]:{[wt.RGBA]:e.RGBA,[wt.RGB]:e.RGB,[wt.ALPHA]:e.ALPHA,[wt.LUMINANCE]:e.LUMINANCE,[wt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[Ut.UNSIGNED_SHORT_5_6_5]:{[wt.RGB]:e.RGB},[Ut.UNSIGNED_SHORT_4_4_4_4]:{[wt.RGBA]:e.RGBA},[Ut.UNSIGNED_SHORT_5_5_5_1]:{[wt.RGBA]:e.RGBA}},t}class dm{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ht,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=pw(t);const r=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new Cc(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Cc(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(t,r=0){const{gl:n}=this;if(t=t==null?void 0:t.castToBaseTexture(),t!=null&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[r]!==t&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[r]=t}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===t&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(t.target,this.emptyTextures[t.target].texture),n[i]=null)}ensureSamplerType(t){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let s=t-1;s>=0;--s){const a=r[s];a&&a._glTextures[i].samplerType!==_u.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const r=new Cc(this.gl.createTexture());return r.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),r}initTextureType(t,r){var n;r.internalFormat=((n=this.internalFormats[t.type])==null?void 0:n[t.format])??t.format,this.webGLVersion===2&&t.type===Ut.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=t.type}updateTexture(t){var i;const r=t._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(t,r),(i=t.resource)!=null&&i.upload(n,t,r))r.samplerType!==_u.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,a=t.realHeight,o=n.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(t.target,0,r.internalFormat,s,a,0,t.format,r.type,null))}t.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(t),r.dirtyId=t.dirtyId}destroyTexture(t,r){const{gl:n}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),n.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(t);i!==-1&&Hs(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===Mn.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=gn.CLAMP:r.wrapMode=t.wrapMode,(n=t.resource)!=null&&n.style(this.renderer,t,r)||this.setStyle(t,r),r.dirtyStyleId=t.dirtyStyleId)}setStyle(t,r){const n=this.gl;if(r.mipmap&&t.mipmap!==Mn.ON_MANUAL&&n.generateMipmap(t.target),n.texParameteri(t.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(t.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===mn.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===mn.LINEAR){const s=Math.min(t.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===mn.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===mn.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}dm.extension={type:Et.RendererSystem,name:"texture"},Bt.add(dm);class pm{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glTransformFeedbacks[n]||this.createGLTransformFeedback(t);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:r,renderer:n,CONTEXT_UID:i}=this,s=r.createTransformFeedback();t._glTransformFeedbacks[i]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];o&&(n.buffer.update(o),o._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,r){const n=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];if(!o)continue;const c=o._glBuffers[this.CONTEXT_UID];c&&(c.refCount--,c.refCount===0&&!r&&s.dispose(o,r))}n&&(r||i.deleteTransformFeedback(n),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}pm.extension={type:Et.RendererSystem,name:"transformFeedback"},Bt.add(pm);class Ao{constructor(t){this.renderer=t}init(t){this.screen=new Vt(0,0,t.width,t.height),this.element=t.view||Pt.ADAPTER.createCanvas(),this.resolution=t.resolution||Pt.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,r){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){var r;t&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Ao.defaultOptions={width:800,height:600,resolution:Pt.RESOLUTION,autoDensity:!1},Ao.extension={type:[Et.RendererSystem,Et.CanvasRendererSystem],name:"_view"},Bt.add(Ao),Pt.PREFER_ENV=ii.WEBGL2,Pt.STRICT_TEXTURE_CACHE=!1,Pt.RENDER_OPTIONS={...vo.defaultOptions,...yo.defaultOptions,...Ao.defaultOptions,...To.defaultOptions},Object.defineProperties(Pt,{WRAP_MODE:{get(){return Ht.defaultOptions.wrapMode},set(e){Kt("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),Ht.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return Ht.defaultOptions.scaleMode},set(e){Kt("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),Ht.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return Ht.defaultOptions.mipmap},set(e){Kt("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),Ht.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return Ht.defaultOptions.anisotropicLevel},set(e){Kt("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),Ht.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return Kt("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),wn.defaultResolution},set(e){wn.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return Kt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),wn.defaultMultisample},set(e){wn.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return Mr.defaultMaxTextures},set(e){Kt("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Mr.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return Mr.defaultBatchSize},set(e){Kt("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Mr.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return Mr.canUploadSameBuffer},set(e){Kt("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Mr.canUploadSameBuffer=e}},GC_MODE:{get(){return Lr.defaultMode},set(e){Kt("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),Lr.defaultMode=e}},GC_MAX_IDLE:{get(){return Lr.defaultMaxIdle},set(e){Kt("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),Lr.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return Lr.defaultCheckCountMax},set(e){Kt("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),Lr.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return kr.defaultVertexPrecision},set(e){Kt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),kr.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return kr.defaultFragmentPrecision},set(e){Kt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),kr.defaultFragmentPrecision=e}}});var Qi=(e=>(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(Qi||{});class Oc{constructor(t,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=r,this.priority=n,this.once=i}match(t,r=null){return this.fn===t&&this.context===r}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=t?null:r,this.previous=null,r}}const sr=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Oc(null,null,1/0),this.deltaMS=1/sr.targetFPMS,this.elapsedMS=1/sr.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,r=Qi.NORMAL){return this._addListener(new Oc(e,t,r))}addOnce(e,t,r=Qi.NORMAL){return this._addListener(new Oc(e,t,r,!0))}_addListener(e){let t=this._head.next,r=this._head;if(!t)e.connect(r);else{for(;t;){if(e.priority>t.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}return this._startIfPossible(),this}remove(e,t){let r=this._head.next;for(;r;)r.match(e,t)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*sr.targetFPMS;const r=this._head;let n=r.next;for(;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,t)/1e3,sr.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!sr._shared){const e=sr._shared=new sr;e.autoStart=!0,e._protected=!0}return sr._shared}static get system(){if(!sr._system){const e=sr._system=new sr;e.autoStart=!0,e._protected=!0}return sr._system}};let me=sr;me.targetFPMS=.06,Object.defineProperties(Pt,{TARGET_FPMS:{get(){return me.targetFPMS},set(e){Kt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),me.targetFPMS=e}}});class mm{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,Qi.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?me.shared:new me,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}mm.extension=Et.Application,Bt.add(mm);const gm=[];Bt.handleByList(Et.Renderer,gm);function mw(e){for(const t of gm)if(t.test(e))return new t(e);throw new Error("Unable to auto-detect a suitable renderer.")}class ym{constructor(t){this.renderer=t}contextChange(t){let r;if(this.renderer.context.webGLVersion===1){const n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else{const n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n)}r>=Ee.HIGH?this.multisample=Ee.HIGH:r>=Ee.MEDIUM?this.multisample=Ee.MEDIUM:r>=Ee.LOW?this.multisample=Ee.LOW:this.multisample=Ee.NONE}destroy(){}}ym.extension={type:Et.RendererSystem,name:"_multisample"},Bt.add(ym);class gw{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class vm{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);r.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:r}=this;r.bindBuffer(t,null)}bindBufferBase(t,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[r]=t,n.bindBufferBase(n.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(t,r,n){const{gl:i,CONTEXT_UID:s}=this;n=n||0;const a=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,a.buffer,n*256,256)}update(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);if(t._updateID!==i.updateID)if(i.updateID=t._updateID,r.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)r.bufferSubData(t.type,0,t.data);else{const s=t.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,r.bufferData(t.type,t.data,s)}}dispose(t,r){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const n=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],t)}createGLBuffer(t){const{CONTEXT_UID:r,gl:n}=this;return t._glBuffers[r]=new gw(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}vm.extension={type:Et.RendererSystem,name:"buffer"},Bt.add(vm);class _m{constructor(t){this.renderer=t}render(t,r){const n=this.renderer;let i,s,a,o;if(r&&(i=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=a,!n.context.isLost){if(i||(this.lastObjectRendered=t),!o){const c=t.enableTempParent();t.updateTransform(),t.disableTempParent(c)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(s??n.background.clearBeforeRender)&&n.renderTexture.clear(),t.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}_m.extension={type:Et.RendererSystem,name:"objectRenderer"},Bt.add(_m);const Pc=class extends dw{constructor(e){super(),this.type=ld.WEBGL,e=Object.assign({},Pt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new Rr({projectionMatrix:new ee},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Pc.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(Kt("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=Pc.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:q1()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Kt("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Kt("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Kt("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Kt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){Kt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return Kt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){Kt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return Kt("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};let Ji=Pc;Ji.extension={type:Et.Renderer,priority:1},Ji.__plugins={},Ji.__systems={},Bt.handleByMap(Et.RendererPlugin,Ji.__plugins),Bt.handleByMap(Et.RendererSystem,Ji.__systems),Bt.add(Ji);class bm extends Vs{constructor(t,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let s=0;s<t;s++){const a=new Ht;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,r){for(let n=0;n<this.length;n++)t[n]&&(t[n].castToBaseTexture?this.addBaseTextureAt(t[n].castToBaseTexture(),n):t[n]instanceof Vs?this.addResourceAt(t[n],n):this.addResourceAt(Pp(t[n],r),n))}dispose(){for(let t=0,r=this.length;t<r;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[r].setResource(t),this}bind(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=t,this.items[r].on("update",t.update,t)}unbind(t){super.unbind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",t.update,t)}load(){if(this._load)return this._load;const r=this.items.map(n=>n.resource).filter(n=>n).map(n=>n.load());return this._load=Promise.all(r).then(()=>{const{realWidth:n,realHeight:i}=this.items[0];return this.resize(n,i),Promise.resolve(this)}),this._load}}class yw extends bm{constructor(t,r){const{width:n,height:i}=r||{};let s,a;Array.isArray(t)?(s=t,a=t.length):a=t,super(a,{width:n,height:i}),s&&this.initFromArray(s,r)}addBaseTextureAt(t,r){if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Ni.TEXTURE_2D_ARRAY}upload(t,r,n){const{length:i,itemDirtyIds:s,items:a}=this,{gl:o}=t;n.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,i,0,r.format,n.type,null);for(let c=0;c<i;c++){const h=a[c];s[c]<h.dirtyId&&(s[c]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,c,h.resource.width,h.resource.height,1,r.format,n.type,h.resource.source))}return!0}}class vw extends jn{constructor(t){super(t)}static test(t){const{OffscreenCanvas:r}=globalThis;return r&&t instanceof r?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const Zs=class extends bm{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==Zs.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let a=0;a<Zs.SIDES;a++)this.items[a].target=Ni.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,e&&this.initFromArray(e,t),i!==!1&&this.load()}bind(e){super.bind(e),e.target=Ni.TEXTURE_CUBE_MAP}addBaseTextureAt(e,t,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[t])throw new Error(`Index ${t} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Ni.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,r){const n=this.itemDirtyIds;for(let i=0;i<Zs.SIDES;i++){const s=this.items[i];(n[i]<s.dirtyId||r.dirtyId<t.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(e,s,r),n[i]=s.dirtyId):n[i]<-1&&(e.gl.texImage2D(s.target,0,r.internalFormat,t.realWidth,t.realHeight,0,t.format,r.type,null),n[i]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===Zs.SIDES}};let xm=Zs;xm.SIDES=6;class ts extends jn{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=ts.EMPTY,i=t):(n=t,i=null),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(t,r)=>{if(this.url===null){t(this);return}try{const n=await Pt.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const s=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===yn.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),t(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}}),this._load)}upload(t,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(t,r,n)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return ts._EMPTY=ts._EMPTY??Pt.ADAPTER.createCanvas(0,0),ts._EMPTY}}const Co=class extends jn{constructor(e,t){t=t||{},super(Pt.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),e(this)},Co.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;jn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,i=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,i=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),i=Math.round(i);const s=this.source;s.width=n,s.height=i,s._pixiId=`canvas_${Gs()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=Co.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Co.SVG_XML.test(e)}};let Qs=Co;Qs.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Qs.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Ic=class extends jn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];jn.crossOrigin(r,n,t.crossorigin);for(let i=0;i<e.length;++i){const s=document.createElement("source");let{src:a,mime:o}=e[i];a=a||e[i];const c=a.split("?").shift().toLowerCase(),h=c.slice(c.lastIndexOf(".")+1);o=o||Ic.MIME_TYPES[h]||`video/${h}`,s.src=a,s.type=o,r.appendChild(s)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){const t=me.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(t=>{this.valid?t(this):(this._resolve=t,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(me.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(me.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._isConnectedToTicker&&(me.shared.remove(this.update,this),this._isConnectedToTicker=!1);const e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(me.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(me.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e)}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Ic.TYPES.includes(t)}};let kc=Ic;kc.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],kc.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},pc.push(ts,qp,vw,kc,Qs,mc,xm,yw);class Oo{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Vt.EMPTY:(t=t||new Vt(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,r){const{a:n,b:i,c:s,d:a,tx:o,ty:c}=t,h=n*r.x+s*r.y+o,d=i*r.x+a*r.y+c;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,d),this.maxY=Math.max(this.maxY,d)}addQuad(t){let r=this.minX,n=this.minY,i=this.maxX,s=this.maxY,a=t[0],o=t[1];r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[2],o=t[3],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[4],o=t[5],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[6],o=t[7],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,this.minX=r,this.minY=n,this.maxX=i,this.maxY=s}addFrame(t,r,n,i,s){this.addFrameMatrix(t.worldTransform,r,n,i,s)}addFrameMatrix(t,r,n,i,s){const a=t.a,o=t.b,c=t.c,h=t.d,d=t.tx,p=t.ty;let f=this.minX,m=this.minY,g=this.maxX,v=this.maxY,b=a*r+c*n+d,_=o*r+h*n+p;f=b<f?b:f,m=_<m?_:m,g=b>g?b:g,v=_>v?_:v,b=a*i+c*n+d,_=o*i+h*n+p,f=b<f?b:f,m=_<m?_:m,g=b>g?b:g,v=_>v?_:v,b=a*r+c*s+d,_=o*r+h*s+p,f=b<f?b:f,m=_<m?_:m,g=b>g?b:g,v=_>v?_:v,b=a*i+c*s+d,_=o*i+h*s+p,f=b<f?b:f,m=_<m?_:m,g=b>g?b:g,v=_>v?_:v,this.minX=f,this.minY=m,this.maxX=g,this.maxY=v}addVertexData(t,r,n){let i=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let c=r;c<n;c+=2){const h=t[c],d=t[c+1];i=h<i?h:i,s=d<s?d:s,a=h>a?h:a,o=d>o?d:o}this.minX=i,this.minY=s,this.maxX=a,this.maxY=o}addVertices(t,r,n,i){this.addVerticesMatrix(t.worldTransform,r,n,i)}addVerticesMatrix(t,r,n,i,s=0,a=s){const o=t.a,c=t.b,h=t.c,d=t.d,p=t.tx,f=t.ty;let m=this.minX,g=this.minY,v=this.maxX,b=this.maxY;for(let _=n;_<i;_+=2){const w=r[_],S=r[_+1],x=o*w+h*S+p,A=d*S+c*w+f;m=Math.min(m,x-s),v=Math.max(v,x+s),g=Math.min(g,A-a),b=Math.max(b,A+a)}this.minX=m,this.minY=g,this.maxX=v,this.maxY=b}addBounds(t){const r=this.minX,n=this.minY,i=this.maxX,s=this.maxY;this.minX=t.minX<r?t.minX:r,this.minY=t.minY<n?t.minY:n,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,r){const n=t.minX>r.minX?t.minX:r.minX,i=t.minY>r.minY?t.minY:r.minY,s=t.maxX<r.maxX?t.maxX:r.maxX,a=t.maxY<r.maxY?t.maxY:r.maxY;if(n<=s&&i<=a){const o=this.minX,c=this.minY,h=this.maxX,d=this.maxY;this.minX=n<o?n:o,this.minY=i<c?i:c,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}addBoundsMatrix(t,r){this.addFrameMatrix(r,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,r){const n=t.minX>r.x?t.minX:r.x,i=t.minY>r.y?t.minY:r.y,s=t.maxX<r.x+r.width?t.maxX:r.x+r.width,a=t.maxY<r.y+r.height?t.maxY:r.y+r.height;if(n<=s&&i<=a){const o=this.minX,c=this.minY,h=this.maxX,d=this.maxY;this.minX=n<o?n:o,this.minY=i<c?i:c,this.maxX=s>h?s:h,this.maxY=a>d?a:d}}pad(t=0,r=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=r,this.maxY+=r)}addFramePad(t,r,n,i,s,a){t-=s,r-=a,n+=s,i+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class gi extends _n{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Ws,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Oo,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const r=Object.keys(t);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(gi.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,r){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new Vt),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new Vt),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Oo);const r=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-s,a}toGlobal(t,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,r)}toLocal(t,r,n,i){return r&&(t=r.toGlobal(t,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,n)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)}setTransform(t=0,r=0,n=1,i=1,s=0,a=0,o=0,c=0,h=0){return this.position.x=t,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=c,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new _w),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*yx}set angle(t){this.transform.rotation=t*vx}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=t,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class _w extends gi{constructor(){super(...arguments),this.sortDirty=null}}gi.prototype.displayObjectUpdateTransform=gi.prototype.updateTransform;const bw=new ee;function xw(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const Rc=class extends gi{constructor(){super(),this.children=[],this.sortableChildren=Rc.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.addChild(e[t]);else{const t=e[0];t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this)}return e[0]}addChildAt(e,t){if(t<0||t>this.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const r=this.getChildIndex(e),n=this.getChildIndex(t);this.children[r]=t,this.children[n]=e,this.onChildrenChange(r<n?r:n)}getChildIndex(e){const t=this.children.indexOf(e);if(t===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return t}setChildIndex(e,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(e);Hs(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.removeChild(e[t]);else{const t=e[0],r=this.children.indexOf(t);if(r===-1)return null;t.parent=null,t.transform._parentID=-1,Hs(this.children,r,1),this._boundsID++,this.onChildrenChange(r),t.emit("removed",this),this.emit("childRemoved",t,this,r)}return e[0]}removeChildAt(e){const t=this.getChildAt(e);return t.parent=null,t.transform._parentID=-1,Hs(this.children,e,1),this._boundsID++,this.onChildrenChange(e),t.emit("removed",this),this.emit("childRemoved",t,this,e),t}removeChildren(e=0,t=this.children.length){const r=e,n=t,i=n-r;let s;if(i>0&&i<=n){s=this.children.splice(r,i);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(i===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let e=!1;for(let t=0,r=this.children.length;t<r;++t){const n=this.children[t];n._lastSortedIndex=t,!e&&n.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(xw),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e<t;++e){const r=this.children[e];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){const t=this.children[e];if(!(!t.visible||!t.renderable))if(t.calculateBounds(),t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(t._bounds,r._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}getLocalBounds(e,t=!1){const r=super.getLocalBounds(e);if(!t)for(let n=0,i=this.children.length;n<i;++n){const s=this.children[n];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const t=e.renderTexture.sourceFrame;if(!(t.width>0&&t.height>0))return;let r,n;this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==Rc.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=bw.copyFrom(n),n.prepend(i)):n=i),r&&t.intersects(r,n))this._render(e);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],c=o.cullable;o.cullable=c||!this.cullArea,o.render(e),o.cullable=c}}render(e){var t;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(t=this.filters)!=null&&t.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let r=0,n=this.children.length;r<n;++r)this.children[r].render(e)}}renderAdvanced(e){var i,s,a;const t=this.filters,r=this._mask;if(t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<t.length;o++)t[o].enabled&&this._enabledFilters.push(t[o])}const n=t&&((i=this._enabledFilters)==null?void 0:i.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ce.NONE));if(n&&e.batch.flush(),t&&((s=this._enabledFilters)!=null&&s.length)&&e.filter.push(this,this._enabledFilters),r&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let o=0,c=this.children.length;o<c;++o)this.children[o].render(e)}n&&e.batch.flush(),r&&e.mask.pop(this),t&&((a=this._enabledFilters)!=null&&a.length)&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;const t=typeof e=="boolean"?e:e==null?void 0:e.children,r=this.removeChildren(0,this.children.length);if(t)for(let n=0;n<r.length;++n)r[n].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){const t=this.getLocalBounds().width;t!==0?this.scale.x=e/t:this.scale.x=1,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){const t=this.getLocalBounds().height;t!==0?this.scale.y=e/t:this.scale.y=1,this._height=e}};let Ke=Rc;Ke.defaultSortableChildren=!1,Ke.prototype.containerUpdateTransform=Ke.prototype.updateTransform,Object.defineProperties(Pt,{SORTABLE_CHILDREN:{get(){return Ke.defaultSortableChildren},set(e){Kt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Ke.defaultSortableChildren=e}}});var Po=(e=>(e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",e))(Po||{});const Js=new xt,ww=new Uint16Array([0,1,2,0,2,3]);class yi extends Ke{constructor(t){super(),this._anchor=new Jr(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new ae(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=Lt.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||Tt.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=ww,this.pluginName="batch",this.isSprite=!0,this._roundPixels=Pt.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Vi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Vi(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const r=this.transform.worldTransform,n=r.a,i=r.b,s=r.c,a=r.d,o=r.tx,c=r.ty,h=this.vertexData,d=t.trim,p=t.orig,f=this._anchor;let m=0,g=0,v=0,b=0;if(d?(g=d.x-f._x*p.width,m=g+d.width,b=d.y-f._y*p.height,v=b+d.height):(g=-f._x*p.width,m=g+p.width,b=-f._y*p.height,v=b+p.height),h[0]=n*g+s*b+o,h[1]=a*b+i*g+c,h[2]=n*m+s*b+o,h[3]=a*b+i*m+c,h[4]=n*m+s*v+o,h[5]=a*v+i*m+c,h[6]=n*g+s*v+o,h[7]=a*v+i*g+c,this._roundPixels){const _=Pt.RESOLUTION;for(let w=0;w<h.length;++w)h[w]=Math.round(h[w]*_)/_}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const t=this._texture,r=this.vertexTrimmedData,n=t.orig,i=this._anchor,s=this.transform.worldTransform,a=s.a,o=s.b,c=s.c,h=s.d,d=s.tx,p=s.ty,f=-i._x*n.width,m=f+n.width,g=-i._y*n.height,v=g+n.height;r[0]=a*f+c*g+d,r[1]=h*g+o*f+p,r[2]=a*m+c*g+d,r[3]=h*g+o*m+p,r[4]=a*m+c*v+d,r[5]=h*v+o*m+p,r[6]=a*f+c*v+d,r[7]=h*v+o*f+p}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const t=this._texture.trim,r=this._texture.orig;!t||t.width===r.width&&t.height===r.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(t){return this.children.length===0?(this._localBounds||(this._localBounds=new Oo),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Vt),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,Js);const r=this._texture.orig.width,n=this._texture.orig.height,i=-r*this.anchor.x;let s=0;return Js.x>=i&&Js.x<i+r&&(s=-n*this.anchor.y,Js.y>=s&&Js.y<s+n)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof t=="boolean"?t:t==null?void 0:t.texture){const n=typeof t=="boolean"?t:t==null?void 0:t.baseTexture;this._texture.destroy(!!n)}this._texture=null}static from(t,r){const n=t instanceof Tt?t:Tt.from(t,r);return new yi(n)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const r=Vi(this.scale.x)||1;this.scale.x=r*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const r=Vi(this.scale.y)||1;this.scale.y=r*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Tt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const Io={willReadFrequently:!0},Ct=class{static get experimentalLetterSpacingSupported(){let e=Ct._experimentalLetterSpacingSupported;if(e!==void 0){const t=Pt.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ct._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,n,i,s,a,o,c){this.text=e,this.style=t,this.width=r,this.height=n,this.lines=i,this.lineWidths=s,this.lineHeight=a,this.maxLineWidth=o,this.fontProperties=c}static measureText(e,t,r,n=Ct._canvas){r=r??t.wordWrap;const i=t.toFontString(),s=Ct.measureFont(i);s.fontSize===0&&(s.fontSize=t.fontSize,s.ascent=t.fontSize);const a=n.getContext("2d",Io);a.font=i;const c=(r?Ct.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),h=new Array(c.length);let d=0;for(let g=0;g<c.length;g++){const v=Ct._measureText(c[g],t.letterSpacing,a);h[g]=v,d=Math.max(d,v)}let p=d+t.strokeThickness;t.dropShadow&&(p+=t.dropShadowDistance);const f=t.lineHeight||s.fontSize+t.strokeThickness;let m=Math.max(f,s.fontSize+t.strokeThickness*2)+(c.length-1)*(f+t.leading);return t.dropShadow&&(m+=t.dropShadowDistance),new Ct(e,t,p,m,c,h,f+t.leading,d,s)}static _measureText(e,t,r){let n=!1;Ct.experimentalLetterSpacingSupported&&(Ct.experimentalLetterSpacing?(r.letterSpacing=`${t}px`,r.textLetterSpacing=`${t}px`,n=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));let i=r.measureText(e).width;return i>0&&(n?i-=t:i+=(Ct.graphemeSegmenter(e).length-1)*t),i}static wordWrap(e,t,r=Ct._canvas){const n=r.getContext("2d",Io);let i=0,s="",a="";const o=Object.create(null),{letterSpacing:c,whiteSpace:h}=t,d=Ct.collapseSpaces(h),p=Ct.collapseNewlines(h);let f=!d;const m=t.wordWrapWidth+c,g=Ct.tokenize(e);for(let v=0;v<g.length;v++){let b=g[v];if(Ct.isNewline(b)){if(!p){a+=Ct.addLine(s),f=!d,s="",i=0;continue}b=" "}if(d){const w=Ct.isBreakingSpace(b),S=Ct.isBreakingSpace(s[s.length-1]);if(w&&S)continue}const _=Ct.getFromCache(b,c,o,n);if(_>m)if(s!==""&&(a+=Ct.addLine(s),s="",i=0),Ct.canBreakWords(b,t.breakWords)){const w=Ct.wordWrapSplit(b);for(let S=0;S<w.length;S++){let x=w[S],A=x,N=1;for(;w[S+N];){const P=w[S+N];if(!Ct.canBreakChars(A,P,b,S,t.breakWords))x+=P;else break;A=P,N++}S+=N-1;const O=Ct.getFromCache(x,c,o,n);O+i>m&&(a+=Ct.addLine(s),f=!1,s="",i=0),s+=x,i+=O}}else{s.length>0&&(a+=Ct.addLine(s),s="",i=0);const w=v===g.length-1;a+=Ct.addLine(b,!w),f=!1,s="",i=0}else _+i>m&&(f=!1,a+=Ct.addLine(s),s="",i=0),(s.length>0||!Ct.isBreakingSpace(b)||f)&&(s+=b,i+=_)}return a+=Ct.addLine(s,!1),a}static addLine(e,t=!0){return e=Ct.trimRight(e),e=t?`${e}
498
- `:e,e}static getFromCache(e,t,r,n){let i=r[e];return typeof i!="number"&&(i=Ct._measureText(e,t,n)+t,r[e]=i),i}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!Ct.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ct._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ct._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let n=0;n<e.length;n++){const i=e[n],s=e[n+1];if(Ct.isBreakingSpace(i,s)||Ct.isNewline(i)){r!==""&&(t.push(r),r=""),t.push(i);continue}r+=i}return r!==""&&t.push(r),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,r,n,i){return!0}static wordWrapSplit(e){return Ct.graphemeSegmenter(e)}static measureFont(e){if(Ct._fonts[e])return Ct._fonts[e];const t={ascent:0,descent:0,fontSize:0},r=Ct._canvas,n=Ct._context;n.font=e;const i=Ct.METRICS_STRING+Ct.BASELINE_SYMBOL,s=Math.ceil(n.measureText(i).width);let a=Math.ceil(n.measureText(Ct.BASELINE_SYMBOL).width);const o=Math.ceil(Ct.HEIGHT_MULTIPLIER*a);if(a=a*Ct.BASELINE_MULTIPLIER|0,s===0||o===0)return Ct._fonts[e]=t,t;r.width=s,r.height=o,n.fillStyle="#f00",n.fillRect(0,0,s,o),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(i,0,a);const c=n.getImageData(0,0,s,o).data,h=c.length,d=s*4;let p=0,f=0,m=!1;for(p=0;p<a;++p){for(let g=0;g<d;g+=4)if(c[f+g]!==255){m=!0;break}if(!m)f+=d;else break}for(t.ascent=a-p,f=h-d,m=!1,p=o;p>a;--p){for(let g=0;g<d;g+=4)if(c[f+g]!==255){m=!0;break}if(!m)f-=d;else break}return t.descent=p-a,t.fontSize=t.ascent+t.descent,Ct._fonts[e]=t,t}static clearMetrics(e=""){e?delete Ct._fonts[e]:Ct._fonts={}}static get _canvas(){if(!Ct.__canvas){let e;try{const t=new OffscreenCanvas(0,0),r=t.getContext("2d",Io);if(r!=null&&r.measureText)return Ct.__canvas=t,t;e=Pt.ADAPTER.createCanvas()}catch{e=Pt.ADAPTER.createCanvas()}e.width=e.height=10,Ct.__canvas=e}return Ct.__canvas}static get _context(){return Ct.__context||(Ct.__context=Ct._canvas.getContext("2d",Io)),Ct.__context}};let Ge=Ct;Ge.METRICS_STRING="|ÉqÅ",Ge.BASELINE_SYMBOL="M",Ge.BASELINE_MULTIPLIER=1.4,Ge.HEIGHT_MULTIPLIER=2,Ge.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const e=new Intl.Segmenter;return t=>[...e.segment(t)].map(r=>r.segment)}return e=>[...e]})(),Ge.experimentalLetterSpacing=!1,Ge._fonts={},Ge._newlines=[10,13],Ge._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];const Sw=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ta=class{constructor(e){this.styleID=0,this.reset(),Mc(this,e,e)}clone(){const e={};return Mc(e,this,ta.defaultStyle),new ta(e)}reset(){Mc(this,ta.defaultStyle,ta.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=Nc(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=Nc(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){Tw(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=Nc(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let n=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!Sw.includes(n)&&(n=`"${n}"`),t[r]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};let ea=ta;ea.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Po.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};function Nc(e){const t=ae.shared;return Array.isArray(e)?e.map(r=>t.setValue(r).toHex()):t.setValue(e).toHex()}function Tw(e,t){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}function Mc(e,t,r){for(const n in r)Array.isArray(t[n])?e[n]=t[n].slice():e[n]=t[n]}const Ew={texture:!0,children:!1,baseTexture:!0},Lc=class extends yi{constructor(e,t,r){let n=!1;r||(r=Pt.ADAPTER.createCanvas(),n=!0),r.width=3,r.height=3;const i=Tt.from(r);i.orig=new Vt,i.trim=new Vt,super(i),this._ownCanvas=n,this.canvas=r,this.context=r.getContext("2d",{willReadFrequently:!0}),this._resolution=Lc.defaultResolution??Pt.RESOLUTION,this._autoResolution=Lc.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=t,this.localStyleID=-1}static get experimentalLetterSpacing(){return Ge.experimentalLetterSpacing}static set experimentalLetterSpacing(e){Kt("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Ge.experimentalLetterSpacing=e}updateText(e){const t=this._style;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;this._font=this._style.toFontString();const r=this.context,n=Ge.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),i=n.width,s=n.height,a=n.lines,o=n.lineHeight,c=n.lineWidths,h=n.maxLineWidth,d=n.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,i)+t.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,s)+t.padding*2)*this._resolution),r.scale(this._resolution,this._resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.lineWidth=t.strokeThickness,r.textBaseline=t.textBaseline,r.lineJoin=t.lineJoin,r.miterLimit=t.miterLimit;let p,f;const m=t.dropShadow?2:1;for(let g=0;g<m;++g){const v=t.dropShadow&&g===0,b=v?Math.ceil(Math.max(1,s)+t.padding*2):0,_=b*this._resolution;if(v){r.fillStyle="black",r.strokeStyle="black";const S=t.dropShadowColor,x=t.dropShadowBlur*this._resolution,A=t.dropShadowDistance*this._resolution;r.shadowColor=ae.shared.setValue(S).setAlpha(t.dropShadowAlpha).toRgbaString(),r.shadowBlur=x,r.shadowOffsetX=Math.cos(t.dropShadowAngle)*A,r.shadowOffsetY=Math.sin(t.dropShadowAngle)*A+_}else r.fillStyle=this._generateFillStyle(t,a,n),r.strokeStyle=t.stroke,r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;let w=(o-d.fontSize)/2;o-d.fontSize<0&&(w=0);for(let S=0;S<a.length;S++)p=t.strokeThickness/2,f=t.strokeThickness/2+S*o+d.ascent+w,t.align==="right"?p+=h-c[S]:t.align==="center"&&(p+=(h-c[S])/2),t.stroke&&t.strokeThickness&&this.drawLetterSpacing(a[S],p+t.padding,f+t.padding-b,!0),t.fill&&this.drawLetterSpacing(a[S],p+t.padding,f+t.padding-b)}this.updateTexture()}drawLetterSpacing(e,t,r,n=!1){const s=this._style.letterSpacing;let a=!1;if(Ge.experimentalLetterSpacingSupported&&(Ge.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,a=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),s===0||a){n?this.context.strokeText(e,t,r):this.context.fillText(e,t,r);return}let o=t;const c=Ge.graphemeSegmenter(e);let h=this.context.measureText(e).width,d=0;for(let p=0;p<c.length;++p){const f=c[p];n?this.context.strokeText(f,o,r):this.context.fillText(f,o,r);let m="";for(let g=p+1;g<c.length;++g)m+=c[g];d=this.context.measureText(m).width,o+=h-d+s,h=d}}updateTexture(){const e=this.canvas;if(this._style.trim){const s=sx(e);s.data&&(e.width=s.width,e.height=s.height,this.context.putImageData(s.data,0,0))}const t=this._texture,r=this._style,n=r.trim?0:r.padding,i=t.baseTexture;t.trim.width=t._frame.width=e.width/this._resolution,t.trim.height=t._frame.height=e.height/this._resolution,t.trim.x=-n,t.trim.y=-n,t.orig.width=t._frame.width-n*2,t.orig.height=t._frame.height-n*2,this._onTextureUpdate(),i.setRealSize(e.width,e.height,this._resolution),t.updateUvs(),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(e,t){return this.updateText(!0),this._textureID===-1&&(e=!1),super.getBounds(e,t)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds.call(this,e)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(e,t,r){const n=e.fill;if(Array.isArray(n)){if(n.length===1)return n[0]}else return n;let i;const s=e.dropShadow?e.dropShadowDistance:0,a=e.padding||0,o=this.canvas.width/this._resolution-s-a*2,c=this.canvas.height/this._resolution-s-a*2,h=n.slice(),d=e.fillGradientStops.slice();if(!d.length){const p=h.length+1;for(let f=1;f<p;++f)d.push(f/p)}if(h.unshift(n[0]),d.unshift(0),h.push(n[n.length-1]),d.push(1),e.fillGradientType===Po.LINEAR_VERTICAL){i=this.context.createLinearGradient(o/2,a,o/2,c+a);const p=r.fontProperties.fontSize+e.strokeThickness;for(let f=0;f<t.length;f++){const m=r.lineHeight*(f-1)+p,g=r.lineHeight*f;let v=g;f>0&&m>g&&(v=(g+m)/2);const b=g+p,_=r.lineHeight*(f+1);let w=b;f+1<t.length&&_<b&&(w=(b+_)/2);const S=(w-v)/c;for(let x=0;x<h.length;x++){let A=0;typeof d[x]=="number"?A=d[x]:A=x/h.length;let N=Math.min(1,Math.max(0,v/c+A*S));N=Number(N.toFixed(5)),i.addColorStop(N,h[x])}}}else{i=this.context.createLinearGradient(a,c/2,o+a,c/2);const p=h.length+1;let f=1;for(let m=0;m<h.length;m++){let g;typeof d[m]=="number"?g=d[m]:g=f/p,i.addColorStop(g,h[m]),f++}}return i}destroy(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Ew,e),super.destroy(e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this.updateText(!0);const t=Vi(this.scale.x)||1;this.scale.x=t*e/this._texture.orig.width,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this.updateText(!0);const t=Vi(this.scale.y)||1;this.scale.y=t*e/this._texture.orig.height,this._height=e}get style(){return this._style}set style(e){e=e||{},e instanceof ea?this._style=e:this._style=new ea(e),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}};let wm=Lc;wm.defaultAutoResolution=!0;class ko{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ro{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const r=t.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const s in r){const a=r[s].match(/^[a-z]+/gm)[0],o=r[s].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),c={};for(const h in o){const d=o[h].split("="),p=d[0],f=d[1].replace(/"/gm,""),m=parseFloat(f),g=isNaN(m)?f:m;c[p]=g}n[a].push(c)}const i=new ko;return n.info.forEach(s=>i.info.push({face:s.face,size:parseInt(s.size,10)})),n.common.forEach(s=>i.common.push({lineHeight:parseInt(s.lineHeight,10)})),n.page.forEach(s=>i.page.push({id:parseInt(s.id,10),file:s.file})),n.char.forEach(s=>i.char.push({id:parseInt(s.id,10),page:parseInt(s.page,10),x:parseInt(s.x,10),y:parseInt(s.y,10),width:parseInt(s.width,10),height:parseInt(s.height,10),xoffset:parseInt(s.xoffset,10),yoffset:parseInt(s.yoffset,10),xadvance:parseInt(s.xadvance,10)})),n.kerning.forEach(s=>i.kerning.push({first:parseInt(s.first,10),second:parseInt(s.second,10),amount:parseInt(s.amount,10)})),n.distanceField.forEach(s=>i.distanceField.push({distanceRange:parseInt(s.distanceRange,10),fieldType:s.fieldType})),i}}class Bc{static test(t){const r=t;return"getElementsByTagName"in r&&r.getElementsByTagName("page").length&&r.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const r=new ko,n=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),c=t.getElementsByTagName("distanceField");for(let h=0;h<n.length;h++)r.info.push({face:n[h].getAttribute("face"),size:parseInt(n[h].getAttribute("size"),10)});for(let h=0;h<i.length;h++)r.common.push({lineHeight:parseInt(i[h].getAttribute("lineHeight"),10)});for(let h=0;h<s.length;h++)r.page.push({id:parseInt(s[h].getAttribute("id"),10)||0,file:s[h].getAttribute("file")});for(let h=0;h<a.length;h++){const d=a[h];r.char.push({id:parseInt(d.getAttribute("id"),10),page:parseInt(d.getAttribute("page"),10)||0,x:parseInt(d.getAttribute("x"),10),y:parseInt(d.getAttribute("y"),10),width:parseInt(d.getAttribute("width"),10),height:parseInt(d.getAttribute("height"),10),xoffset:parseInt(d.getAttribute("xoffset"),10),yoffset:parseInt(d.getAttribute("yoffset"),10),xadvance:parseInt(d.getAttribute("xadvance"),10)})}for(let h=0;h<o.length;h++)r.kerning.push({first:parseInt(o[h].getAttribute("first"),10),second:parseInt(o[h].getAttribute("second"),10),amount:parseInt(o[h].getAttribute("amount"),10)});for(let h=0;h<c.length;h++)r.distanceField.push({fieldType:c[h].getAttribute("fieldType"),distanceRange:parseInt(c[h].getAttribute("distanceRange"),10)});return r}}class Fc{static test(t){return typeof t=="string"&&t.includes("<font>")?Bc.test(Pt.ADAPTER.parseXML(t)):!1}static parse(t){return Bc.parse(Pt.ADAPTER.parseXML(t))}}const Dc=[Ro,Bc,Fc];function Aw(e){for(let t=0;t<Dc.length;t++)if(Dc[t].test(e))return Dc[t];return null}function Cw(e,t,r,n,i,s){const a=r.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;let o;const c=r.dropShadow?r.dropShadowDistance:0,h=r.padding||0,d=e.width/n-c-h*2,p=e.height/n-c-h*2,f=a.slice(),m=r.fillGradientStops.slice();if(!m.length){const g=f.length+1;for(let v=1;v<g;++v)m.push(v/g)}if(f.unshift(a[0]),m.unshift(0),f.push(a[a.length-1]),m.push(1),r.fillGradientType===Po.LINEAR_VERTICAL){o=t.createLinearGradient(d/2,h,d/2,p+h);let g=0;const b=(s.fontProperties.fontSize+r.strokeThickness)/p;for(let _=0;_<i.length;_++){const w=s.lineHeight*_;for(let S=0;S<f.length;S++){let x=0;typeof m[S]=="number"?x=m[S]:x=S/f.length;const A=w/p+x*b;let N=Math.max(g,A);N=Math.min(N,1),o.addColorStop(N,f[S]),g=N}}}else{o=t.createLinearGradient(h,p/2,d+h,p/2);const g=f.length+1;let v=1;for(let b=0;b<f.length;b++){let _;typeof m[b]=="number"?_=m[b]:_=v/g,o.addColorStop(_,f[b]),v++}}return o}function Ow(e,t,r,n,i,s,a){const o=r.text,c=r.fontProperties;t.translate(n,i),t.scale(s,s);const h=a.strokeThickness/2,d=-(a.strokeThickness/2);if(t.font=a.toFontString(),t.lineWidth=a.strokeThickness,t.textBaseline=a.textBaseline,t.lineJoin=a.lineJoin,t.miterLimit=a.miterLimit,t.fillStyle=Cw(e,t,a,s,[o],r),t.strokeStyle=a.stroke,a.dropShadow){const p=a.dropShadowColor,f=a.dropShadowBlur*s,m=a.dropShadowDistance*s;t.shadowColor=ae.shared.setValue(p).setAlpha(a.dropShadowAlpha).toRgbaString(),t.shadowBlur=f,t.shadowOffsetX=Math.cos(a.dropShadowAngle)*m,t.shadowOffsetY=Math.sin(a.dropShadowAngle)*m}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;a.stroke&&a.strokeThickness&&t.strokeText(o,h,d+r.lineHeight-c.descent),a.fill&&t.fillText(o,h,d+r.lineHeight-c.descent),t.setTransform(1,0,0,1,0,0),t.fillStyle="rgba(0, 0, 0, 0)"}function No(e){return e.codePointAt?e.codePointAt(0):e.charCodeAt(0)}function Sm(e){return Array.from?Array.from(e):e.split("")}function Pw(e){typeof e=="string"&&(e=[e]);const t=[];for(let r=0,n=e.length;r<n;r++){const i=e[r];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);const s=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<s)throw new Error("[BitmapFont]: Invalid character range.");for(let o=s,c=a;o<=c;o++)t.push(String.fromCharCode(o))}else t.push(...Sm(i))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}const Br=class{constructor(e,t,r){var h;const[n]=e.info,[i]=e.common,[s]=e.page,[a]=e.distanceField,o=qs(s.file),c={};this._ownsTextures=r,this.font=n.face,this.size=n.size,this.lineHeight=i.lineHeight/o,this.chars={},this.pageTextures=c;for(let d=0;d<e.page.length;d++){const{id:p,file:f}=e.page[d];c[p]=t instanceof Array?t[d]:t[f],a!=null&&a.fieldType&&a.fieldType!=="none"&&(c[p].baseTexture.alphaMode=yn.NO_PREMULTIPLIED_ALPHA,c[p].baseTexture.mipmap=Mn.OFF)}for(let d=0;d<e.char.length;d++){const{id:p,page:f}=e.char[d];let{x:m,y:g,width:v,height:b,xoffset:_,yoffset:w,xadvance:S}=e.char[d];m/=o,g/=o,v/=o,b/=o,_/=o,w/=o,S/=o;const x=new Vt(m+c[f].frame.x/o,g+c[f].frame.y/o,v,b);this.chars[p]={xOffset:_,yOffset:w,xAdvance:S,kerning:{},texture:new Tt(c[f].baseTexture,x),page:f}}for(let d=0;d<e.kerning.length;d++){let{first:p,second:f,amount:m}=e.kerning[d];p/=o,f/=o,m/=o,this.chars[f]&&(this.chars[f].kerning[p]=m)}this.distanceFieldRange=a==null?void 0:a.distanceRange,this.distanceFieldType=((h=a==null?void 0:a.fieldType)==null?void 0:h.toLowerCase())??"none"}destroy(){for(const e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(const e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null}static install(e,t,r){let n;if(e instanceof ko)n=e;else{const s=Aw(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}t instanceof Tt&&(t=[t]);const i=new Br(n,t,r);return Br.available[i.font]=i,i}static uninstall(e){const t=Br.available[e];if(!t)throw new Error(`No font found named '${e}'`);t.destroy(),delete Br.available[e]}static from(e,t,r){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:n,padding:i,resolution:s,textureWidth:a,textureHeight:o,...c}=Object.assign({},Br.defaultOptions,r),h=Pw(n),d=t instanceof ea?t:new ea(t),p=a,f=new ko;f.info[0]={face:d.fontFamily,size:d.fontSize},f.common[0]={lineHeight:d.fontSize};let m=0,g=0,v,b,_,w=0;const S=[];for(let A=0;A<h.length;A++){v||(v=Pt.ADAPTER.createCanvas(),v.width=a,v.height=o,b=v.getContext("2d"),_=new Ht(v,{resolution:s,...c}),S.push(new Tt(_)),f.page.push({id:S.length-1,file:""}));const N=h[A],O=Ge.measureText(N,d,!1,v),P=O.width,B=Math.ceil(O.height),I=Math.ceil((d.fontStyle==="italic"?2:1)*P);if(g>=o-B*s){if(g===0)throw new Error(`[BitmapFont] textureHeight ${o}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${N}')`);--A,v=null,b=null,_=null,g=0,m=0,w=0;continue}if(w=Math.max(B+O.fontProperties.descent,w),I*s+m>=p){if(m===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${N}')`);--A,g+=w*s,g=Math.ceil(g),m=0,w=0;continue}Ow(v,b,O,m,g,s,d);const C=No(O.text);f.char.push({id:C,page:S.length-1,x:m/s,y:g/s,width:I,height:B,xoffset:0,yoffset:0,xadvance:P-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),m+=(I+2*i)*s,m=Math.ceil(m)}for(let A=0,N=h.length;A<N;A++){const O=h[A];for(let P=0;P<N;P++){const B=h[P],I=b.measureText(O).width,C=b.measureText(B).width,M=b.measureText(O+B).width-(I+C);M&&f.kerning.push({first:No(O),second:No(B),amount:M})}}const x=new Br(f,S,!0);return Br.available[e]!==void 0&&Br.uninstall(e),Br.available[e]=x,x}};let Je=Br;Je.ALPHA=[["a","z"],["A","Z"]," "],Je.NUMERIC=[["0","9"]],Je.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Je.ASCII=[[" ","~"]],Je.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Br.ALPHANUMERIC},Je.available={};class Iw{constructor(t,r){this.uvBuffer=t,this.uvMatrix=r,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 r=this.uvBuffer.data;(!this.data||this.data.length!==r.length)&&(this.data=new Float32Array(r.length)),this.uvMatrix.multiplyUvs(r,this.data),this._updateID++}}const Uc=new xt,Tm=new Xi,Em=class extends Ke{constructor(e,t,r,n=Cr.TRIANGLES){super(),this.geometry=e,this.shader=t,this.state=r||ci.for2d(),this.drawMode=n,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=Pt.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(e){this.shader=e}get material(){return this.shader}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(e){this.shader.tint=e}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(e){this.shader.texture=e}_render(e){const t=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===Cr.TRIANGLES&&t.length<Em.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(e){const t=this.shader;t.alpha=this.worldAlpha,t.update&&t.update(),e.batch.flush(),t.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(t),e.state.set(this.state),e.geometry.bind(this.geometry,t),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(e){const t=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}calculateVertices(){const t=this.geometry.buffers[0],r=t.data,n=t._updateID;if(n===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==r.length&&(this.vertexData=new Float32Array(r.length));const i=this.transform.worldTransform,s=i.a,a=i.b,o=i.c,c=i.d,h=i.tx,d=i.ty,p=this.vertexData;for(let f=0;f<p.length/2;f++){const m=r[f*2],g=r[f*2+1];p[f*2]=s*m+o*g+h,p[f*2+1]=a*m+c*g+d}if(this._roundPixels){const f=Pt.RESOLUTION;for(let m=0;m<p.length;++m)p[m]=Math.round(p[m]*f)/f}this.vertexDirty=n}calculateUvs(){const e=this.geometry.buffers[1],t=this.shader;t.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new Iw(e,t.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,Uc);const t=this.geometry.getBuffer("aVertexPosition").data,r=Tm.points,n=this.geometry.getIndex().data,i=n.length,s=this.drawMode===4?3:1;for(let a=0;a+2<i;a+=s){const o=n[a]*2,c=n[a+1]*2,h=n[a+2]*2;if(r[0]=t[o],r[1]=t[o+1],r[2]=t[c],r[3]=t[c+1],r[4]=t[h],r[5]=t[h+1],Tm.contains(Uc.x,Uc.y))return!0}return!1}destroy(e){super.destroy(e),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}};let es=Em;es.BATCHABLE_SIZE=100;class Mo extends Un{constructor(t,r,n){super();const i=new Oe(t),s=new Oe(r,!0),a=new Oe(n,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,Ut.FLOAT).addAttribute("aTextureCoord",s,2,!1,Ut.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var kw=`varying vec2 vTextureCoord;
499
- uniform vec4 uColor;
500
-
501
- uniform sampler2D uSampler;
502
-
503
- void main(void)
504
- {
505
- gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
506
- }
507
- `,Rw=`attribute vec2 aVertexPosition;
508
- attribute vec2 aTextureCoord;
509
-
510
- uniform mat3 projectionMatrix;
511
- uniform mat3 translationMatrix;
512
- uniform mat3 uTextureMatrix;
513
-
514
- varying vec2 vTextureCoord;
515
-
516
- void main(void)
517
- {
518
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
519
-
520
- vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
521
- }
522
- `;class ra extends tn{constructor(t,r){const n={uSampler:t,alpha:1,uTextureMatrix:ee.IDENTITY,uColor:new Float32Array([1,1,1,1])};r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r),r.uniforms&&Object.assign(n,r.uniforms),super(r.program||kr.from(Rw,kw),n),this._colorDirty=!1,this.uvMatrix=new Ec(t),this.batchable=r.program===void 0,this.pluginName=r.pluginName,this._tintColor=new ae(r.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=r.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const r=this.texture.baseTexture.alphaMode;ae.shared.setValue(this._tintColor).premultiply(this._alpha,r).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}var Nw=`// Pixi texture info\r
523
- varying vec2 vTextureCoord;\r
524
- uniform sampler2D uSampler;\r
525
- \r
526
- // Tint\r
527
- uniform vec4 uColor;\r
528
- \r
529
- // on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
530
- uniform float uFWidth;\r
531
- \r
532
- void main(void) {\r
533
- \r
534
- // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
535
- vec4 texColor = texture2D(uSampler, vTextureCoord);\r
536
- \r
537
- // MSDF\r
538
- float median = texColor.r + texColor.g + texColor.b -\r
539
- min(texColor.r, min(texColor.g, texColor.b)) -\r
540
- max(texColor.r, max(texColor.g, texColor.b));\r
541
- // SDF\r
542
- median = min(median, texColor.a);\r
543
- \r
544
- float screenPxDistance = uFWidth * (median - 0.5);\r
545
- float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
546
- if (median < 0.01) {\r
547
- alpha = 0.0;\r
548
- } else if (median > 0.99) {\r
549
- alpha = 1.0;\r
550
- }\r
551
- \r
552
- // Gamma correction for coverage-like alpha\r
553
- float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
554
- float gamma = mix(1.0, 1.0 / 2.2, luma);\r
555
- float coverage = pow(uColor.a * alpha, gamma); \r
556
- \r
557
- // NPM Textures, NPM outputs\r
558
- gl_FragColor = vec4(uColor.rgb, coverage);\r
559
- }\r
560
- `,Mw=`// Mesh material default fragment\r
561
- attribute vec2 aVertexPosition;\r
562
- attribute vec2 aTextureCoord;\r
563
- \r
564
- uniform mat3 projectionMatrix;\r
565
- uniform mat3 translationMatrix;\r
566
- uniform mat3 uTextureMatrix;\r
567
- \r
568
- varying vec2 vTextureCoord;\r
569
- \r
570
- void main(void)\r
571
- {\r
572
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
573
- \r
574
- vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
575
- }\r
576
- `;const Am=[],Cm=[],Om=[],Pm=class extends Ke{constructor(e,t={}){super();const{align:r,tint:n,maxWidth:i,letterSpacing:s,fontName:a,fontSize:o}=Object.assign({},Pm.styleDefaults,t);if(!Je.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=r,this._tintColor=new ae(n),this._font=void 0,this._fontName=a,this._fontSize=o,this.text=e,this._maxWidth=i,this._maxLineHeight=0,this._letterSpacing=s,this._anchor=new Jr(()=>{this.dirty=!0},this,0,0),this._roundPixels=Pt.ROUND_PIXELS,this.dirty=!0,this._resolution=Pt.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=Je.available[this._fontName],t=this.fontSize,r=t/e.size,n=new xt,i=[],s=[],a=[],o=this._text.replace(/(?:\r\n|\r)/g,`
577
- `)||" ",c=Sm(o),h=this._maxWidth*e.size/t,d=e.distanceFieldType==="none"?Am:Cm;let p=null,f=0,m=0,g=0,v=-1,b=0,_=0,w=0,S=0;for(let C=0;C<c.length;C++){const k=c[C],M=No(k);if(/(?:\s)/.test(k)&&(v=C,b=f,S++),k==="\r"||k===`
578
- `){s.push(f),a.push(-1),m=Math.max(m,f),++g,++_,n.x=0,n.y+=e.lineHeight,p=null,S=0;continue}const F=e.chars[M];if(!F)continue;p&&F.kerning[p]&&(n.x+=F.kerning[p]);const $=Om.pop()||{texture:Tt.EMPTY,line:0,charCode:0,prevSpaces:0,position:new xt};$.texture=F.texture,$.line=g,$.charCode=M,$.position.x=Math.round(n.x+F.xOffset+this._letterSpacing/2),$.position.y=Math.round(n.y+F.yOffset),$.prevSpaces=S,i.push($),f=$.position.x+Math.max(F.xAdvance-F.xOffset,F.texture.orig.width),n.x+=F.xAdvance+this._letterSpacing,w=Math.max(w,F.yOffset+F.texture.height),p=M,v!==-1&&h>0&&n.x>h&&(++_,Hs(i,1+v-_,1+C-v),C=v,v=-1,s.push(b),a.push(i.length>0?i[i.length-1].prevSpaces:0),m=Math.max(m,b),g++,n.x=0,n.y+=e.lineHeight,p=null,S=0)}const x=c[c.length-1];x!=="\r"&&x!==`
579
- `&&(/(?:\s)/.test(x)&&(f=b),s.push(f),m=Math.max(m,f),a.push(-1));const A=[];for(let C=0;C<=g;C++){let k=0;this._align==="right"?k=m-s[C]:this._align==="center"?k=(m-s[C])/2:this._align==="justify"&&(k=a[C]<0?0:(m-s[C])/a[C]),A.push(k)}const N=i.length,O={},P=[],B=this._activePagesMeshData;d.push(...B);for(let C=0;C<N;C++){const k=i[C].texture,M=k.baseTexture.uid;if(!O[M]){let F=d.pop();if(!F){const V=new Mo;let q,X;e.distanceFieldType==="none"?(q=new ra(Tt.EMPTY),X=Lt.NORMAL):(q=new ra(Tt.EMPTY,{program:kr.from(Mw,Nw),uniforms:{uFWidth:0}}),X=Lt.NORMAL_NPM);const G=new es(V,q);G.blendMode=X,F={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:G,vertices:null,uvs:null,indices:null}}F.index=0,F.indexCount=0,F.vertexCount=0,F.uvsCount=0,F.total=0;const{_textureCache:$}=this;$[M]=$[M]||new Tt(k.baseTexture),F.mesh.texture=$[M],F.mesh.tint=this._tintColor.value,P.push(F),O[M]=F}O[M].total++}for(let C=0;C<B.length;C++)P.includes(B[C])||this.removeChild(B[C].mesh);for(let C=0;C<P.length;C++)P[C].mesh.parent!==this&&this.addChild(P[C].mesh);this._activePagesMeshData=P;for(const C in O){const k=O[C],M=k.total;if(!(((I=k.indices)==null?void 0:I.length)>6*M)||k.vertices.length<es.BATCHABLE_SIZE*2)k.vertices=new Float32Array(4*2*M),k.uvs=new Float32Array(4*2*M),k.indices=new Uint16Array(6*M);else{const F=k.total,$=k.vertices;for(let V=F*4*2;V<$.length;V++)$[V]=0}k.mesh.size=6*M}for(let C=0;C<N;C++){const k=i[C];let M=k.position.x+A[k.line]*(this._align==="justify"?k.prevSpaces:1);this._roundPixels&&(M=Math.round(M));const F=M*r,$=k.position.y*r,V=k.texture,q=O[V.baseTexture.uid],X=V.frame,G=V._uvs,D=q.index++;q.indices[D*6+0]=0+D*4,q.indices[D*6+1]=1+D*4,q.indices[D*6+2]=2+D*4,q.indices[D*6+3]=0+D*4,q.indices[D*6+4]=2+D*4,q.indices[D*6+5]=3+D*4,q.vertices[D*8+0]=F,q.vertices[D*8+1]=$,q.vertices[D*8+2]=F+X.width*r,q.vertices[D*8+3]=$,q.vertices[D*8+4]=F+X.width*r,q.vertices[D*8+5]=$+X.height*r,q.vertices[D*8+6]=F,q.vertices[D*8+7]=$+X.height*r,q.uvs[D*8+0]=G.x0,q.uvs[D*8+1]=G.y0,q.uvs[D*8+2]=G.x1,q.uvs[D*8+3]=G.y1,q.uvs[D*8+4]=G.x2,q.uvs[D*8+5]=G.y2,q.uvs[D*8+6]=G.x3,q.uvs[D*8+7]=G.y3}this._textWidth=m*r,this._textHeight=(n.y+e.lineHeight)*r;for(const C in O){const k=O[C];if(this.anchor.x!==0||this.anchor.y!==0){let V=0;const q=this._textWidth*this.anchor.x,X=this._textHeight*this.anchor.y;for(let G=0;G<k.total;G++)k.vertices[V++]-=q,k.vertices[V++]-=X,k.vertices[V++]-=q,k.vertices[V++]-=X,k.vertices[V++]-=q,k.vertices[V++]-=X,k.vertices[V++]-=q,k.vertices[V++]-=X}this._maxLineHeight=w*r;const M=k.mesh.geometry.getBuffer("aVertexPosition"),F=k.mesh.geometry.getBuffer("aTextureCoord"),$=k.mesh.geometry.getIndex();M.data=k.vertices,F.data=k.uvs,$.data=k.indices,M.update(),F.update(),$.update()}for(let C=0;C<i.length;C++)Om.push(i[C]);this._font=e,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);const{distanceFieldRange:t,distanceFieldType:r,size:n}=Je.available[this._fontName];if(r!=="none"){const{a:i,b:s,c:a,d:o}=this.worldTransform,c=Math.sqrt(i*i+s*s),h=Math.sqrt(a*a+o*o),d=(Math.abs(c)+Math.abs(h))/2,p=this.fontSize/n,f=e._view.resolution;for(const m of this._activePagesMeshData)m.mesh.shader.uniforms.uFWidth=d*t*p*f}super._render(e)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const e=Je.available[this._fontName];if(!e)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(e){if(this.tint!==e){this._tintColor.setValue(e);for(let t=0;t<this._activePagesMeshData.length;t++)this._activePagesMeshData[t].mesh.tint=e}}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.dirty=!0)}get fontName(){return this._fontName}set fontName(e){if(!Je.available[e])throw new Error(`Missing BitmapFont "${e}"`);this._fontName!==e&&(this._fontName=e,this.dirty=!0)}get fontSize(){return this._fontSize??Je.available[this._fontName].size}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}destroy(e){const{_textureCache:t}=this,n=Je.available[this._fontName].distanceFieldType==="none"?Am:Cm;n.push(...this._activePagesMeshData);for(const i of this._activePagesMeshData)this.removeChild(i.mesh);this._activePagesMeshData=[],n.filter(i=>t[i.mesh.texture.baseTexture.uid]).forEach(i=>{i.mesh.texture=Tt.EMPTY});for(const i in t)t[i].destroy(),delete t[i];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};let Im=Pm;Im.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const km={loader:Et.LoadParser,resolver:Et.ResolveParser,cache:Et.CacheParser,detection:Et.DetectionParser};Bt.handle(Et.Asset,e=>{const t=e.ref;Object.entries(km).filter(([r])=>!!t[r]).forEach(([r,n])=>Bt.add(Object.assign(t[r],{extension:t[r].extension??n})))},e=>{const t=e.ref;Object.keys(km).filter(r=>!!t[r]).forEach(r=>Bt.remove(t[r]))});class Lw{constructor(t,r=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=r}add(t){t.forEach(r=>{this._assetList.push(r)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],r=Math.min(this._assetList.length,this._maxConcurrent);for(let n=0;n<r;n++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function na(e,t){if(Array.isArray(t)){for(const r of t)if(e.startsWith(`data:${r}`))return!0;return!1}return e.startsWith(`data:${t}`)}function ia(e,t){const r=e.split("?")[0],n=Ye.extname(r).toLowerCase();return Array.isArray(t)?t.includes(n):n===t}const Sn=(e,t)=>(Array.isArray(e)||(e=[e]),t?e.map(r=>typeof r=="string"?t(r):r):e),Bw=(e,t)=>{const r=t.split("?")[1];return r&&(e+=`?${r}`),e};function Rm(e,t,r,n,i){const s=t[r];for(let a=0;a<s.length;a++){const o=s[a];r<t.length-1?Rm(e.replace(n[r],o),t,r+1,n,i):i.push(e.replace(n[r],o))}}function Fw(e){const t=/\{(.*?)\}/g,r=e.match(t),n=[];if(r){const i=[];r.forEach(s=>{const a=s.substring(1,s.length-1).split(",");i.push(a)}),Rm(e,i,0,r,n)}else n.push(e);return n}const Lo=e=>!Array.isArray(e);class Dw{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const r=this._cache.get(t);return r||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),r}set(t,r){const n=Sn(t);let i;for(let o=0;o<this.parsers.length;o++){const c=this.parsers[o];if(c.test(r)){i=c.getCacheableAssets(n,r);break}}i||(i={},n.forEach(o=>{i[o]=r}));const s=Object.keys(i),a={cacheKeys:s,keys:n};if(n.forEach(o=>{this._cacheMap.set(o,a)}),s.forEach(o=>{this._cache.has(o)&&this._cache.get(o)!==r&&console.warn("[Cache] already has key:",o),this._cache.set(o,i[o])}),r instanceof Tt){const o=r;n.forEach(c=>{o.baseTexture!==Tt.EMPTY.baseTexture&&Ht.addToCache(o.baseTexture,c),Tt.addToCache(o,c)})}}remove(t){if(this._cacheMap.get(t),!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const r=this._cacheMap.get(t);r.cacheKeys.forEach(i=>{this._cache.delete(i)}),r.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const sa=new Dw;class Uw{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,r,n)=>(this._parsersValidated=!1,t[r]=n,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,r){const n={promise:null,parser:null};return n.promise=(async()=>{var a,o;let i=null,s=null;if(r.loadParser&&(s=this._parserHash[r.loadParser],s||console.warn(`[Assets] specified load parser "${r.loadParser}" not found while loading ${t}`)),!s){for(let c=0;c<this.parsers.length;c++){const h=this.parsers[c];if(h.load&&((a=h.test)!=null&&a.call(h,t,r,this))){s=h;break}}if(!s)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await s.load(t,r,this),n.parser=s;for(let c=0;c<this.parsers.length;c++){const h=this.parsers[c];h.parse&&h.parse&&await((o=h.testParse)==null?void 0:o.call(h,i,r,this))&&(i=await h.parse(i,r,this)||i,n.parser=h)}return i})(),n}async load(t,r){this._parsersValidated||this._validateParsers();let n=0;const i={},s=Lo(t),a=Sn(t,h=>({src:h})),o=a.length,c=a.map(async h=>{const d=Ye.toAbsolute(h.src);if(!i[h.src])try{this.promiseCache[d]||(this.promiseCache[d]=this._getLoadPromiseAndParser(d,h)),i[h.src]=await this.promiseCache[d].promise,r&&r(++n/o)}catch(p){throw delete this.promiseCache[d],delete i[h.src],new Error(`[Loader.load] Failed to load ${d}.
580
- ${p}`)}});return await Promise.all(c),s?i[a[0].src]:i}async unload(t){const n=Sn(t,i=>({src:i})).map(async i=>{var o,c;const s=Ye.toAbsolute(i.src),a=this.promiseCache[s];if(a){const h=await a.promise;(c=(o=a.parser)==null?void 0:o.unload)==null||c.call(o,h,i,this),delete this.promiseCache[s]}});await Promise.all(n)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,r)=>(t[r.name]&&console.warn(`[Assets] loadParser name conflict "${r.name}"`),{...t,[r.name]:r}),{})}}var $n=(e=>(e[e.Low=0]="Low",e[e.Normal=1]="Normal",e[e.High=2]="High",e))($n||{});const jw=".json",$w="application/json",zw={extension:{type:Et.LoadParser,priority:$n.Low},name:"loadJson",test(e){return na(e,$w)||ia(e,jw)},async load(e){return await(await Pt.ADAPTER.fetch(e)).json()}};Bt.add(zw);const Hw=".txt",Gw="text/plain",qw={name:"loadTxt",extension:{type:Et.LoadParser,priority:$n.Low},test(e){return na(e,Gw)||ia(e,Hw)},async load(e){return await(await Pt.ADAPTER.fetch(e)).text()}};Bt.add(qw);const Vw=["normal","bold","100","200","300","400","500","600","700","800","900"],Ww=[".ttf",".otf",".woff",".woff2"],Xw=["font/ttf","font/otf","font/woff","font/woff2"];function Yw(e){const t=Ye.extname(e);return Ye.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}const Kw={extension:{type:Et.LoadParser,priority:$n.Low},name:"loadWebFont",test(e){return na(e,Xw)||ia(e,Ww)},async load(e,t){var n,i,s;const r=Pt.ADAPTER.getFontFaceSet();if(r){const a=[],o=((n=t.data)==null?void 0:n.family)??Yw(e),c=((s=(i=t.data)==null?void 0:i.weights)==null?void 0:s.filter(d=>Vw.includes(d)))??["normal"],h=t.data??{};for(let d=0;d<c.length;d++){const p=c[d],f=new FontFace(o,`url(${encodeURI(e)})`,{...h,weight:p});await f.load(),r.add(f),a.push(f)}return a.length===1?a[0]:a}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(e){(Array.isArray(e)?e:[e]).forEach(t=>Pt.ADAPTER.getFontFaceSet().delete(t))}};Bt.add(Kw);let Nm=0,jc;const Zw={id:"checkImageBitmap",code:`
581
- async function checkImageBitmap()
582
- {
583
- try
584
- {
585
- if (typeof createImageBitmap !== 'function') return false;
586
-
587
- const response = await fetch('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=');
588
- const imageBlob = await response.blob();
589
- const imageBitmap = await createImageBitmap(imageBlob);
590
-
591
- return imageBitmap.width === 1 && imageBitmap.height === 1;
592
- }
593
- catch (e)
594
- {
595
- return false;
596
- }
597
- }
598
- checkImageBitmap().then((result) => { self.postMessage(result); });
599
- `},Qw={id:"loadImageBitmap",code:`
600
- async function loadImageBitmap(url)
601
- {
602
- const response = await fetch(url);
603
-
604
- if (!response.ok)
605
- {
606
- throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \`
607
- + \`\${response.status} \${response.statusText}\`);
608
- }
609
-
610
- const imageBlob = await response.blob();
611
- const imageBitmap = await createImageBitmap(imageBlob);
612
-
613
- return imageBitmap;
614
- }
615
- self.onmessage = async (event) =>
616
- {
617
- try
618
- {
619
- const imageBitmap = await loadImageBitmap(event.data.data[0]);
620
-
621
- self.postMessage({
622
- data: imageBitmap,
623
- uuid: event.data.uuid,
624
- id: event.data.id,
625
- }, [imageBitmap]);
626
- }
627
- catch(e)
628
- {
629
- self.postMessage({
630
- error: e,
631
- uuid: event.data.uuid,
632
- id: event.data.id,
633
- });
634
- }
635
- };`};let $c;class Jw{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 r=URL.createObjectURL(new Blob([Zw.code],{type:"application/javascript"})),n=new Worker(r);n.addEventListener("message",i=>{n.terminate(),URL.revokeObjectURL(r),t(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){jc===void 0&&(jc=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<jc&&($c||($c=URL.createObjectURL(new Blob([Qw.code],{type:"application/javascript"}))),this._createdWorkers++,t=new Worker($c),t.addEventListener("message",r=>{this.complete(r.data),this.returnWorker(r.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,r){await this._initWorkers();const n=new Promise((i,s)=>{this.queue.push({id:t,arguments:r,resolve:i,reject:s})});return this.next(),n}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const r=this.queue.pop(),n=r.id;this.resolveHash[Nm]={resolve:r.resolve,reject:r.reject},t.postMessage({data:r.arguments,uuid:Nm++,id:n})}}const Mm=new Jw;function Lm(e,t,r){const n=new Tt(e);return n.baseTexture.on("dispose",()=>{delete t.promiseCache[r]}),n}const tS=[".jpeg",".jpg",".png",".webp",".avif"],eS=["image/jpeg","image/png","image/webp","image/avif"];async function rS(e){const t=await Pt.ADAPTER.fetch(e);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${e}: ${t.status} ${t.statusText}`);const r=await t.blob();return await createImageBitmap(r)}const Bo={name:"loadTextures",extension:{type:Et.LoadParser,priority:$n.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(e){return na(e,eS)||ia(e,tS)},async load(e,t,r){let n=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Mm.isImageBitmapSupported()?n=await Mm.loadImageBitmap(e):n=await rS(e):n=await new Promise(s=>{n=new Image,n.crossOrigin=this.config.crossOrigin,n.src=e,n.complete?s(n):n.onload=()=>{s(n)}});const i=new Ht(n,{resolution:qs(e),...t.data});return i.resource.src=e,Lm(i,r,e)},unload(e){e.destroy(!0)}};Bt.add(Bo);const nS=".svg",iS="image/svg+xml",sS={extension:{type:Et.LoadParser,priority:$n.High},name:"loadSVG",test(e){return na(e,iS)||ia(e,nS)},async testParse(e){return Qs.test(e)},async parse(e,t,r){var a,o,c;const n=new Qs(e,(a=t==null?void 0:t.data)==null?void 0:a.resourceOptions),i=new Ht(n,{resolution:qs(e),...t==null?void 0:t.data});i.resource.src=e;const s=Lm(i,r,e);return(c=(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions)!=null&&c.autoLoad||await n.load(),s},async load(e,t){return(await Pt.ADAPTER.fetch(e)).text()},unload:Bo.unload};Bt.add(sS);class aS{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,r)=>`${t}${this._bundleIdConnector}${r}`,extractAssetIdFromBundle:(t,r)=>r.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(r=>{this._preferredOrder.push(r),r.priority||(r.priority=Object.keys(r.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 r=t;this._defaultSearchParams=Object.keys(r).map(n=>`${encodeURIComponent(n)}=${encodeURIComponent(r[n])}`).join("&")}}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(r=>{this.addBundle(r.name,r.assets)})}addBundle(t,r){const n=[];Array.isArray(r)?r.forEach(i=>{if(typeof i.name=="string"){const s=this._createBundleAssetId(t,i.name);n.push(s),this.add([i.name,s],i.srcs,i.data)}else{const s=i.name.map(a=>this._createBundleAssetId(t,a));s.forEach(a=>{n.push(a)}),this.add([...i.name,...s],i.srcs)}}):Object.keys(r).forEach(i=>{n.push(this._createBundleAssetId(t,i)),this.add([i,this._createBundleAssetId(t,i)],r[i])}),this._bundles[t]=n}add(t,r,n){const i=Sn(t);i.forEach(a=>{this.hasKey(a)&&console.warn(`[Resolver] already has key: ${a} overwriting`)}),Array.isArray(r)||(typeof r=="string"?r=Fw(r):r=[r]);const s=r.map(a=>{let o=a;if(typeof a=="string"){let c=!1;for(let h=0;h<this._parsers.length;h++){const d=this._parsers[h];if(d.test(a)){o=d.parse(a),c=!0;break}}c||(o={src:a})}return o.format||(o.format=o.src.split(".").pop()),o.alias||(o.alias=i),(this._basePath||this._rootPath)&&(o.src=Ye.toAbsolute(o.src,this._basePath,this._rootPath)),o.src=this._appendDefaultSearchParams(o.src),o.data=o.data??n,o});i.forEach(a=>{this._assetMap[a]=s})}resolveBundle(t){const r=Lo(t);t=Sn(t);const n={};return t.forEach(i=>{const s=this._bundles[i];if(s){const a=this.resolve(s),o={};for(const c in a){const h=a[c];o[this._extractAssetIdFromBundle(i,c)]=h}n[i]=o}}),r?n[t[0]]:n}resolveUrl(t){const r=this.resolve(t);if(typeof t!="string"){const n={};for(const i in r)n[i]=r[i].src;return n}return r.src}resolve(t){const r=Lo(t);t=Sn(t);const n={};return t.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let s=this._assetMap[i];const a=this._getPreferredOrder(s),o=s[0];a==null||a.priority.forEach(c=>{a.params[c].forEach(h=>{const d=s.filter(p=>p[c]?p[c]===h:!1);d.length&&(s=d)})}),this._resolverHash[i]=s[0]??o}else{let s=i;(this._basePath||this._rootPath)&&(s=Ye.toAbsolute(s,this._basePath,this._rootPath)),s=this._appendDefaultSearchParams(s),this._resolverHash[i]={src:s}}n[i]=this._resolverHash[i]}),r?n[t[0]]:n}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let r=0;r<t.length;r++){const n=t[0],i=this._preferredOrder.find(s=>s.params.format.includes(n.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const r=/\?/.test(t)?"&":"?";return`${t}${r}${this._defaultSearchParams}`}}class oS{constructor(){this._detections=[],this._initialized=!1,this.resolver=new aS,this.loader=new Uw,this.cache=sa,this._backgroundLoader=new Lw(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var s,a,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 c=t.manifest;typeof c=="string"&&(c=await this.load(c)),this.resolver.addManifest(c)}const r=((s=t.texturePreference)==null?void 0:s.resolution)??1,n=typeof r=="number"?[r]:r;let i=[];if((a=t.texturePreference)!=null&&a.format){const c=(o=t.texturePreference)==null?void 0:o.format;i=typeof c=="string"?[c]:c;for(const h of this._detections)await h.test()||(i=await h.remove(i))}else for(const c of this._detections)await c.test()&&(i=await c.add(i));this.resolver.prefer({params:{format:i,resolution:n}}),t.preferences&&this.setPreferences(t.preferences)}add(t,r,n){this.resolver.add(t,r,n)}async load(t,r){this._initialized||await this.init();const n=Lo(t),i=Sn(t).map(o=>typeof o!="string"?(this.resolver.add(o.src,o),o.src):(this.resolver.hasKey(o)||this.resolver.add(o,o),o)),s=this.resolver.resolve(i),a=await this._mapLoadToResolve(s,r);return n?a[i[0]]:a}addBundle(t,r){this.resolver.addBundle(t,r)}async loadBundle(t,r){this._initialized||await this.init();let n=!1;typeof t=="string"&&(n=!0,t=[t]);const i=this.resolver.resolveBundle(t),s={},a=Object.keys(i);let o=0,c=0;const h=()=>{r==null||r(++o/c)},d=a.map(p=>{const f=i[p];return c+=Object.keys(f).length,this._mapLoadToResolve(f,h).then(m=>{s[p]=m})});return await Promise.all(d),n?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const r=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(r))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const r=this.resolver.resolveBundle(t);Object.values(r).forEach(n=>{this._backgroundLoader.add(Object.values(n))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return sa.get(t);const r={};for(let n=0;n<t.length;n++)r[n]=sa.get(t[n]);return r}async _mapLoadToResolve(t,r){const n=Object.values(t),i=Object.keys(t);this._backgroundLoader.active=!1;const s=await this.loader.load(n,r);this._backgroundLoader.active=!0;const a={};return n.forEach((o,c)=>{const h=s[o.src],d=[o.src];o.alias&&d.push(...o.alias),a[i[c]]=h,sa.set(d,h)}),a}async unload(t){this._initialized||await this.init();const r=Sn(t).map(i=>typeof i!="string"?i.src:i),n=this.resolver.resolve(r);await this._unloadFromResolved(n)}async unloadBundle(t){this._initialized||await this.init(),t=Sn(t);const r=this.resolver.resolveBundle(t),n=Object.keys(r).map(i=>this._unloadFromResolved(r[i]));await Promise.all(n)}async _unloadFromResolved(t){const r=Object.values(t);r.forEach(n=>{sa.remove(n.src)}),await this.loader.unload(r)}get detections(){return this._detections}get preferWorkers(){return Bo.config.preferWorkers}set preferWorkers(t){Kt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(r=>{r.config&&Object.keys(r.config).filter(n=>n in t).forEach(n=>{r.config[n]=t[n]})})}}const Fo=new oS;Bt.handleByList(Et.LoadParser,Fo.loader.parsers).handleByList(Et.ResolveParser,Fo.resolver.parsers).handleByList(Et.CacheParser,Fo.cache.parsers).handleByList(Et.DetectionParser,Fo.detections);const lS={extension:Et.CacheParser,test:e=>Array.isArray(e)&&e.every(t=>t instanceof Tt),getCacheableAssets:(e,t)=>{const r={};return e.forEach(n=>{t.forEach((i,s)=>{r[n+(s===0?"":s+1)]=i})}),r}};Bt.add(lS);const uS={extension:{type:Et.DetectionParser,priority:1},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",t=await Pt.ADAPTER.fetch(e).then(r=>r.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"avif"],remove:async e=>e.filter(t=>t!=="avif")};Bt.add(uS);const cS={extension:{type:Et.DetectionParser,priority:0},test:async()=>{if(!globalThis.createImageBitmap)return!1;const e="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",t=await Pt.ADAPTER.fetch(e).then(r=>r.blob());return createImageBitmap(t).then(()=>!0,()=>!1)},add:async e=>[...e,"webp"],remove:async e=>e.filter(t=>t!=="webp")};Bt.add(cS);const Bm=["png","jpg","jpeg"],hS={extension:{type:Et.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async e=>[...e,...Bm],remove:async e=>e.filter(t=>!Bm.includes(t))};Bt.add(hS);const fS={extension:Et.ResolveParser,test:Bo.test,parse:e=>{var t;return{resolution:parseFloat(((t=Pt.RETINA_PREFIX.exec(e))==null?void 0:t[1])??"1"),format:e.split(".").pop(),src:e}}};Bt.add(fS);const dS=[".xml",".fnt"],pS={extension:{type:Et.LoadParser,priority:$n.Normal},name:"loadBitmapFont",test(e){return dS.includes(Ye.extname(e).toLowerCase())},async testParse(e){return Ro.test(e)||Fc.test(e)},async parse(e,t,r){const n=Ro.test(e)?Ro.parse(e):Fc.parse(e),{src:i}=t,{page:s}=n,a=[];for(let h=0;h<s.length;++h){const d=s[h].file;let p=Ye.join(Ye.dirname(i),d);p=Bw(p,i),a.push(p)}const o=await r.load(a),c=a.map(h=>o[h]);return Je.install(n,c,!0)},async load(e,t){return(await Pt.ADAPTER.fetch(e)).text()},unload(e){e.destroy()}};Bt.add(pS);const Do={build(e){const t=e.points;let r,n,i,s,a,o;if(e.type===Ue.CIRC){const g=e.shape;r=g.x,n=g.y,a=o=g.radius,i=s=0}else if(e.type===Ue.ELIP){const g=e.shape;r=g.x,n=g.y,a=g.width,o=g.height,i=s=0}else{const g=e.shape,v=g.width/2,b=g.height/2;r=g.x+v,n=g.y+b,a=o=Math.max(0,Math.min(g.radius,Math.min(v,b))),i=v-a,s=b-o}if(!(a>=0&&o>=0&&i>=0&&s>=0)){t.length=0;return}const c=Math.ceil(2.3*Math.sqrt(a+o)),h=c*8+(i?4:0)+(s?4:0);if(t.length=h,h===0)return;if(c===0){t.length=8,t[0]=t[6]=r+i,t[1]=t[3]=n+s,t[2]=t[4]=r-i,t[5]=t[7]=n-s;return}let d=0,p=c*4+(i?2:0)+2,f=p,m=h;{const g=i+a,v=s,b=r+g,_=r-g,w=n+v;if(t[d++]=b,t[d++]=w,t[--p]=w,t[--p]=_,s){const S=n-v;t[f++]=_,t[f++]=S,t[--m]=S,t[--m]=b}}for(let g=1;g<c;g++){const v=Math.PI/2*(g/c),b=i+Math.cos(v)*a,_=s+Math.sin(v)*o,w=r+b,S=r-b,x=n+_,A=n-_;t[d++]=w,t[d++]=x,t[--p]=x,t[--p]=S,t[f++]=S,t[f++]=A,t[--m]=A,t[--m]=w}{const g=i,v=s+o,b=r+g,_=r-g,w=n+v,S=n-v;t[d++]=b,t[d++]=w,t[--m]=S,t[--m]=b,i&&(t[d++]=_,t[d++]=w,t[--m]=S,t[--m]=_)}},triangulate(e,t){const r=e.points,n=t.points,i=t.indices;if(r.length===0)return;let s=n.length/2;const a=s;let o,c;if(e.type!==Ue.RREC){const d=e.shape;o=d.x,c=d.y}else{const d=e.shape;o=d.x+d.width/2,c=d.y+d.height/2}const h=e.matrix;n.push(e.matrix?h.a*o+h.c*c+h.tx:o,e.matrix?h.b*o+h.d*c+h.ty:c),s++,n.push(r[0],r[1]);for(let d=2;d<r.length;d+=2)n.push(r[d],r[d+1]),i.push(s++,a,s);i.push(a+1,a,s)}};function Fm(e,t=!1){const r=e.length;if(r<6)return;let n=0;for(let i=0,s=e[r-2],a=e[r-1];i<r;i+=2){const o=e[i],c=e[i+1];n+=(o-s)*(c+a),s=o,a=c}if(!t&&n>0||t&&n<=0){const i=r/2;for(let s=i+i%2;s<r;s+=2){const a=r-s-2,o=r-s-1,c=s,h=s+1;[e[a],e[c]]=[e[c],e[a]],[e[o],e[h]]=[e[h],e[o]]}}}const Dm={build(e){e.points=e.shape.points.slice()},triangulate(e,t){let r=e.points;const n=e.holes,i=t.points,s=t.indices;if(r.length>=6){Fm(r,!1);const a=[];for(let h=0;h<n.length;h++){const d=n[h];Fm(d.points,!0),a.push(r.length/2),r=r.concat(d.points)}const o=R_(r,a,2);if(!o)return;const c=i.length/2;for(let h=0;h<o.length;h+=3)s.push(o[h]+c),s.push(o[h+1]+c),s.push(o[h+2]+c);for(let h=0;h<r.length;h++)i.push(r[h])}}},mS={build(e){const t=e.shape,r=t.x,n=t.y,i=t.width,s=t.height,a=e.points;a.length=0,i>=0&&s>=0&&a.push(r,n,r+i,n,r+i,n+s,r,n+s)},triangulate(e,t){const r=e.points,n=t.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},gS={build(e){Do.build(e)},triangulate(e,t){Do.triangulate(e,t)}};var Fr=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(Fr||{}),vi=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(vi||{});const rs={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=20){if(!this.adaptive||!e||isNaN(e))return t;let r=Math.ceil(e/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Um{static curveTo(t,r,n,i,s,a){const o=a[a.length-2],h=a[a.length-1]-r,d=o-t,p=i-r,f=n-t,m=Math.abs(h*f-d*p);if(m<1e-8||s===0)return(a[a.length-2]!==t||a[a.length-1]!==r)&&a.push(t,r),null;const g=h*h+d*d,v=p*p+f*f,b=h*p+d*f,_=s*Math.sqrt(g)/m,w=s*Math.sqrt(v)/m,S=_*b/g,x=w*b/v,A=_*f+w*d,N=_*p+w*h,O=d*(w+S),P=h*(w+S),B=f*(_+x),I=p*(_+x),C=Math.atan2(P-N,O-A),k=Math.atan2(I-N,B-A);return{cx:A+t,cy:N+r,radius:s,startAngle:C,endAngle:k,anticlockwise:d*p>f*h}}static arc(t,r,n,i,s,a,o,c,h){const d=o-a,p=rs._segmentsCount(Math.abs(d)*s,Math.ceil(Math.abs(d)/uo)*40),f=d/(p*2),m=f*2,g=Math.cos(f),v=Math.sin(f),b=p-1,_=b%1/b;for(let w=0;w<=b;++w){const S=w+_*w,x=f+a+m*S,A=Math.cos(x),N=-Math.sin(x);h.push((g*A+v*N)*s+n,(g*-N+v*A)*s+i)}}}class yS{constructor(){this.reset()}begin(t,r,n){this.reset(),this.style=t,this.start=r,this.attribStart=n}end(t,r){this.attribSize=r-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class zc{static curveLength(t,r,n,i,s,a,o,c){let d=0,p=0,f=0,m=0,g=0,v=0,b=0,_=0,w=0,S=0,x=0,A=t,N=r;for(let O=1;O<=10;++O)p=O/10,f=p*p,m=f*p,g=1-p,v=g*g,b=v*g,_=b*t+3*v*p*n+3*g*f*s+m*o,w=b*r+3*v*p*i+3*g*f*a+m*c,S=A-_,x=N-w,A=_,N=w,d+=Math.sqrt(S*S+x*x);return d}static curveTo(t,r,n,i,s,a,o){const c=o[o.length-2],h=o[o.length-1];o.length-=2;const d=rs._segmentsCount(zc.curveLength(c,h,t,r,n,i,s,a));let p=0,f=0,m=0,g=0,v=0;o.push(c,h);for(let b=1,_=0;b<=d;++b)_=b/d,p=1-_,f=p*p,m=f*p,g=_*_,v=g*_,o.push(m*c+3*f*_*t+3*p*g*n+v*s,m*h+3*f*_*r+3*p*g*i+v*a)}}function jm(e,t,r,n,i,s,a,o){const c=e-r*i,h=t-n*i,d=e+r*s,p=t+n*s;let f,m;a?(f=n,m=-r):(f=-n,m=r);const g=c+f,v=h+m,b=d+f,_=p+m;return o.push(g,v,b,_),2}function _i(e,t,r,n,i,s,a,o){const c=r-e,h=n-t;let d=Math.atan2(c,h),p=Math.atan2(i-e,s-t);o&&d<p?d+=Math.PI*2:!o&&d>p&&(p+=Math.PI*2);let f=d;const m=p-d,g=Math.abs(m),v=Math.sqrt(c*c+h*h),b=(15*g*Math.sqrt(v)/Math.PI>>0)+1,_=m/b;if(f+=_,o){a.push(e,t,r,n);for(let w=1,S=f;w<b;w++,S+=_)a.push(e,t,e+Math.sin(S)*v,t+Math.cos(S)*v);a.push(e,t,i,s)}else{a.push(r,n,e,t);for(let w=1,S=f;w<b;w++,S+=_)a.push(e+Math.sin(S)*v,t+Math.cos(S)*v,e,t);a.push(i,s,e,t)}return b*2}function vS(e,t){const r=e.shape;let n=e.points||r.points.slice();const i=t.closePointEps;if(n.length===0)return;const s=e.lineStyle,a=new xt(n[0],n[1]),o=new xt(n[n.length-2],n[n.length-1]),c=r.type!==Ue.POLY||r.closeStroke,h=Math.abs(a.x-o.x)<i&&Math.abs(a.y-o.y)<i;if(c){n=n.slice(),h&&(n.pop(),n.pop(),o.set(n[n.length-2],n[n.length-1]));const q=(a.x+o.x)*.5,X=(o.y+a.y)*.5;n.unshift(q,X),n.push(q,X)}const d=t.points,p=n.length/2;let f=n.length;const m=d.length/2,g=s.width/2,v=g*g,b=s.miterLimit*s.miterLimit;let _=n[0],w=n[1],S=n[2],x=n[3],A=0,N=0,O=-(w-x),P=_-S,B=0,I=0,C=Math.sqrt(O*O+P*P);O/=C,P/=C,O*=g,P*=g;const k=s.alignment,M=(1-k)*2,F=k*2;c||(s.cap===vi.ROUND?f+=_i(_-O*(M-F)*.5,w-P*(M-F)*.5,_-O*M,w-P*M,_+O*F,w+P*F,d,!0)+2:s.cap===vi.SQUARE&&(f+=jm(_,w,O,P,M,F,!0,d))),d.push(_-O*M,w-P*M,_+O*F,w+P*F);for(let q=1;q<p-1;++q){_=n[(q-1)*2],w=n[(q-1)*2+1],S=n[q*2],x=n[q*2+1],A=n[(q+1)*2],N=n[(q+1)*2+1],O=-(w-x),P=_-S,C=Math.sqrt(O*O+P*P),O/=C,P/=C,O*=g,P*=g,B=-(x-N),I=S-A,C=Math.sqrt(B*B+I*I),B/=C,I/=C,B*=g,I*=g;const X=S-_,G=w-x,D=S-A,L=N-x,U=X*D+G*L,H=G*D-L*X,Y=H<0;if(Math.abs(H)<.001*Math.abs(U)){d.push(S-O*M,x-P*M,S+O*F,x+P*F),U>=0&&(s.join===Fr.ROUND?f+=_i(S,x,S-O*M,x-P*M,S-B*M,x-I*M,d,!1)+4:f+=2,d.push(S-B*F,x-I*F,S+B*M,x+I*M));continue}const K=(-O+_)*(-P+x)-(-O+S)*(-P+w),j=(-B+A)*(-I+x)-(-B+S)*(-I+N),W=(X*j-D*K)/H,Q=(L*K-G*j)/H,tt=(W-S)*(W-S)+(Q-x)*(Q-x),rt=S+(W-S)*M,ct=x+(Q-x)*M,_t=S-(W-S)*F,yt=x-(Q-x)*F,Nt=Math.min(X*X+G*G,D*D+L*L),Ft=Y?M:F,ie=Nt+Ft*Ft*v,ne=tt<=ie;let nt=s.join;if(nt===Fr.MITER&&tt/v>b&&(nt=Fr.BEVEL),ne)switch(nt){case Fr.MITER:{d.push(rt,ct,_t,yt);break}case Fr.BEVEL:{Y?d.push(rt,ct,S+O*F,x+P*F,rt,ct,S+B*F,x+I*F):d.push(S-O*M,x-P*M,_t,yt,S-B*M,x-I*M,_t,yt),f+=2;break}case Fr.ROUND:{Y?(d.push(rt,ct,S+O*F,x+P*F),f+=_i(S,x,S+O*F,x+P*F,S+B*F,x+I*F,d,!0)+4,d.push(rt,ct,S+B*F,x+I*F)):(d.push(S-O*M,x-P*M,_t,yt),f+=_i(S,x,S-O*M,x-P*M,S-B*M,x-I*M,d,!1)+4,d.push(S-B*M,x-I*M,_t,yt));break}}else{switch(d.push(S-O*M,x-P*M,S+O*F,x+P*F),nt){case Fr.MITER:{Y?d.push(_t,yt,_t,yt):d.push(rt,ct,rt,ct),f+=2;break}case Fr.ROUND:{Y?f+=_i(S,x,S+O*F,x+P*F,S+B*F,x+I*F,d,!0)+2:f+=_i(S,x,S-O*M,x-P*M,S-B*M,x-I*M,d,!1)+2;break}}d.push(S-B*M,x-I*M,S+B*F,x+I*F),f+=2}}_=n[(p-2)*2],w=n[(p-2)*2+1],S=n[(p-1)*2],x=n[(p-1)*2+1],O=-(w-x),P=_-S,C=Math.sqrt(O*O+P*P),O/=C,P/=C,O*=g,P*=g,d.push(S-O*M,x-P*M,S+O*F,x+P*F),c||(s.cap===vi.ROUND?f+=_i(S-O*(M-F)*.5,x-P*(M-F)*.5,S-O*M,x-P*M,S+O*F,x+P*F,d,!1)+2:s.cap===vi.SQUARE&&(f+=jm(S,x,O,P,M,F,!1,d)));const $=t.indices,V=rs.epsilon*rs.epsilon;for(let q=m;q<f+m-2;++q)_=d[q*2],w=d[q*2+1],S=d[(q+1)*2],x=d[(q+1)*2+1],A=d[(q+2)*2],N=d[(q+2)*2+1],!(Math.abs(_*(x-N)+S*(N-w)+A*(w-x))<V)&&$.push(q,q+1,q+2)}function _S(e,t){let r=0;const n=e.shape,i=e.points||n.points,s=n.type!==Ue.POLY||n.closeStroke;if(i.length===0)return;const a=t.points,o=t.indices,c=i.length/2,h=a.length/2;let d=h;for(a.push(i[0],i[1]),r=1;r<c;r++)a.push(i[r*2],i[r*2+1]),o.push(d,d+1),d++;s&&o.push(d,h)}function $m(e,t){e.lineStyle.native?_S(e,t):vS(e,t)}class Hc{static curveLength(t,r,n,i,s,a){const o=t-2*n+s,c=r-2*i+a,h=2*n-2*t,d=2*i-2*r,p=4*(o*o+c*c),f=4*(o*h+c*d),m=h*h+d*d,g=2*Math.sqrt(p+f+m),v=Math.sqrt(p),b=2*p*v,_=2*Math.sqrt(m),w=f/v;return(b*g+v*f*(g-_)+(4*m*p-f*f)*Math.log((2*v+w+g)/(w+_)))/(4*b)}static curveTo(t,r,n,i,s){const a=s[s.length-2],o=s[s.length-1],c=rs._segmentsCount(Hc.curveLength(a,o,t,r,n,i));let h=0,d=0;for(let p=1;p<=c;++p){const f=p/c;h=a+(t-a)*f,d=o+(r-o)*f,s.push(h+(t+(n-t)*f-h)*f,d+(r+(i-r)*f-d)*f)}}}const Gc={[Ue.POLY]:Dm,[Ue.CIRC]:Do,[Ue.ELIP]:Do,[Ue.RECT]:mS,[Ue.RREC]:gS},zm=[],Uo=[];class jo{constructor(t,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=t.type}clone(){return new jo(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 ns=new xt,Hm=class extends kp{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 Oo,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 e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Uo.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t.reset(),zm.push(t)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,r=null,n=null){const i=new jo(e,t,r,n);return this.graphicsData.push(i),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const r=new jo(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].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(e){const t=this.graphicsData;for(let r=0;r<t.length;++r){const n=t[r];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(e,ns):ns.copyFrom(e),n.shape.contains(ns.x,ns.y))){let i=!1;if(n.holes){for(let s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(ns.x,ns.y)){i=!0;break}}if(!i)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const e=this.uvs,t=this.graphicsData;let r=null,n=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],n=r.style);for(let o=this.shapeIndex;o<t.length;o++){this.shapeIndex++;const c=t[o],h=c.fillStyle,d=c.lineStyle;Gc[c.type].build(c),c.matrix&&this.transformPoints(c.points,c.matrix),(h.visible||d.visible)&&this.processHoles(c.holes);for(let f=0;f<2;f++){const m=f===0?h:d;if(!m.visible)continue;const g=m.texture.baseTexture,v=this.indices.length,b=this.points.length/2;g.wrapMode=gn.REPEAT,f===0?this.processFill(c):this.processLine(c);const _=this.points.length/2-b;_!==0&&(r&&!this._compareStyles(n,m)&&(r.end(v,b),r=null),r||(r=zm.pop()||new yS,r.begin(m,v,b),this.batches.push(r),n=m),this.addUvs(this.points,e,m.texture,b,_,m.matrix))}}const i=this.indices.length,s=this.points.length/2;if(r&&r.end(i,s),this.batches.length===0){this.batchable=!0;return}const a=s>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(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e<t;e++){const r=this.graphicsData[e],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let t=0,r=e.length;t<r;t++){const n=e[t];for(let i=0;i<n.size;i++){const s=n.start+i;this.indicesUint16[s]=this.indicesUint16[s]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<Hm.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++Ht._globalBatch;for(let d=0;d<this.drawCalls.length;d++)this.drawCalls[d].texArray.clear(),Uo.push(this.drawCalls[d]);this.drawCalls.length=0;const t=this.colors,r=this.textureIds;let n=Uo.pop();n||(n=new gc,n.texArray=new xc),n.texArray.count=0,n.start=0,n.size=0,n.type=Cr.TRIANGLES;let i=0,s=null,a=0,o=!1,c=Cr.TRIANGLES,h=0;this.drawCalls.push(n);for(let d=0;d<this.batches.length;d++){const p=this.batches[d],f=8,m=p.style,g=m.texture.baseTexture;o!==!!m.native&&(o=!!m.native,c=o?Cr.LINES:Cr.TRIANGLES,s=null,i=f,e++),s!==g&&(s=g,g._batchEnabled!==e&&(i===f&&(e++,i=0,n.size>0&&(n=Uo.pop(),n||(n=new gc,n.texArray=new xc),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=c),g.touched=1,g._batchEnabled=e,g._batchLocation=i,g.wrapMode=gn.REPEAT,n.texArray.elements[n.texArray.count++]=g,i++)),n.size+=p.size,h+=p.size,a=g._batchLocation,this.addColors(t,m.color,m.alpha,p.attribSize,p.attribStart),this.addTextureIds(r,a,p.attribSize,p.attribStart)}Ht._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(e.length*3*4),s=new Float32Array(i),a=new Uint32Array(i);let o=0;for(let c=0;c<e.length/2;c++)s[o++]=e[c*2],s[o++]=e[c*2+1],s[o++]=t[c*2],s[o++]=t[c*2+1],a[o++]=r[c],s[o++]=n[c];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?Dm.triangulate(e,this):Gc[e.type].triangulate(e,this)}processLine(e){$m(e,this);for(let t=0;t<e.holes.length;t++)$m(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];Gc[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,t){for(let r=0;r<e.length/2;r++){const n=e[r*2],i=e[r*2+1];e[r*2]=t.a*n+t.c*i+t.tx,e[r*2+1]=t.b*n+t.d*i+t.ty}}addColors(e,t,r,n,i=0){const s=ae.shared.setValue(t).toLittleEndianNumber(),a=ae.shared.setValue(s).toPremultiplied(r);e.length=Math.max(e.length,i+n);for(let o=0;o<n;o++)e[i+o]=a}addTextureIds(e,t,r,n=0){e.length=Math.max(e.length,n+r);for(let i=0;i<r;i++)e[n+i]=t}addUvs(e,t,r,n,i,s=null){let a=0;const o=t.length,c=r.frame;for(;a<i;){let d=e[(n+a)*2],p=e[(n+a)*2+1];if(s){const f=s.a*d+s.c*p+s.tx;p=s.b*d+s.d*p+s.ty,d=f}a++,t.push(d/c.width,p/c.height)}const h=r.baseTexture;(c.width<h.width||c.height<h.height)&&this.adjustUvs(t,r,o,i)}adjustUvs(e,t,r,n){const i=t.baseTexture,s=1e-6,a=r+n*2,o=t.frame,c=o.width/i.width,h=o.height/i.height;let d=o.x/o.width,p=o.y/o.height,f=Math.floor(e[r]+s),m=Math.floor(e[r+1]+s);for(let g=r+2;g<a;g+=2)f=Math.min(f,Math.floor(e[g]+s)),m=Math.min(m,Math.floor(e[g+1]+s));d-=f,p-=m;for(let g=r;g<a;g+=2)e[g]=(e[g]+d)*c,e[g+1]=(e[g+1]+p)*h}};let Gm=Hm;Gm.BATCHABLE_SIZE=100;class $o{constructor(){this.color=16777215,this.alpha=1,this.texture=Tt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new $o;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=Tt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class qc extends $o{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=vi.BUTT,this.join=Fr.MITER,this.miterLimit=10}clone(){const t=new qc;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}}const Vc={},zo=class extends Ke{constructor(e=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 $o,this._lineStyle=new qc,this._matrix=null,this._holeMode=!1,this.state=ci.for2d(),this._geometry=e||new Gm,this._geometry.refCount++,this._transformID=-1,this._tintColor=new ae(16777215),this.blendMode=Lt.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new zo(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,t=0,r,n=.5,i=!1){return typeof e=="number"&&(e={width:e,color:t,alpha:r,alignment:n,native:i}),this.lineTextureStyle(e)}lineTextureStyle(e){const t={width:0,texture:Tt.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:vi.BUTT,join:Fr.MITER,miterLimit:10};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.width>0&&e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:r},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new Xi,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Xi,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(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return(n!==e||i!==t)&&r.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,r,n){this._initCurve();const i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),Hc.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),zc.curveTo(e,t,r,n,i,s,this.currentPath.points),this}arcTo(e,t,r,n,i){this._initCurve(e,t);const s=this.currentPath.points,a=Um.curveTo(e,t,r,n,i,s);if(a){const{cx:o,cy:c,radius:h,startAngle:d,endAngle:p,anticlockwise:f}=a;this.arc(o,c,h,d,p,f)}return this}arc(e,t,r,n,i,s=!1){if(n===i)return this;if(!s&&i<=n?i+=uo:s&&n<=i&&(n+=uo),i-n===0)return this;const o=e+Math.cos(n)*r,c=t+Math.sin(n)*r,h=this._geometry.closePointEps;let d=this.currentPath?this.currentPath.points:null;if(d){const p=Math.abs(d[d.length-2]-o),f=Math.abs(d[d.length-1]-c);p<h&&f<h||d.push(o,c)}else this.moveTo(o,c),d=this.currentPath.points;return Um.arc(o,c,e,t,r,n,i,s,d),this}beginFill(e=0,t){return this.beginTextureFill({texture:Tt.WHITE,color:e,alpha:t})}normalizeColor(e){const t=ae.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??(e.alpha=t.alpha)}beginTextureFill(e){const t={texture:Tt.WHITE,color:16777215,matrix:null};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:r},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,r,n){return this.drawShape(new Vt(e,t,r,n))}drawRoundedRect(e,t,r,n,i){return this.drawShape(new vc(e,t,r,n,i))}drawCircle(e,t,r){return this.drawShape(new yc(e,t,r))}drawEllipse(e,t,r,n){return this.drawShape(new _x(e,t,r,n))}drawPolygon(...e){let t,r=!0;const n=e[0];n.points?(r=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const i=new Xi(t);return i.closeStroke=r,this.drawShape(i),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,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 e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Ue.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,r=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(e.points);for(let n=0;n<r;n++){const i=e.batches[n],s=i.style.color,a=new Float32Array(this.vertexData.buffer,i.attribStart*4*2,i.attribSize*2),o=new Float32Array(e.uvsFloat32.buffer,i.attribStart*4*2,i.attribSize*2),c=new Uint16Array(e.indicesUint16.buffer,i.start*2,i.size),h={vertexData:a,blendMode:t,indices:c,uvs:o,_batchRGB:ae.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=h}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let t=0,r=this.batches.length;t<r;t++){const n=this.batches[t];n.worldAlpha=this.worldAlpha*n.alpha,e.plugins[this.pluginName].render(n)}}}_renderDirect(e){const t=this._resolveDirectShader(e),r=this._geometry,n=this.worldAlpha,i=t.uniforms,s=r.drawCalls;i.translationMatrix=this.transform.worldTransform,ae.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),e.shader.bind(t),e.geometry.bind(r,t),e.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(e,r.drawCalls[a])}_renderDrawCallDirect(e,t){const{texArray:r,type:n,size:i,start:s}=t,a=r.count;for(let o=0;o<a;o++)e.texture.bind(r.elements[o],o);e.geometry.draw(n,i,s)}_resolveDirectShader(e){let t=this.shader;const r=this.pluginName;if(!t){if(!Vc[r]){const{maxTextures:n}=e.plugins[r],i=new Int32Array(n);for(let o=0;o<n;o++)i[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new ee,default:Rr.from({uSamplers:i},!0)},a=e.plugins[r]._shader.program;Vc[r]=new tn(a,s)}t=Vc[r]}return t}_calculateBounds(){this.finishPoly();const e=this._geometry;if(!e.graphicsData.length)return;const{minX:t,minY:r,maxX:n,maxY:i}=e.bounds;this._bounds.addFrame(this.transform,t,r,n,i)}containsPoint(e){return this.worldTransform.applyInverse(e,zo._TEMP_POINT),this._geometry.containsPoint(zo._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t._tintRGB=ae.shared.setValue(this._tintColor).multiply(t._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;const t=this.transform.worldTransform,r=t.a,n=t.b,i=t.c,s=t.d,a=t.tx,o=t.ty,c=this._geometry.points,h=this.vertexData;let d=0;for(let p=0;p<c.length;p+=2){const f=c[p],m=c[p+1];h[d++]=r*f+i*m+a,h[d++]=s*m+n*f+o}}closePath(){const e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){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(e)}};let mr=zo;mr.curves=rs,mr._TEMP_POINT=new xt;class bS extends Mo{constructor(t=100,r=100,n=10,i=10){super(),this.segWidth=n,this.segHeight=i,this.width=t,this.height=r,this.build()}build(){const t=this.segWidth*this.segHeight,r=[],n=[],i=[],s=this.segWidth-1,a=this.segHeight-1,o=this.width/s,c=this.height/a;for(let d=0;d<t;d++){const p=d%this.segWidth,f=d/this.segWidth|0;r.push(p*o,f*c),n.push(p/s,f/a)}const h=s*a;for(let d=0;d<h;d++){const p=d%s,f=d/s|0,m=f*this.segWidth+p,g=f*this.segWidth+p+1,v=(f+1)*this.segWidth+p,b=(f+1)*this.segWidth+p+1;i.push(m,g,v,g,b,v)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(n),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}}class xS extends Mo{constructor(t=200,r,n=0){super(new Float32Array(r.length*4),new Float32Array(r.length*4),new Uint16Array((r.length-1)*6)),this.points=r,this._width=t,this.textureScale=n,this.build()}get width(){return this._width}build(){const t=this.points;if(!t)return;const r=this.getBuffer("aVertexPosition"),n=this.getBuffer("aTextureCoord"),i=this.getIndex();if(t.length<1)return;r.data.length/4!==t.length&&(r.data=new Float32Array(t.length*4),n.data=new Float32Array(t.length*4),i.data=new Uint16Array((t.length-1)*6));const s=n.data,a=i.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;let o=0,c=t[0];const h=this._width*this.textureScale,d=t.length;for(let f=0;f<d;f++){const m=f*4;if(this.textureScale>0){const g=c.x-t[f].x,v=c.y-t[f].y,b=Math.sqrt(g*g+v*v);c=t[f],o+=b/h}else o=f/(d-1);s[m]=o,s[m+1]=0,s[m+2]=o,s[m+3]=1}let p=0;for(let f=0;f<d-1;f++){const m=f*2;a[p++]=m,a[p++]=m+1,a[p++]=m+2,a[p++]=m+2,a[p++]=m+1,a[p++]=m+3}n.update(),i.update(),this.updateVertices()}updateVertices(){const t=this.points;if(t.length<1)return;let r=t[0],n,i=0,s=0;const a=this.buffers[0].data,o=t.length,c=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let h=0;h<o;h++){const d=t[h],p=h*4;h<t.length-1?n=t[h+1]:n=d,s=-(n.x-r.x),i=n.y-r.y;const f=Math.sqrt(i*i+s*s);f<1e-6?(i=0,s=0):(i/=f,s/=f,i*=c,s*=c),a[p]=d.x+i,a[p+1]=d.y+s,a[p+2]=d.x-i,a[p+3]=d.y-s,r=d}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class wS extends es{constructor(t,r,n){const i=new bS(t.width,t.height,r,n),s=new ra(Tt.WHITE);super(i,s),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:r,height:n}=this.shader.texture;this.autoResize&&(t.width!==r||t.height!==n)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}const Ho=10;class SS extends wS{constructor(t,r,n,i,s){var a,o,c,h;super(Tt.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=r??((a=t.defaultBorders)==null?void 0:a.left)??Ho,this._rightWidth=i??((o=t.defaultBorders)==null?void 0:o.right)??Ho,this._topHeight=n??((c=t.defaultBorders)==null?void 0:c.top)??Ho,this._bottomHeight=s??((h=t.defaultBorders)==null?void 0:h.bottom)??Ho,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,r=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,r=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t,n=this._topHeight+this._bottomHeight,i=this._height>n?1:this._height/n;return Math.min(r,i)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,r=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const n=1/this._origWidth,i=1/this._origHeight;r[0]=r[8]=r[16]=r[24]=0,r[1]=r[3]=r[5]=r[7]=0,r[6]=r[14]=r[22]=r[30]=1,r[25]=r[27]=r[29]=r[31]=1,r[2]=r[10]=r[18]=r[26]=n*this._leftWidth,r[4]=r[12]=r[20]=r[28]=1-n*this._rightWidth,r[9]=r[11]=r[13]=r[15]=i*this._topHeight,r[17]=r[19]=r[21]=r[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class TS extends es{constructor(t=Tt.EMPTY,r,n,i,s){const a=new Mo(r,n,i);a.getBuffer("aVertexPosition").static=!1;const o=new ra(t);super(a,o,null,s),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class ES extends es{constructor(t,r,n=0){const i=new xS(t.height,r,n),s=new ra(t);n>0&&(t.baseTexture.wrapMode=gn.REPEAT),super(i,s),this.autoUpdate=!0}_render(t){const r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),super._render(t)}}class AS extends Ke{constructor(t=1500,r,n=16384,i=!1){super();const s=16384;n>s&&(n=s),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=n,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=Lt.NORMAL,this.autoResize=i,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tintColor=new ae(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const r=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.length<r;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[r]=++this._updateID}dispose(){if(this._buffers){for(let t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}}destroy(t){super.destroy(t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}class qm{constructor(t,r,n){this.geometry=new Un,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(let i=0;i<t.length;++i){let s=t[i];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||Ut.FLOAT,offset:s.offset},r[i]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const t=this.geometry;let r=0;this.indexBuffer=new Oe(rx(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];o.offset=r,r+=o.size,this.dynamicStride+=o.size}const n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new Oe(this.dynamicData,!1,!1);let i=0;this.staticStride=0;for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];o.offset=i,i+=o.size,this.staticStride+=o.size}const s=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Oe(this.staticData,!0,!1);for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];t.addAttribute(o.attributeName,this.dynamicBuffer,0,o.type===Ut.UNSIGNED_BYTE,o.type,this.dynamicStride*4,o.offset*4)}for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];t.addAttribute(o.attributeName,this.staticBuffer,0,o.type===Ut.UNSIGNED_BYTE,o.type,this.staticStride*4,o.offset*4)}}uploadDynamic(t,r,n){for(let i=0;i<this.dynamicProperties.length;i++){const s=this.dynamicProperties[i];s.uploadFunction(t,r,n,s.type===Ut.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,s.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,r,n){for(let i=0;i<this.staticProperties.length;i++){const s=this.staticProperties[i];s.uploadFunction(t,r,n,s.type===Ut.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,s.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}var CS=`varying vec2 vTextureCoord;
636
- varying vec4 vColor;
637
-
638
- uniform sampler2D uSampler;
639
-
640
- void main(void){
641
- vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
642
- gl_FragColor = color;
643
- }`,OS=`attribute vec2 aVertexPosition;
644
- attribute vec2 aTextureCoord;
645
- attribute vec4 aColor;
646
-
647
- attribute vec2 aPositionCoord;
648
- attribute float aRotation;
649
-
650
- uniform mat3 translationMatrix;
651
- uniform vec4 uColor;
652
-
653
- varying vec2 vTextureCoord;
654
- varying vec4 vColor;
655
-
656
- void main(void){
657
- float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
658
- float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
659
-
660
- vec2 v = vec2(x, y);
661
- v = v + aPositionCoord;
662
-
663
- gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
664
-
665
- vTextureCoord = aTextureCoord;
666
- vColor = aColor * uColor;
667
- }
668
- `;class Vm extends go{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new ee,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:Ut.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=tn.from(OS,CS,{}),this.state=ci.for2d()}render(t){const r=t.children,n=t._maxSize,i=t._batchSize,s=this.renderer;let a=r.length;if(a===0)return;a>n&&!t.autoResize&&(a=n);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const c=r[0]._texture.baseTexture,h=c.alphaMode>0;this.state.blendMode=bp(t.blendMode,h),s.state.set(this.state);const d=s.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=ae.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,h).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);let f=!1;for(let m=0,g=0;m<a;m+=i,g+=1){let v=a-m;v>i&&(v=i),g>=o.length&&o.push(this._generateOneMoreBuffer(t));const b=o[g];b.uploadDynamic(r,m,v);const _=t._bufferUpdateIDs[g]||0;f=f||b._updateID<_,f&&(b._updateID=t._updateID,b.uploadStatic(r,m,v)),s.geometry.bind(b.geometry),d.drawElements(d.TRIANGLES,v*6,d.UNSIGNED_SHORT,0)}}generateBuffers(t){const r=[],n=t._maxSize,i=t._batchSize,s=t._properties;for(let a=0;a<n;a+=i)r.push(new qm(this.properties,s,i));return r}_generateOneMoreBuffer(t){const r=t._batchSize,n=t._properties;return new qm(this.properties,n,r)}uploadVertices(t,r,n,i,s,a){let o=0,c=0,h=0,d=0;for(let p=0;p<n;++p){const f=t[r+p],m=f._texture,g=f.scale.x,v=f.scale.y,b=m.trim,_=m.orig;b?(c=b.x-f.anchor.x*_.width,o=c+b.width,d=b.y-f.anchor.y*_.height,h=d+b.height):(o=_.width*(1-f.anchor.x),c=_.width*-f.anchor.x,h=_.height*(1-f.anchor.y),d=_.height*-f.anchor.y),i[a]=c*g,i[a+1]=d*v,i[a+s]=o*g,i[a+s+1]=d*v,i[a+s*2]=o*g,i[a+s*2+1]=h*v,i[a+s*3]=c*g,i[a+s*3+1]=h*v,a+=s*4}}uploadPosition(t,r,n,i,s,a){for(let o=0;o<n;o++){const c=t[r+o].position;i[a]=c.x,i[a+1]=c.y,i[a+s]=c.x,i[a+s+1]=c.y,i[a+s*2]=c.x,i[a+s*2+1]=c.y,i[a+s*3]=c.x,i[a+s*3+1]=c.y,a+=s*4}}uploadRotation(t,r,n,i,s,a){for(let o=0;o<n;o++){const c=t[r+o].rotation;i[a]=c,i[a+s]=c,i[a+s*2]=c,i[a+s*3]=c,a+=s*4}}uploadUvs(t,r,n,i,s,a){for(let o=0;o<n;++o){const c=t[r+o]._texture._uvs;c?(i[a]=c.x0,i[a+1]=c.y0,i[a+s]=c.x1,i[a+s+1]=c.y1,i[a+s*2]=c.x2,i[a+s*2+1]=c.y2,i[a+s*3]=c.x3,i[a+s*3+1]=c.y3,a+=s*4):(i[a]=0,i[a+1]=0,i[a+s]=0,i[a+s+1]=0,i[a+s*2]=0,i[a+s*2+1]=0,i[a+s*3]=0,i[a+s*3+1]=0,a+=s*4)}}uploadTint(t,r,n,i,s,a){for(let o=0;o<n;++o){const c=t[r+o],h=ae.shared.setValue(c._tintRGB).toPremultiplied(c.alpha);i[a]=h,i[a+s]=h,i[a+s*2]=h,i[a+s*3]=h,a+=s*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Vm.extension={name:"particle",type:Et.RendererPlugin},Bt.add(Vm);class aa extends yi{constructor(t,r=!0){super(t[0]instanceof Tt?t[0]:t[0].texture),this._textures=null,this._durations=null,this._autoUpdate=r,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=t}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(me.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(me.shared.add(this.update,this,Qi.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const r=this.animationSpeed*t,n=this.currentFrame;if(this._durations!==null){let i=this._currentTime%1*this._durations[this.currentFrame];for(i+=r/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];const s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=r;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<n||this.animationSpeed<0&&this.currentFrame>n)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const r=[];for(let n=0;n<t.length;++n)r.push(Tt.from(t[n]));return new aa(r)}static fromImages(t){const r=[];for(let n=0;n<t.length;++n)r.push(Tt.from(t[n]));return new aa(r)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof Tt)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let r=0;r<t.length;r++)this._textures.push(t[r].texture),this._durations.push(t[r].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const r=this.currentFrame;this._currentTime=t,r!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(me.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(me.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const oa=new xt;class Wc extends yi{constructor(t,r=100,n=100){super(t),this.tileTransform=new Ws,this._width=r,this._height=n,this.uvMatrix=this.texture.uvMatrix||new Ec(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const r=this._texture;!r||!r.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,r=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,r,n,i)}getLocalBounds(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Vt),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,oa);const r=this._width,n=this._height,i=-r*this.anchor._x;if(oa.x>=i&&oa.x<i+r){const s=-n*this.anchor._y;if(oa.y>=s&&oa.y<s+n)return!0}return!1}destroy(t){super.destroy(t),this.tileTransform=null,this.uvMatrix=null}static from(t,r){const n=t instanceof Tt?t:Tt.from(t,r);return new Wc(n,r.width,r.height)}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}}var PS=`#version 300 es
669
- #define SHADER_NAME Tiling-Sprite-100
670
-
671
- precision lowp float;
672
-
673
- in vec2 vTextureCoord;
674
-
675
- out vec4 fragmentColor;
676
-
677
- uniform sampler2D uSampler;
678
- uniform vec4 uColor;
679
- uniform mat3 uMapCoord;
680
- uniform vec4 uClampFrame;
681
- uniform vec2 uClampOffset;
682
-
683
- void main(void)
684
- {
685
- vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
686
- coord = (uMapCoord * vec3(coord, 1.0)).xy;
687
- vec2 unclamped = coord;
688
- coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
689
-
690
- vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
691
-
692
- fragmentColor = texSample * uColor;
693
- }
694
- `,IS=`#version 300 es
695
- #define SHADER_NAME Tiling-Sprite-300
696
-
697
- precision lowp float;
698
-
699
- in vec2 aVertexPosition;
700
- in vec2 aTextureCoord;
701
-
702
- uniform mat3 projectionMatrix;
703
- uniform mat3 translationMatrix;
704
- uniform mat3 uTransform;
705
-
706
- out vec2 vTextureCoord;
707
-
708
- void main(void)
709
- {
710
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
711
-
712
- vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
713
- }
714
- `,kS=`#version 100
715
- #ifdef GL_EXT_shader_texture_lod
716
- #extension GL_EXT_shader_texture_lod : enable
717
- #endif
718
- #define SHADER_NAME Tiling-Sprite-100
719
-
720
- precision lowp float;
721
-
722
- varying vec2 vTextureCoord;
723
-
724
- uniform sampler2D uSampler;
725
- uniform vec4 uColor;
726
- uniform mat3 uMapCoord;
727
- uniform vec4 uClampFrame;
728
- uniform vec2 uClampOffset;
729
-
730
- void main(void)
731
- {
732
- vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
733
- coord = (uMapCoord * vec3(coord, 1.0)).xy;
734
- vec2 unclamped = coord;
735
- coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
736
-
737
- #ifdef GL_EXT_shader_texture_lod
738
- vec4 texSample = unclamped == coord
739
- ? texture2D(uSampler, coord)
740
- : texture2DLodEXT(uSampler, coord, 0);
741
- #else
742
- vec4 texSample = texture2D(uSampler, coord);
743
- #endif
744
-
745
- gl_FragColor = texSample * uColor;
746
- }
747
- `,Wm=`#version 100
748
- #define SHADER_NAME Tiling-Sprite-100
749
-
750
- precision lowp float;
751
-
752
- attribute vec2 aVertexPosition;
753
- attribute vec2 aTextureCoord;
754
-
755
- uniform mat3 projectionMatrix;
756
- uniform mat3 translationMatrix;
757
- uniform mat3 uTransform;
758
-
759
- varying vec2 vTextureCoord;
760
-
761
- void main(void)
762
- {
763
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
764
-
765
- vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
766
- }
767
- `,RS=`#version 100
768
- #define SHADER_NAME Tiling-Sprite-Simple-100
769
-
770
- precision lowp float;
771
-
772
- varying vec2 vTextureCoord;
773
-
774
- uniform sampler2D uSampler;
775
- uniform vec4 uColor;
776
-
777
- void main(void)
778
- {
779
- vec4 texSample = texture2D(uSampler, vTextureCoord);
780
- gl_FragColor = texSample * uColor;
781
- }
782
- `;const Go=new ee;class Xm extends go{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new Yp,this.state=ci.for2d()}contextChange(){const t=this.renderer,r={globals:t.globalUniforms};this.simpleShader=tn.from(Wm,RS,r),this.shader=t.context.webGLVersion>1?tn.from(IS,PS,r):tn.from(Wm,kS,r)}render(t){const r=this.renderer,n=this.quad;let i=n.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y);const s=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;i=n.uvs,i[0]=i[6]=-s,i[1]=i[3]=-a,i[2]=i[4]=1-s,i[5]=i[7]=1-a,n.invalidate();const o=t._texture,c=o.baseTexture,h=c.alphaMode>0,d=t.tileTransform.localTransform,p=t.uvMatrix;let f=c.isPowerOfTwo&&o.frame.width===c.width&&o.frame.height===c.height;f&&(c._glTextures[r.CONTEXT_UID]?f=c.wrapMode!==gn.CLAMP:c.wrapMode===gn.CLAMP&&(c.wrapMode=gn.REPEAT));const m=f?this.simpleShader:this.shader,g=o.width,v=o.height,b=t._width,_=t._height;Go.set(d.a*g/b,d.b*g/_,d.c*v/b,d.d*v/_,d.tx/b,d.ty/_),Go.invert(),f?Go.prepend(p.mapCoord):(m.uniforms.uMapCoord=p.mapCoord.toArray(!0),m.uniforms.uClampFrame=p.uClampFrame,m.uniforms.uClampOffset=p.uClampOffset),m.uniforms.uTransform=Go.toArray(!0),m.uniforms.uColor=ae.shared.setValue(t.tint).premultiply(t.worldAlpha,h).toArray(m.uniforms.uColor),m.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),m.uniforms.uSampler=o,r.shader.bind(m),r.geometry.bind(n),this.state.blendMode=bp(t.blendMode,h),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Xm.extension={name:"tilingSprite",type:Et.RendererPlugin},Bt.add(Xm);const Xc=class{constructor(e){this.stage=new Ke,e=Object.assign({forceCanvas:!1},e),this.renderer=mw(e),Xc._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer.view}get screen(){return this.renderer.screen}destroy(e,t){const r=Xc._plugins.slice(0);r.reverse(),r.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};let la=Xc;la._plugins=[],Bt.handleByList(Et.Application,la._plugins);class Ym{static init(t){Object.defineProperty(this,"resizeTo",{set(r){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=r,r&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let r,n;if(this._resizeTo===globalThis.window)r=globalThis.innerWidth,n=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;r=i,n=s}this.renderer.resize(r,n),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Ym.extension=Et.Application,Bt.add(Ym);var Km={exports:{}},NS="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",MS=NS,LS=MS;function Zm(){}function Qm(){}Qm.resetWarningCache=Zm;var BS=function(){function e(n,i,s,a,o,c){if(c!==LS){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Qm,resetWarningCache:Zm};return r.PropTypes=r,r};Km.exports=BS();var FS=Km.exports;const oe=ni(FS);function ar(e){return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(e)}function Jm(e){var t=function(r,n){if(ar(r)!=="object"||r===null)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var s=i.call(r,n||"default");if(ar(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}(e,"string");return ar(t)==="symbol"?t:String(t)}function xe(e,t,r){return(t=Jm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tn(e){return function(t){if(Array.isArray(t))return Yc(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,r){if(t){if(typeof t=="string")return Yc(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yc(t,r):void 0}}(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
783
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _e(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]}var DS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function US(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jS=function(e){return e==null};function ua(e){var t=[];if(e===void 0)return t;if(typeof e=="string")t=e.split(",");else if(typeof e=="number")t=[e];else if(Array.isArray(e))t=Tn(e);else{if(e===null||ar(e)!=="object")return t;t=[e&&(e==null?void 0:e.x)||0,e&&(e==null?void 0:e.y)||0]}return t.filter(function(r){return!jS(r)&&!isNaN(r)}).map(Number)}function tg(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Kc(e){return e instanceof xt||e instanceof Jr}var qo=["click","mousedown","mousemove","mouseout","mouseover","mouseup","mouseupoutside","tap","touchstart","touchmove","touchend","touchendoutside","pointercancel","pointerout","pointerover","pointertap","pointerdown","pointerup","pointerupoutside","pointermove","rightclick","rightdown","rightup","rightupoutside","touchcancel","touchendoutside","touchmove","touchstart"];function Zc(e,t,r){if(Kc(e[t])&&Kc(r))e[t].copyFrom(r);else if(Kc(e[t])){var n=ua(r);_e(n!==void 0&&n.length>0&&n.length<3,"The property `%s` is a `PIXI.Point` or `PIXI.ObservablePoint` and must be set to a comma-separated string of either 1 or 2 coordinates, a 1 or 2 element array containing coordinates, or a PIXI Point/ObservablePoint. If only one coordinate is given then X and Y will be set to the provided value. Received: `%s` of type `%s`.",t,JSON.stringify(r),ar(r)),e[t].set(n.shift(),n.shift())}else e[t]=r}var is,eg=function(e){var t,r=e;if(!Array.isArray(r)){if(t=e,Object.prototype.toString.call(t)!=="[object Object]")throw new Error("collection needs to be an Array or Object");r=Object.keys(e)}var n={};return r.forEach(function(i){n[i]=!0}),function(i){return n[i]!==void 0}},rg=function(e){return function(){return!e.apply(void 0,arguments)}},Qc="children",$S=(xe(is={},Qc,!0),xe(is,"parent",!0),xe(is,"worldAlpha",!0),xe(is,"worldTransform",!0),xe(is,"worldVisible",!0),is),Jc={alpha:1,buttonMode:!1,cacheAsBitmap:!1,cursor:null,filterArea:null,filters:null,hitArea:null,interactive:!1,mask:null,pivot:0,position:0,renderable:!0,rotation:0,scale:1,skew:0,transform:null,visible:!0,x:0,y:0},en=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=function(o){return requestAnimationFrame(function(){var c,h;o==null||(c=o.__reactpixi)===null||c===void 0||(h=c.root)===null||h===void 0||h.emit("__REACT_PIXI_REQUEST_RENDER__")})},i=function(o,c){if(r.hasOwnProperty(o))return _e(c.typeofs.some(function(h){return ar(r[o])===h})||c.instanceofs.some(function(h){return r[o]instanceof h}),"".concat(e," ").concat(o," prop is invalid")),r[o]};if(r.texture)return _e(r.texture instanceof Tt,"".concat(e," texture needs to be typeof `Texture`")),r.texture;var s=i("image",{typeofs:["string"],instanceofs:[HTMLImageElement]})||i("video",{typeofs:["string"],instanceofs:[HTMLVideoElement]})||i("source",{typeofs:["string","number"],instanceofs:[HTMLImageElement,HTMLVideoElement,HTMLCanvasElement,Tt]});_e(!!s,"".concat(e," could not get texture from props"));var a=Tt.from(s);return a.__reactpixi={root:t},a.once("update",n),a.once("loaded",n),a.valid&&n(a),a},zS=rg(eg([].concat(Tn(Object.keys($S)),Tn(qo))));function rn(e,t,r){var n=!1;if(_e(gi.prototype.isPrototypeOf(e),"instance needs to be typeof `DisplayObject`, got `%s`",ar(e)),!r.ignoreEvents)for(var i=typeof e.removeListener=="function",s=typeof e.on=="function",a=0;a<qo.length;a++){var o=qo[a];t[o]!==r[o]&&(n=!0,typeof t[o]=="function"&&i&&e.removeListener(o,t[o]),typeof r[o]=="function"&&s&&e.on(o,r[o]))}var c=Object.keys(r||{});if(r.overwriteProps){for(var h=0;h<c.length;h++){var d=c[h];t[d]!==r[d]&&(n=!0,Zc(e,d,r[d]))}return n}for(var p=c.filter(zS),f=0;f<p.length;f++){var m=p[f],g=r[m];r[m]!==t[m]&&(n=!0),g!==void 0?Zc(e,m,g):m in Jc?(console.warn("setting default value: ".concat(m,", from: ").concat(e[m]," to: ").concat(g," for"),e),n=!0,Zc(e,m,Jc[m])):console.warn("ignoring prop: ".concat(m,", from ").concat(e[m]," to ").concat(g," for"),e)}return n}var HS=function(e,t){var r=t.text,n=t.style;return new Im(r,n)},GS=function(){return new Ke};function zn(e,t){if(e==null)return{};var r,n,i=function(a,o){if(a==null)return{};var c,h,d={},p=Object.keys(a);for(h=0;h<p.length;h++)c=p[h],o.indexOf(c)>=0||(d[c]=a[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var qS=["draw","geometry"],VS=function(e,t){var r=t.geometry;_e(!r||r instanceof mr,"Graphics geometry needs to be a `PIXI.Graphics`");var n=r?new mr(r.geometry):new mr;return n.applyProps=function(i,s,a){var o=a.draw;a.geometry;var c=rn(i,s,zn(a,qS));return s.draw!==o&&typeof o=="function"&&(c=!0,o.call(n,n)),c},n},WS=["image","texture"],XS=function(e,t){var r=t.leftWidth,n=r===void 0?10:r,i=t.topHeight,s=i===void 0?10:i,a=t.rightWidth,o=a===void 0?10:a,c=t.bottomHeight,h=c===void 0?10:c,d=en("NineSlicePlane",e,t),p=new SS(d,n,s,o,h);return p.applyProps=function(f,m,g){var v=g.image,b=g.texture,_=rn(f,m,zn(g,WS));return(v||b)&&(b!==m.texture&&(_=!0),f.texture=en("NineSlicePlane",e,g)),_},p};function ng(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ng(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ng(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var YS=function(e,t){var r=t.maxSize,n=r===void 0?1500:r,i=t.batchSize,s=i===void 0?16384:i,a=t.autoResize,o=a!==void 0&&a,c=Vo(Vo({},{vertices:!1,scale:!0,position:!0,rotation:!0,uvs:!0,tint:!0}),t.properties||{}),h=Vo(Vo({},{children:!1,texture:!1,baseTexture:!1}),t.destroyOptions||{}),d=new AS(n,c,s,o);return d.willUnmount=function(p,f,m){p.destroy(h)},d},KS=["image","texture"],ZS=function(e,t){var r=new yi(en("Sprite",e,t));return r.applyProps=function(n,i,s){var a=s.image,o=s.texture,c=rn(n,i,zn(s,KS));return(o&&i.texture!==s.texture||a&&i.image!==s.image)&&(i.texture!==s.texture&&(c=!0),n.texture=en("Sprite",e,s)),c},r},QS=["textures","isPlaying","initialFrame"],JS=function(e,t){var r=t.textures,n=t.images,i=t.isPlaying,s=i===void 0||i,a=t.initialFrame,o=function(h){return h.map(function(d){return _e(d instanceof Tt||(d==null?void 0:d.texture),"AnimationSprite texture needs to be an array of `PIXI.Texture` or `{ texture: PIXI.Texture, time:\n number }`"),d})},c=n?aa.fromImages(n):new aa(o(r));return c[s?"gotoAndPlay":"gotoAndStop"](a||0),c.applyProps=function(h,d,p){var f=p.textures,m=p.isPlaying,g=p.initialFrame,v=rn(h,d,zn(p,QS));if(f&&d.textures!==f&&(h.textures=o(f),v=!0),m!==d.isPlaying||g!==d.initialFrame){var b=typeof g=="number"?g:c.currentFrame||0;c[m?"gotoAndPlay":"gotoAndStop"](b),v=!0}return v},c},tT=function(e,t){var r=t.text,n=r===void 0?"":r,i=t.style,s=i===void 0?{}:i,a=t.isSprite,o=new wm(n,s);return a?(o.updateText(),new yi(o.texture)):o},eT=["tileScale","tilePosition","image","texture"],rT=function(e,t){var r=t.width,n=r===void 0?100:r,i=t.height,s=i===void 0?100:i,a=en("TilingSprite",e,t),o=new Wc(a,n,s);return o.applyProps=function(c,h,d){var p=d.tileScale,f=d.tilePosition,m=d.image,g=d.texture,v=rn(c,h,zn(d,eT));if(f){var b,_=ua(f);(b=c.tilePosition).set.apply(b,Tn(_)),v=!tg(ua(h.tilePosition),_)||v}if(p){var w,S=ua(p);(w=c.tileScale).set.apply(w,Tn(S)),v=!tg(ua(h.tileScale),S)||v}return(m||g)&&(g!==h.texture&&(v=!0),c.texture=en("Sprite",e,d)),v},o},nT=["image","texture"],iT=function(e,t){var r=en("Mesh",e,t),n=t.vertices,i=t.uvs,s=t.indices,a=t.drawMode,o=a===void 0?Cr.TRIANGLES:a,c=new TS(r,n,i,s,o);return c.applyProps=function(h,d,p){var f=p.image,m=p.texture,g=rn(h,d,zn(p,nT));return(f||m)&&(m!==d.texture&&(g=!0),h.texture=en("Mesh",e,p)),g},c},sT=["image","texture"],aT=function(e,t){var r=en("SimpleRope",e,t),n=t.points,i=new ES(r,n);return i.applyProps=function(s,a,o){var c=o.image,h=o.texture,d=zn(o,sT);_e(Array.isArray(o.points),"SimpleRope points needs to be %s","Array<PIXI.Point>");var p=rn(s,a,d);return(c||h)&&(h!==a.texture&&(p=!0),s.texture=en("SimpleRope",e,o)),p},i},oT=Object.freeze({__proto__:null,BitmapText:HS,Container:GS,Graphics:VS,NineSlicePlane:XS,ParticleContainer:YS,Sprite:ZS,Text:tT,TilingSprite:rT,SimpleMesh:iT,SimpleRope:aT,AnimatedSprite:JS});function ig(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ig(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ig(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var tr={BitmapText:"BitmapText",Container:"Container",Graphics:"Graphics",NineSlicePlane:"NineSlicePlane",ParticleContainer:"ParticleContainer",Sprite:"Sprite",AnimatedSprite:"AnimatedSprite",Text:"Text",TilingSprite:"TilingSprite",SimpleMesh:"SimpleMesh",SimpleRope:"SimpleRope"},lT=Object.keys(tr).reduce(function(e,t){return sg(sg({},e),{},xe({},t,oT[t]))},{}),ag={};function uT(e,t){return _e(!!e,"Expect type to be defined, got `%s`",e),_e(!tr[e],"Component `%s` could not be created, already exists in default components.",e),ag[e]=t,e}var og,lg,ug,cg,th={},eh={},cT={get exports(){return eh},set exports(e){eh=e}},hg={};function hT(){return lg||(lg=1,cT.exports=(og||(og=1,function(e){function t(X,G){var D=X.length;X.push(G);t:for(;0<D;){var L=D-1>>>1,U=X[L];if(!(0<i(U,G)))break t;X[L]=G,X[D]=U,D=L}}function r(X){return X.length===0?null:X[0]}function n(X){if(X.length===0)return null;var G=X[0],D=X.pop();if(D!==G){X[0]=D;t:for(var L=0,U=X.length,H=U>>>1;L<H;){var Y=2*(L+1)-1,K=X[Y],j=Y+1,W=X[j];if(0>i(K,D))j<U&&0>i(W,K)?(X[L]=W,X[j]=D,L=j):(X[L]=K,X[Y]=D,L=Y);else{if(!(j<U&&0>i(W,D)))break t;X[L]=W,X[j]=D,L=j}}}return G}function i(X,G){var D=X.sortIndex-G.sortIndex;return D!==0?D:X.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],h=[],d=1,p=null,f=3,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function S(X){for(var G=r(h);G!==null;){if(G.callback===null)n(h);else{if(!(G.startTime<=X))break;n(h),G.sortIndex=G.expirationTime,t(c,G)}G=r(h)}}function x(X){if(v=!1,S(X),!g)if(r(c)!==null)g=!0,V(A);else{var G=r(h);G!==null&&q(x,G.startTime-X)}}function A(X,G){g=!1,v&&(v=!1,_(B),B=-1),m=!0;var D=f;try{for(S(G),p=r(c);p!==null&&(!(p.expirationTime>G)||X&&!k());){var L=p.callback;if(typeof L=="function"){p.callback=null,f=p.priorityLevel;var U=L(p.expirationTime<=G);G=e.unstable_now(),typeof U=="function"?p.callback=U:p===r(c)&&n(c),S(G)}else n(c);p=r(c)}if(p!==null)var H=!0;else{var Y=r(h);Y!==null&&q(x,Y.startTime-G),H=!1}return H}finally{p=null,f=D,m=!1}}typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var N,O=!1,P=null,B=-1,I=5,C=-1;function k(){return!(e.unstable_now()-C<I)}function M(){if(P!==null){var X=e.unstable_now();C=X;var G=!0;try{G=P(!0,X)}finally{G?N():(O=!1,P=null)}}else O=!1}if(typeof w=="function")N=function(){w(M)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,$=F.port2;F.port1.onmessage=M,N=function(){$.postMessage(null)}}else N=function(){b(M,0)};function V(X){P=X,O||(O=!0,N())}function q(X,G){B=b(function(){X(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,V(A))},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(X){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var D=f;f=G;try{return X()}finally{f=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(X,G){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var D=f;f=X;try{return G()}finally{f=D}},e.unstable_scheduleCallback=function(X,G,D){var L=e.unstable_now();switch(D=typeof D=="object"&&D!==null&&typeof(D=D.delay)=="number"&&0<D?L+D:L,X){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return X={id:d++,callback:G,priorityLevel:X,startTime:D,expirationTime:U=D+U,sortIndex:-1},D>L?(X.sortIndex=D,t(h,X),r(c)===null&&X===r(h)&&(v?(_(B),B=-1):v=!0,q(x,D-L))):(X.sortIndex=U,t(c,X),g||m||(g=!0,V(A))),X},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(X){var G=f;return function(){var D=f;f=G;try{return X.apply(this,arguments)}finally{f=D}}}}(hg)),hg)),eh}/**
784
- * @license React
785
- * react-reconciler.production.min.js
786
- *
787
- * Copyright (c) Facebook, Inc. and its affiliates.
788
- *
789
- * This source code is licensed under the MIT license found in the
790
- * LICENSE file in the root directory of this source tree.
791
- */function fT(){return cg||(cg=1,ug=function(e){var t={},r=dt,n=hT(),i=Object.assign;function s(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,y=1;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,o=Symbol.for("react.element"),c=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),x=Symbol.iterator;function A(l){return l===null||typeof l!="object"?null:typeof(l=x&&l[x]||l["@@iterator"])=="function"?l:null}function N(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case c:return"Portal";case p:return"Profiler";case d:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case m:return(l.displayName||"Context")+".Consumer";case f:return(l._context.displayName||"Context")+".Provider";case g:var u=l.render;return(l=l.displayName)||(l=(l=u.displayName||u.name||"")!==""?"ForwardRef("+l+")":"ForwardRef"),l;case _:return(u=l.displayName||null)!==null?u:N(l.type)||"Memo";case w:u=l._payload,l=l._init;try{return N(l(u))}catch{}}return null}function O(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=(l=u.render).displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return N(u);case 8:return u===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function P(l){var u=l,y=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do 4098&(u=l).flags&&(y=u.return),l=u.return;while(l)}return u.tag===3?y:null}function B(l){if(P(l)!==l)throw Error(s(188))}function I(l){var u=l.alternate;if(!u){if((u=P(l))===null)throw Error(s(188));return u!==l?null:l}for(var y=l,T=u;;){var E=y.return;if(E===null)break;var R=E.alternate;if(R===null){if((T=E.return)!==null){y=T;continue}break}if(E.child===R.child){for(R=E.child;R;){if(R===y)return B(E),l;if(R===T)return B(E),u;R=R.sibling}throw Error(s(188))}if(y.return!==T.return)y=E,T=R;else{for(var z=!1,Z=E.child;Z;){if(Z===y){z=!0,y=E,T=R;break}if(Z===T){z=!0,T=E,y=R;break}Z=Z.sibling}if(!z){for(Z=R.child;Z;){if(Z===y){z=!0,y=R,T=E;break}if(Z===T){z=!0,T=R,y=E;break}Z=Z.sibling}if(!z)throw Error(s(189))}}if(y.alternate!==T)throw Error(s(190))}if(y.tag!==3)throw Error(s(188));return y.stateNode.current===y?l:u}function C(l){return(l=I(l))!==null?k(l):null}function k(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=k(l);if(u!==null)return u;l=l.sibling}return null}function M(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var u=M(l);if(u!==null)return u}l=l.sibling}return null}var F,$=Array.isArray,V=e.getPublicInstance,q=e.getRootHostContext,X=e.getChildHostContext,G=e.prepareForCommit,D=e.resetAfterCommit,L=e.createInstance,U=e.appendInitialChild,H=e.finalizeInitialChildren,Y=e.prepareUpdate,K=e.shouldSetTextContent,j=e.createTextInstance,W=e.scheduleTimeout,Q=e.cancelTimeout,tt=e.noTimeout,rt=e.isPrimaryRenderer,ct=e.supportsMutation,_t=e.supportsPersistence,yt=e.supportsHydration,Nt=e.getInstanceFromNode,Ft=e.preparePortalMount,ie=e.getCurrentEventPriority,ne=e.detachDeletedInstance,nt=e.supportsMicrotasks,at=e.scheduleMicrotask,gt=e.supportsTestSelectors,bt=e.findFiberRoot,ht=e.getBoundingRect,Dt=e.getTextContent,mt=e.isHiddenSubtree,It=e.matchAccessibilityRole,re=e.setFocusIfFocusable,Pe=e.setupIntersectionObserver,Wt=e.appendChild,Zt=e.appendChildToContainer,Qt=e.commitTextUpdate,ye=e.commitMount,lr=e.commitUpdate,Ie=e.insertBefore,Cl=e.insertInContainerBefore,jh=e.removeChild,$h=e.removeChildFromContainer,pv=e.resetTextContent,RL=e.hideInstance,NL=e.hideTextInstance,ML=e.unhideInstance,LL=e.unhideTextInstance,BL=e.clearContainer,FL=e.cloneInstance,mv=e.createContainerChildSet,gv=e.appendChildToContainerChildSet,DL=e.finalizeContainerChildren,zh=e.replaceContainerChildren,yv=e.cloneHiddenInstance,vv=e.cloneHiddenTextInstance,UL=e.canHydrateInstance,jL=e.canHydrateTextInstance,$L=e.canHydrateSuspenseInstance,_v=e.isSuspenseInstancePending,Hh=e.isSuspenseInstanceFallback,zL=e.getSuspenseInstanceFallbackErrorDetails,HL=e.registerSuspenseInstanceRetry,Ol=e.getNextHydratableSibling,GL=e.getFirstHydratableChild,qL=e.getFirstHydratableChildWithinContainer,VL=e.getFirstHydratableChildWithinSuspenseInstance,WL=e.hydrateInstance,XL=e.hydrateTextInstance,YL=e.hydrateSuspenseInstance,KL=e.getNextHydratableInstanceAfterSuspenseInstance,ZL=e.commitHydratedContainer,QL=e.commitHydratedSuspenseInstance,JL=e.clearSuspenseBoundary,t3=e.clearSuspenseBoundaryFromContainer,e3=e.shouldDeleteUnhydratedTailInstances,r3=e.didNotMatchHydratedContainerTextInstance,n3=e.didNotMatchHydratedTextInstance;function Ta(l){if(F===void 0)try{throw Error()}catch(y){var u=y.stack.trim().match(/\n( *(at )?)/);F=u&&u[1]||""}return`
792
- `+F+l}var Gh=!1;function qh(l,u){if(!l||Gh)return"";Gh=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(st){var T=st}Reflect.construct(l,[],u)}else{try{u.call()}catch(st){T=st}l.call(u.prototype)}else{try{throw Error()}catch(st){T=st}l()}}catch(st){if(st&&T&&typeof st.stack=="string"){for(var E=st.stack.split(`
793
- `),R=T.stack.split(`
794
- `),z=E.length-1,Z=R.length-1;1<=z&&0<=Z&&E[z]!==R[Z];)Z--;for(;1<=z&&0<=Z;z--,Z--)if(E[z]!==R[Z]){if(z!==1||Z!==1)do if(z--,0>--Z||E[z]!==R[Z]){var et=`
795
- `+E[z].replace(" at new "," at ");return l.displayName&&et.includes("<anonymous>")&&(et=et.replace("<anonymous>",l.displayName)),et}while(1<=z&&0<=Z);break}}}finally{Gh=!1,Error.prepareStackTrace=y}return(l=l?l.displayName||l.name:"")?Ta(l):""}var i3=Object.prototype.hasOwnProperty,Vh=[],vs=-1;function Vn(l){return{current:l}}function ce(l){0>vs||(l.current=Vh[vs],Vh[vs]=null,vs--)}function se(l,u){vs++,Vh[vs]=l.current,l.current=u}var Wn={},qe=Vn(Wn),er=Vn(!1),Ti=Wn;function _s(l,u){var y=l.type.contextTypes;if(!y)return Wn;var T=l.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===u)return T.__reactInternalMemoizedMaskedChildContext;var E,R={};for(E in y)R[E]=u[E];return T&&((l=l.stateNode).__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=R),R}function ur(l){return(l=l.childContextTypes)!=null}function Wh(){ce(er),ce(qe)}function bv(l,u,y){if(qe.current!==Wn)throw Error(s(168));se(qe,u),se(er,y)}function xv(l,u,y){var T=l.stateNode;if(u=u.childContextTypes,typeof T.getChildContext!="function")return y;for(var E in T=T.getChildContext())if(!(E in u))throw Error(s(108,O(l)||"Unknown",E));return i({},y,T)}function Pl(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Wn,Ti=qe.current,se(qe,l),se(er,er.current),!0}function wv(l,u,y){var T=l.stateNode;if(!T)throw Error(s(169));y?(l=xv(l,u,Ti),T.__reactInternalMemoizedMergedChildContext=l,ce(er),ce(qe),se(qe,l)):ce(er),se(er,y)}var zr=Math.clz32?Math.clz32:function(l){return(l>>>=0)===0?32:31-(s3(l)/a3|0)|0},s3=Math.log,a3=Math.LN2,Xh=64,Yh=4194304;function Ea(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&l;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&l;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Il(l,u){var y=l.pendingLanes;if(y===0)return 0;var T=0,E=l.suspendedLanes,R=l.pingedLanes,z=268435455&y;if(z!==0){var Z=z&~E;Z!==0?T=Ea(Z):(R&=z)!==0&&(T=Ea(R))}else(z=y&~E)!==0?T=Ea(z):R!==0&&(T=Ea(R));if(T===0)return 0;if(u!==0&&u!==T&&!(u&E)&&((E=T&-T)>=(R=u&-u)||E===16&&4194240&R))return u;if(4&T&&(T|=16&y),(u=l.entangledLanes)!==0)for(l=l.entanglements,u&=T;0<u;)E=1<<(y=31-zr(u)),T|=l[y],u&=~E;return T}function o3(l,u){switch(l){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;default:return-1}}function Kh(l){return(l=-1073741825&l.pendingLanes)!==0?l:1073741824&l?1073741824:0}function Sv(){var l=Xh;return!(4194240&(Xh<<=1))&&(Xh=64),l}function Zh(l){for(var u=[],y=0;31>y;y++)u.push(l);return u}function Aa(l,u,y){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),(l=l.eventTimes)[u=31-zr(u)]=y}function Qh(l,u){var y=l.entangledLanes|=u;for(l=l.entanglements;y;){var T=31-zr(y),E=1<<T;E&u|l[T]&u&&(l[T]|=u),y&=~E}}var Xt=0;function Tv(l){return 1<(l&=-l)?4<l?268435455&l?16:536870912:4:1}var Jh=n.unstable_scheduleCallback,Ev=n.unstable_cancelCallback,l3=n.unstable_shouldYield,u3=n.unstable_requestPaint,Le=n.unstable_now,tf=n.unstable_ImmediatePriority,c3=n.unstable_UserBlockingPriority,Av=n.unstable_NormalPriority,h3=n.unstable_IdlePriority,kl=null,sn=null,Hr=typeof Object.is=="function"?Object.is:function(l,u){return l===u&&(l!==0||1/l==1/u)||l!=l&&u!=u},Pn=null,Rl=!1,ef=!1;function Cv(l){Pn===null?Pn=[l]:Pn.push(l)}function an(){if(!ef&&Pn!==null){ef=!0;var l=0,u=Xt;try{var y=Pn;for(Xt=1;l<y.length;l++){var T=y[l];do T=T(!0);while(T!==null)}Pn=null,Rl=!1}catch(E){throw Pn!==null&&(Pn=Pn.slice(l+1)),Jh(tf,an),E}finally{Xt=u,ef=!1}}return null}var bs=[],xs=0,Nl=null,Ml=0,yr=[],vr=0,Ei=null,on=1,In="";function Ai(l,u){bs[xs++]=Ml,bs[xs++]=Nl,Nl=l,Ml=u}function Ov(l,u,y){yr[vr++]=on,yr[vr++]=In,yr[vr++]=Ei,Ei=l;var T=on;l=In;var E=32-zr(T)-1;T&=~(1<<E),y+=1;var R=32-zr(u)+E;if(30<R){var z=E-E%5;R=(T&(1<<z)-1).toString(32),T>>=z,E-=z,on=1<<32-zr(u)+E|y<<E|T,In=R+l}else on=1<<R|y<<E|T,In=l}function rf(l){l.return!==null&&(Ai(l,1),Ov(l,1,0))}function nf(l){for(;l===Nl;)Nl=bs[--xs],bs[xs]=null,Ml=bs[--xs],bs[xs]=null;for(;l===Ei;)Ei=yr[--vr],yr[vr]=null,In=yr[--vr],yr[vr]=null,on=yr[--vr],yr[vr]=null}var cr=null,_r=null,he=!1,Ca=!1,Gr=null;function Pv(l,u){var y=Tr(5,null,null,0);y.elementType="DELETED",y.stateNode=u,y.return=l,(u=l.deletions)===null?(l.deletions=[y],l.flags|=16):u.push(y)}function Iv(l,u){switch(l.tag){case 5:return(u=UL(u,l.type,l.pendingProps))!==null&&(l.stateNode=u,cr=l,_r=GL(u),!0);case 6:return(u=jL(u,l.pendingProps))!==null&&(l.stateNode=u,cr=l,_r=null,!0);case 13:if((u=$L(u))!==null){var y=Ei!==null?{id:on,overflow:In}:null;return l.memoizedState={dehydrated:u,treeContext:y,retryLane:1073741824},(y=Tr(18,null,null,0)).stateNode=u,y.return=l,l.child=y,cr=l,_r=null,!0}return!1;default:return!1}}function sf(l){return(1&l.mode)!=0&&(128&l.flags)==0}function af(l){if(he){var u=_r;if(u){var y=u;if(!Iv(l,u)){if(sf(l))throw Error(s(418));u=Ol(y);var T=cr;u&&Iv(l,u)?Pv(T,y):(l.flags=-4097&l.flags|2,he=!1,cr=l)}}else{if(sf(l))throw Error(s(418));l.flags=-4097&l.flags|2,he=!1,cr=l}}}function kv(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;cr=l}function Ll(l){if(!yt||l!==cr)return!1;if(!he)return kv(l),he=!0,!1;if(l.tag!==3&&(l.tag!==5||e3(l.type)&&!K(l.type,l.memoizedProps))){var u=_r;if(u){if(sf(l))throw Rv(),Error(s(418));for(;u;)Pv(l,u),u=Ol(u)}}if(kv(l),l.tag===13){if(!yt)throw Error(s(316));if(!(l=(l=l.memoizedState)!==null?l.dehydrated:null))throw Error(s(317));_r=KL(l)}else _r=cr?Ol(l.stateNode):null;return!0}function Rv(){for(var l=_r;l;)l=Ol(l)}function ws(){yt&&(_r=cr=null,Ca=he=!1)}function of(l){Gr===null?Gr=[l]:Gr.push(l)}var f3=a.ReactCurrentBatchConfig;function Bl(l,u){if(Hr(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var y=Object.keys(l),T=Object.keys(u);if(y.length!==T.length)return!1;for(T=0;T<y.length;T++){var E=y[T];if(!i3.call(u,E)||!Hr(l[E],u[E]))return!1}return!0}function d3(l){switch(l.tag){case 5:return Ta(l.type);case 16:return Ta("Lazy");case 13:return Ta("Suspense");case 19:return Ta("SuspenseList");case 0:case 2:case 15:return l=qh(l.type,!1);case 11:return l=qh(l.type.render,!1);case 1:return l=qh(l.type,!0);default:return""}}function qr(l,u){if(l&&l.defaultProps){for(var y in u=i({},u),l=l.defaultProps)u[y]===void 0&&(u[y]=l[y]);return u}return u}var Fl=Vn(null),Dl=null,Ss=null,lf=null;function uf(){lf=Ss=Dl=null}function Nv(l,u,y){rt?(se(Fl,u._currentValue),u._currentValue=y):(se(Fl,u._currentValue2),u._currentValue2=y)}function cf(l){var u=Fl.current;ce(Fl),rt?l._currentValue=u:l._currentValue2=u}function hf(l,u,y){for(;l!==null;){var T=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,T!==null&&(T.childLanes|=u)):T!==null&&(T.childLanes&u)!==u&&(T.childLanes|=u),l===y)break;l=l.return}}function Ts(l,u){Dl=l,lf=Ss=null,(l=l.dependencies)!==null&&l.firstContext!==null&&(l.lanes&u&&(rr=!0),l.firstContext=null)}function br(l){var u=rt?l._currentValue:l._currentValue2;if(lf!==l)if(l={context:l,memoizedValue:u,next:null},Ss===null){if(Dl===null)throw Error(s(308));Ss=l,Dl.dependencies={lanes:0,firstContext:l}}else Ss=Ss.next=l;return u}var Ci=null;function ff(l){Ci===null?Ci=[l]:Ci.push(l)}function Mv(l,u,y,T){var E=u.interleaved;return E===null?(y.next=y,ff(u)):(y.next=E.next,E.next=y),u.interleaved=y,ln(l,T)}function ln(l,u){l.lanes|=u;var y=l.alternate;for(y!==null&&(y.lanes|=u),y=l,l=l.return;l!==null;)l.childLanes|=u,(y=l.alternate)!==null&&(y.childLanes|=u),y=l,l=l.return;return y.tag===3?y.stateNode:null}var Xn=!1;function df(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lv(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function kn(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Yn(l,u,y){var T=l.updateQueue;if(T===null)return null;if(T=T.shared,(2&Gt)!=0){var E=T.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),T.pending=u,ln(l,y)}return(E=T.interleaved)===null?(u.next=u,ff(T)):(u.next=E.next,E.next=u),T.interleaved=u,ln(l,y)}function Ul(l,u,y){if((u=u.updateQueue)!==null&&(u=u.shared,(4194240&y)!=0)){var T=u.lanes;y|=T&=l.pendingLanes,u.lanes=y,Qh(l,y)}}function Bv(l,u){var y=l.updateQueue,T=l.alternate;if(T!==null&&y===(T=T.updateQueue)){var E=null,R=null;if((y=y.firstBaseUpdate)!==null){do{var z={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};R===null?E=R=z:R=R.next=z,y=y.next}while(y!==null);R===null?E=R=u:R=R.next=u}else E=R=u;return y={baseState:T.baseState,firstBaseUpdate:E,lastBaseUpdate:R,shared:T.shared,effects:T.effects},void(l.updateQueue=y)}(l=y.lastBaseUpdate)===null?y.firstBaseUpdate=u:l.next=u,y.lastBaseUpdate=u}function jl(l,u,y,T){var E=l.updateQueue;Xn=!1;var R=E.firstBaseUpdate,z=E.lastBaseUpdate,Z=E.shared.pending;if(Z!==null){E.shared.pending=null;var et=Z,st=et.next;et.next=null,z===null?R=st:z.next=st,z=et;var lt=l.alternate;lt!==null&&(Z=(lt=lt.updateQueue).lastBaseUpdate)!==z&&(Z===null?lt.firstBaseUpdate=st:Z.next=st,lt.lastBaseUpdate=et)}if(R!==null){var vt=E.baseState;for(z=0,lt=st=et=null,Z=R;;){var ot=Z.lane,pt=Z.eventTime;if((T&ot)===ot){lt!==null&&(lt=lt.next={eventTime:pt,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});t:{var At=l,jt=Z;switch(ot=u,pt=y,jt.tag){case 1:if(typeof(At=jt.payload)=="function"){vt=At.call(pt,vt,ot);break t}vt=At;break t;case 3:At.flags=-65537&At.flags|128;case 0:if((ot=typeof(At=jt.payload)=="function"?At.call(pt,vt,ot):At)==null)break t;vt=i({},vt,ot);break t;case 2:Xn=!0}}Z.callback!==null&&Z.lane!==0&&(l.flags|=64,(ot=E.effects)===null?E.effects=[Z]:ot.push(Z))}else pt={eventTime:pt,lane:ot,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},lt===null?(st=lt=pt,et=vt):lt=lt.next=pt,z|=ot;if((Z=Z.next)===null){if((Z=E.shared.pending)===null)break;Z=(ot=Z).next,ot.next=null,E.lastBaseUpdate=ot,E.shared.pending=null}}if(lt===null&&(et=vt),E.baseState=et,E.firstBaseUpdate=st,E.lastBaseUpdate=lt,(u=E.shared.interleaved)!==null){E=u;do z|=E.lane,E=E.next;while(E!==u)}else R===null&&(E.shared.lanes=0);Pi|=z,l.lanes=z,l.memoizedState=vt}}function Fv(l,u,y){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var T=l[u],E=T.callback;if(E!==null){if(T.callback=null,T=y,typeof E!="function")throw Error(s(191,E));E.call(T)}}}var Dv=new r.Component().refs;function pf(l,u,y,T){y=(y=y(T,u=l.memoizedState))==null?u:i({},u,y),l.memoizedState=y,l.lanes===0&&(l.updateQueue.baseState=y)}var $l={isMounted:function(l){return!!(l=l._reactInternals)&&P(l)===l},enqueueSetState:function(l,u,y){l=l._reactInternals;var T=Xe(),E=Jn(l),R=kn(T,E);R.payload=u,y!=null&&(R.callback=y),(u=Yn(l,R,E))!==null&&(Sr(u,l,E,T),Ul(u,l,E))},enqueueReplaceState:function(l,u,y){l=l._reactInternals;var T=Xe(),E=Jn(l),R=kn(T,E);R.tag=1,R.payload=u,y!=null&&(R.callback=y),(u=Yn(l,R,E))!==null&&(Sr(u,l,E,T),Ul(u,l,E))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var y=Xe(),T=Jn(l),E=kn(y,T);E.tag=2,u!=null&&(E.callback=u),(u=Yn(l,E,T))!==null&&(Sr(u,l,T,y),Ul(u,l,T))}};function Uv(l,u,y,T,E,R,z){return typeof(l=l.stateNode).shouldComponentUpdate=="function"?l.shouldComponentUpdate(T,R,z):!u.prototype||!u.prototype.isPureReactComponent||!Bl(y,T)||!Bl(E,R)}function jv(l,u,y){var T=!1,E=Wn,R=u.contextType;return typeof R=="object"&&R!==null?R=br(R):(E=ur(u)?Ti:qe.current,R=(T=(T=u.contextTypes)!=null)?_s(l,E):Wn),u=new u(y,R),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=$l,l.stateNode=u,u._reactInternals=l,T&&((l=l.stateNode).__reactInternalMemoizedUnmaskedChildContext=E,l.__reactInternalMemoizedMaskedChildContext=R),u}function $v(l,u,y,T){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(y,T),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(y,T),u.state!==l&&$l.enqueueReplaceState(u,u.state,null)}function mf(l,u,y,T){var E=l.stateNode;E.props=y,E.state=l.memoizedState,E.refs=Dv,df(l);var R=u.contextType;typeof R=="object"&&R!==null?E.context=br(R):(R=ur(u)?Ti:qe.current,E.context=_s(l,R)),E.state=l.memoizedState,typeof(R=u.getDerivedStateFromProps)=="function"&&(pf(l,u,R,y),E.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(u=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),u!==E.state&&$l.enqueueReplaceState(E,E.state,null),jl(l,y,E,T),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308)}function Oa(l,u,y){if((l=y.ref)!==null&&typeof l!="function"&&typeof l!="object"){if(y._owner){if(y=y._owner){if(y.tag!==1)throw Error(s(309));var T=y.stateNode}if(!T)throw Error(s(147,l));var E=T,R=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===R?u.ref:(u=function(z){var Z=E.refs;Z===Dv&&(Z=E.refs={}),z===null?delete Z[R]:Z[R]=z},u._stringRef=R,u)}if(typeof l!="string")throw Error(s(284));if(!y._owner)throw Error(s(290,l))}return l}function zl(l,u){throw l=Object.prototype.toString.call(u),Error(s(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function zv(l){return(0,l._init)(l._payload)}function Hv(l){function u(ut,J){if(l){var it=ut.deletions;it===null?(ut.deletions=[J],ut.flags|=16):it.push(J)}}function y(ut,J){if(!l)return null;for(;J!==null;)u(ut,J),J=J.sibling;return null}function T(ut,J){for(ut=new Map;J!==null;)J.key!==null?ut.set(J.key,J):ut.set(J.index,J),J=J.sibling;return ut}function E(ut,J){return(ut=ei(ut,J)).index=0,ut.sibling=null,ut}function R(ut,J,it){return ut.index=it,l?(it=ut.alternate)!==null?(it=it.index)<J?(ut.flags|=2,J):it:(ut.flags|=2,J):(ut.flags|=1048576,J)}function z(ut){return l&&ut.alternate===null&&(ut.flags|=2),ut}function Z(ut,J,it,ft){return J===null||J.tag!==6?((J=ed(it,ut.mode,ft)).return=ut,J):((J=E(J,it)).return=ut,J)}function et(ut,J,it,ft){var Rt=it.type;return Rt===h?lt(ut,J,it.props.children,ft,it.key):J!==null&&(J.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===w&&zv(Rt)===J.type)?((ft=E(J,it.props)).ref=Oa(ut,J,it),ft.return=ut,ft):((ft=pu(it.type,it.key,it.props,null,ut.mode,ft)).ref=Oa(ut,J,it),ft.return=ut,ft)}function st(ut,J,it,ft){return J===null||J.tag!==4||J.stateNode.containerInfo!==it.containerInfo||J.stateNode.implementation!==it.implementation?((J=rd(it,ut.mode,ft)).return=ut,J):((J=E(J,it.children||[])).return=ut,J)}function lt(ut,J,it,ft,Rt){return J===null||J.tag!==7?((J=Ri(it,ut.mode,ft,Rt)).return=ut,J):((J=E(J,it)).return=ut,J)}function vt(ut,J,it){if(typeof J=="string"&&J!==""||typeof J=="number")return(J=ed(""+J,ut.mode,it)).return=ut,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case o:return(it=pu(J.type,J.key,J.props,null,ut.mode,it)).ref=Oa(ut,null,J),it.return=ut,it;case c:return(J=rd(J,ut.mode,it)).return=ut,J;case w:return vt(ut,(0,J._init)(J._payload),it)}if($(J)||A(J))return(J=Ri(J,ut.mode,it,null)).return=ut,J;zl(ut,J)}return null}function ot(ut,J,it,ft){var Rt=J!==null?J.key:null;if(typeof it=="string"&&it!==""||typeof it=="number")return Rt!==null?null:Z(ut,J,""+it,ft);if(typeof it=="object"&&it!==null){switch(it.$$typeof){case o:return it.key===Rt?et(ut,J,it,ft):null;case c:return it.key===Rt?st(ut,J,it,ft):null;case w:return ot(ut,J,(Rt=it._init)(it._payload),ft)}if($(it)||A(it))return Rt!==null?null:lt(ut,J,it,ft,null);zl(ut,it)}return null}function pt(ut,J,it,ft,Rt){if(typeof ft=="string"&&ft!==""||typeof ft=="number")return Z(J,ut=ut.get(it)||null,""+ft,Rt);if(typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case o:return et(J,ut=ut.get(ft.key===null?it:ft.key)||null,ft,Rt);case c:return st(J,ut=ut.get(ft.key===null?it:ft.key)||null,ft,Rt);case w:return pt(ut,J,it,(0,ft._init)(ft._payload),Rt)}if($(ft)||A(ft))return lt(J,ut=ut.get(it)||null,ft,Rt,null);zl(J,ft)}return null}function At(ut,J,it,ft){for(var Rt=null,Jt=null,Ot=J,Yt=J=0,$e=null;Ot!==null&&Yt<it.length;Yt++){Ot.index>Yt?($e=Ot,Ot=null):$e=Ot.sibling;var te=ot(ut,Ot,it[Yt],ft);if(te===null){Ot===null&&(Ot=$e);break}l&&Ot&&te.alternate===null&&u(ut,Ot),J=R(te,J,Yt),Jt===null?Rt=te:Jt.sibling=te,Jt=te,Ot=$e}if(Yt===it.length)return y(ut,Ot),he&&Ai(ut,Yt),Rt;if(Ot===null){for(;Yt<it.length;Yt++)(Ot=vt(ut,it[Yt],ft))!==null&&(J=R(Ot,J,Yt),Jt===null?Rt=Ot:Jt.sibling=Ot,Jt=Ot);return he&&Ai(ut,Yt),Rt}for(Ot=T(ut,Ot);Yt<it.length;Yt++)($e=pt(Ot,ut,Yt,it[Yt],ft))!==null&&(l&&$e.alternate!==null&&Ot.delete($e.key===null?Yt:$e.key),J=R($e,J,Yt),Jt===null?Rt=$e:Jt.sibling=$e,Jt=$e);return l&&Ot.forEach(function(ri){return u(ut,ri)}),he&&Ai(ut,Yt),Rt}function jt(ut,J,it,ft){var Rt=A(it);if(typeof Rt!="function")throw Error(s(150));if((it=Rt.call(it))==null)throw Error(s(151));for(var Jt=Rt=null,Ot=J,Yt=J=0,$e=null,te=it.next();Ot!==null&&!te.done;Yt++,te=it.next()){Ot.index>Yt?($e=Ot,Ot=null):$e=Ot.sibling;var ri=ot(ut,Ot,te.value,ft);if(ri===null){Ot===null&&(Ot=$e);break}l&&Ot&&ri.alternate===null&&u(ut,Ot),J=R(ri,J,Yt),Jt===null?Rt=ri:Jt.sibling=ri,Jt=ri,Ot=$e}if(te.done)return y(ut,Ot),he&&Ai(ut,Yt),Rt;if(Ot===null){for(;!te.done;Yt++,te=it.next())(te=vt(ut,te.value,ft))!==null&&(J=R(te,J,Yt),Jt===null?Rt=te:Jt.sibling=te,Jt=te);return he&&Ai(ut,Yt),Rt}for(Ot=T(ut,Ot);!te.done;Yt++,te=it.next())(te=pt(Ot,ut,Yt,te.value,ft))!==null&&(l&&te.alternate!==null&&Ot.delete(te.key===null?Yt:te.key),J=R(te,J,Yt),Jt===null?Rt=te:Jt.sibling=te,Jt=te);return l&&Ot.forEach(function(F3){return u(ut,F3)}),he&&Ai(ut,Yt),Rt}return function ut(J,it,ft,Rt){if(typeof ft=="object"&&ft!==null&&ft.type===h&&ft.key===null&&(ft=ft.props.children),typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case o:t:{for(var Jt=ft.key,Ot=it;Ot!==null;){if(Ot.key===Jt){if((Jt=ft.type)===h){if(Ot.tag===7){y(J,Ot.sibling),(it=E(Ot,ft.props.children)).return=J,J=it;break t}}else if(Ot.elementType===Jt||typeof Jt=="object"&&Jt!==null&&Jt.$$typeof===w&&zv(Jt)===Ot.type){y(J,Ot.sibling),(it=E(Ot,ft.props)).ref=Oa(J,Ot,ft),it.return=J,J=it;break t}y(J,Ot);break}u(J,Ot),Ot=Ot.sibling}ft.type===h?((it=Ri(ft.props.children,J.mode,Rt,ft.key)).return=J,J=it):((Rt=pu(ft.type,ft.key,ft.props,null,J.mode,Rt)).ref=Oa(J,it,ft),Rt.return=J,J=Rt)}return z(J);case c:t:{for(Ot=ft.key;it!==null;){if(it.key===Ot){if(it.tag===4&&it.stateNode.containerInfo===ft.containerInfo&&it.stateNode.implementation===ft.implementation){y(J,it.sibling),(it=E(it,ft.children||[])).return=J,J=it;break t}y(J,it);break}u(J,it),it=it.sibling}(it=rd(ft,J.mode,Rt)).return=J,J=it}return z(J);case w:return ut(J,it,(Ot=ft._init)(ft._payload),Rt)}if($(ft))return At(J,it,ft,Rt);if(A(ft))return jt(J,it,ft,Rt);zl(J,ft)}return typeof ft=="string"&&ft!==""||typeof ft=="number"?(ft=""+ft,it!==null&&it.tag===6?(y(J,it.sibling),(it=E(it,ft)).return=J,J=it):(y(J,it),(it=ed(ft,J.mode,Rt)).return=J,J=it),z(J)):y(J,it)}}var Es=Hv(!0),Gv=Hv(!1),Pa={},xr=Vn(Pa),Ia=Vn(Pa),As=Vn(Pa);function un(l){if(l===Pa)throw Error(s(174));return l}function gf(l,u){se(As,u),se(Ia,l),se(xr,Pa),l=q(u),ce(xr),se(xr,l)}function Cs(){ce(xr),ce(Ia),ce(As)}function qv(l){var u=un(As.current),y=un(xr.current);y!==(u=X(y,l.type,u))&&(se(Ia,l),se(xr,u))}function yf(l){Ia.current===l&&(ce(xr),ce(Ia))}var be=Vn(0);function Hl(l){for(var u=l;u!==null;){if(u.tag===13){var y=u.memoizedState;if(y!==null&&((y=y.dehydrated)===null||_v(y)||Hh(y)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(128&u.flags)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var vf=[];function _f(){for(var l=0;l<vf.length;l++){var u=vf[l];rt?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}vf.length=0}var Gl=a.ReactCurrentDispatcher,bf=a.ReactCurrentBatchConfig,Oi=0,ve=null,Be=null,Fe=null,ql=!1,ka=!1,Ra=0,p3=0;function Ve(){throw Error(s(321))}function xf(l,u){if(u===null)return!1;for(var y=0;y<u.length&&y<l.length;y++)if(!Hr(l[y],u[y]))return!1;return!0}function wf(l,u,y,T,E,R){if(Oi=R,ve=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Gl.current=l===null||l.memoizedState===null?v3:_3,l=y(T,E),ka){R=0;do{if(ka=!1,Ra=0,25<=R)throw Error(s(301));R+=1,Fe=Be=null,u.updateQueue=null,Gl.current=b3,l=y(T,E)}while(ka)}if(Gl.current=Xl,u=Be!==null&&Be.next!==null,Oi=0,Fe=Be=ve=null,ql=!1,u)throw Error(s(300));return l}function Sf(){var l=Ra!==0;return Ra=0,l}function cn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?ve.memoizedState=Fe=l:Fe=Fe.next=l,Fe}function wr(){if(Be===null){var l=ve.alternate;l=l!==null?l.memoizedState:null}else l=Be.next;var u=Fe===null?ve.memoizedState:Fe.next;if(u!==null)Fe=u,Be=l;else{if(l===null)throw Error(s(310));l={memoizedState:(Be=l).memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},Fe===null?ve.memoizedState=Fe=l:Fe=Fe.next=l}return Fe}function Na(l,u){return typeof u=="function"?u(l):u}function Tf(l){var u=wr(),y=u.queue;if(y===null)throw Error(s(311));y.lastRenderedReducer=l;var T=Be,E=T.baseQueue,R=y.pending;if(R!==null){if(E!==null){var z=E.next;E.next=R.next,R.next=z}T.baseQueue=E=R,y.pending=null}if(E!==null){R=E.next,T=T.baseState;var Z=z=null,et=null,st=R;do{var lt=st.lane;if((Oi&lt)===lt)et!==null&&(et=et.next={lane:0,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null}),T=st.hasEagerState?st.eagerState:l(T,st.action);else{var vt={lane:lt,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null};et===null?(Z=et=vt,z=T):et=et.next=vt,ve.lanes|=lt,Pi|=lt}st=st.next}while(st!==null&&st!==R);et===null?z=T:et.next=Z,Hr(T,u.memoizedState)||(rr=!0),u.memoizedState=T,u.baseState=z,u.baseQueue=et,y.lastRenderedState=T}if((l=y.interleaved)!==null){E=l;do R=E.lane,ve.lanes|=R,Pi|=R,E=E.next;while(E!==l)}else E===null&&(y.lanes=0);return[u.memoizedState,y.dispatch]}function Ef(l){var u=wr(),y=u.queue;if(y===null)throw Error(s(311));y.lastRenderedReducer=l;var T=y.dispatch,E=y.pending,R=u.memoizedState;if(E!==null){y.pending=null;var z=E=E.next;do R=l(R,z.action),z=z.next;while(z!==E);Hr(R,u.memoizedState)||(rr=!0),u.memoizedState=R,u.baseQueue===null&&(u.baseState=R),y.lastRenderedState=R}return[R,T]}function Vv(){}function Wv(l,u){var y=ve,T=wr(),E=u(),R=!Hr(T.memoizedState,E);if(R&&(T.memoizedState=E,rr=!0),T=T.queue,Af(Kv.bind(null,y,T,l),[l]),T.getSnapshot!==u||R||Fe!==null&&1&Fe.memoizedState.tag){if(y.flags|=2048,Ma(9,Yv.bind(null,y,T,E,u),void 0,null),De===null)throw Error(s(349));30&Oi||Xv(y,u,E)}return E}function Xv(l,u,y){l.flags|=16384,l={getSnapshot:u,value:y},(u=ve.updateQueue)===null?(u={lastEffect:null,stores:null},ve.updateQueue=u,u.stores=[l]):(y=u.stores)===null?u.stores=[l]:y.push(l)}function Yv(l,u,y,T){u.value=y,u.getSnapshot=T,Zv(u)&&Qv(l)}function Kv(l,u,y){return y(function(){Zv(u)&&Qv(l)})}function Zv(l){var u=l.getSnapshot;l=l.value;try{var y=u();return!Hr(l,y)}catch{return!0}}function Qv(l){var u=ln(l,1);u!==null&&Sr(u,l,1,-1)}function Jv(l){var u=cn();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:l},u.queue=l,l=l.dispatch=y3.bind(null,ve,l),[u.memoizedState,l]}function Ma(l,u,y,T){return l={tag:l,create:u,destroy:y,deps:T,next:null},(u=ve.updateQueue)===null?(u={lastEffect:null,stores:null},ve.updateQueue=u,u.lastEffect=l.next=l):(y=u.lastEffect)===null?u.lastEffect=l.next=l:(T=y.next,y.next=l,l.next=T,u.lastEffect=l),l}function t0(){return wr().memoizedState}function Vl(l,u,y,T){var E=cn();ve.flags|=l,E.memoizedState=Ma(1|u,y,void 0,T===void 0?null:T)}function Wl(l,u,y,T){var E=wr();T=T===void 0?null:T;var R=void 0;if(Be!==null){var z=Be.memoizedState;if(R=z.destroy,T!==null&&xf(T,z.deps))return void(E.memoizedState=Ma(u,y,R,T))}ve.flags|=l,E.memoizedState=Ma(1|u,y,R,T)}function e0(l,u){return Vl(8390656,8,l,u)}function Af(l,u){return Wl(2048,8,l,u)}function r0(l,u){return Wl(4,2,l,u)}function n0(l,u){return Wl(4,4,l,u)}function i0(l,u){return typeof u=="function"?(l=l(),u(l),function(){u(null)}):u!=null?(l=l(),u.current=l,function(){u.current=null}):void 0}function s0(l,u,y){return y=y!=null?y.concat([l]):null,Wl(4,4,i0.bind(null,u,l),y)}function Cf(){}function a0(l,u){var y=wr();u=u===void 0?null:u;var T=y.memoizedState;return T!==null&&u!==null&&xf(u,T[1])?T[0]:(y.memoizedState=[l,u],l)}function o0(l,u){var y=wr();u=u===void 0?null:u;var T=y.memoizedState;return T!==null&&u!==null&&xf(u,T[1])?T[0]:(l=l(),y.memoizedState=[l,u],l)}function l0(l,u,y){return 21&Oi?(Hr(y,u)||(y=Sv(),ve.lanes|=y,Pi|=y,l.baseState=!0),u):(l.baseState&&(l.baseState=!1,rr=!0),l.memoizedState=y)}function m3(l,u){var y=Xt;Xt=y!==0&&4>y?y:4,l(!0);var T=bf.transition;bf.transition={};try{l(!1),u()}finally{Xt=y,bf.transition=T}}function u0(){return wr().memoizedState}function g3(l,u,y){var T=Jn(l);y={lane:T,action:y,hasEagerState:!1,eagerState:null,next:null},c0(l)?h0(u,y):(y=Mv(l,u,y,T))!==null&&(Sr(y,l,T,Xe()),f0(y,u,T))}function y3(l,u,y){var T=Jn(l),E={lane:T,action:y,hasEagerState:!1,eagerState:null,next:null};if(c0(l))h0(u,E);else{var R=l.alternate;if(l.lanes===0&&(R===null||R.lanes===0)&&(R=u.lastRenderedReducer)!==null)try{var z=u.lastRenderedState,Z=R(z,y);if(E.hasEagerState=!0,E.eagerState=Z,Hr(Z,z)){var et=u.interleaved;return et===null?(E.next=E,ff(u)):(E.next=et.next,et.next=E),void(u.interleaved=E)}}catch{}(y=Mv(l,u,E,T))!==null&&(Sr(y,l,T,E=Xe()),f0(y,u,T))}}function c0(l){var u=l.alternate;return l===ve||u!==null&&u===ve}function h0(l,u){ka=ql=!0;var y=l.pending;y===null?u.next=u:(u.next=y.next,y.next=u),l.pending=u}function f0(l,u,y){if(4194240&y){var T=u.lanes;y|=T&=l.pendingLanes,u.lanes=y,Qh(l,y)}}var Xl={readContext:br,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},v3={readContext:br,useCallback:function(l,u){return cn().memoizedState=[l,u===void 0?null:u],l},useContext:br,useEffect:e0,useImperativeHandle:function(l,u,y){return y=y!=null?y.concat([l]):null,Vl(4194308,4,i0.bind(null,u,l),y)},useLayoutEffect:function(l,u){return Vl(4194308,4,l,u)},useInsertionEffect:function(l,u){return Vl(4,2,l,u)},useMemo:function(l,u){var y=cn();return u=u===void 0?null:u,l=l(),y.memoizedState=[l,u],l},useReducer:function(l,u,y){var T=cn();return u=y!==void 0?y(u):u,T.memoizedState=T.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},T.queue=l,l=l.dispatch=g3.bind(null,ve,l),[T.memoizedState,l]},useRef:function(l){return l={current:l},cn().memoizedState=l},useState:Jv,useDebugValue:Cf,useDeferredValue:function(l){return cn().memoizedState=l},useTransition:function(){var l=Jv(!1),u=l[0];return l=m3.bind(null,l[1]),cn().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,y){var T=ve,E=cn();if(he){if(y===void 0)throw Error(s(407));y=y()}else{if(y=u(),De===null)throw Error(s(349));30&Oi||Xv(T,u,y)}E.memoizedState=y;var R={value:y,getSnapshot:u};return E.queue=R,e0(Kv.bind(null,T,R,l),[l]),T.flags|=2048,Ma(9,Yv.bind(null,T,R,y,u),void 0,null),y},useId:function(){var l=cn(),u=De.identifierPrefix;if(he){var y=In;u=":"+u+"R"+(y=(on&~(1<<32-zr(on)-1)).toString(32)+y),0<(y=Ra++)&&(u+="H"+y.toString(32)),u+=":"}else u=":"+u+"r"+(y=p3++).toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},_3={readContext:br,useCallback:a0,useContext:br,useEffect:Af,useImperativeHandle:s0,useInsertionEffect:r0,useLayoutEffect:n0,useMemo:o0,useReducer:Tf,useRef:t0,useState:function(){return Tf(Na)},useDebugValue:Cf,useDeferredValue:function(l){return l0(wr(),Be.memoizedState,l)},useTransition:function(){return[Tf(Na)[0],wr().memoizedState]},useMutableSource:Vv,useSyncExternalStore:Wv,useId:u0,unstable_isNewReconciler:!1},b3={readContext:br,useCallback:a0,useContext:br,useEffect:Af,useImperativeHandle:s0,useInsertionEffect:r0,useLayoutEffect:n0,useMemo:o0,useReducer:Ef,useRef:t0,useState:function(){return Ef(Na)},useDebugValue:Cf,useDeferredValue:function(l){var u=wr();return Be===null?u.memoizedState=l:l0(u,Be.memoizedState,l)},useTransition:function(){return[Ef(Na)[0],wr().memoizedState]},useMutableSource:Vv,useSyncExternalStore:Wv,useId:u0,unstable_isNewReconciler:!1};function Os(l,u){try{var y="",T=u;do y+=d3(T),T=T.return;while(T);var E=y}catch(R){E=`
796
- Error generating stack: `+R.message+`
797
- `+R.stack}return{value:l,source:u,stack:E,digest:null}}function Of(l,u,y){return{value:l,source:null,stack:y??null,digest:u??null}}function Pf(l,u){try{console.error(u.value)}catch(y){setTimeout(function(){throw y})}}var x3=typeof WeakMap=="function"?WeakMap:Map;function d0(l,u,y){(y=kn(-1,y)).tag=3,y.payload={element:null};var T=u.value;return y.callback=function(){lu||(lu=!0,Xf=T),Pf(0,u)},y}function p0(l,u,y){(y=kn(-1,y)).tag=3;var T=l.type.getDerivedStateFromError;if(typeof T=="function"){var E=u.value;y.payload=function(){return T(E)},y.callback=function(){Pf(0,u)}}var R=l.stateNode;return R!==null&&typeof R.componentDidCatch=="function"&&(y.callback=function(){Pf(0,u),typeof T!="function"&&(Zn===null?Zn=new Set([this]):Zn.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})}),y}function m0(l,u,y){var T=l.pingCache;if(T===null){T=l.pingCache=new x3;var E=new Set;T.set(u,E)}else(E=T.get(u))===void 0&&(E=new Set,T.set(u,E));E.has(y)||(E.add(y),l=I3.bind(null,l,u,y),u.then(l,l))}function g0(l){do{var u;if((u=l.tag===13)&&(u=(u=l.memoizedState)===null||u.dehydrated!==null),u)return l;l=l.return}while(l!==null);return null}function y0(l,u,y,T,E){return 1&l.mode?(l.flags|=65536,l.lanes=E,l):(l===u?l.flags|=65536:(l.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:((u=kn(-1,1)).tag=2,Yn(y,u,1))),y.lanes|=1),l)}var w3=a.ReactCurrentOwner,rr=!1;function nr(l,u,y,T){u.child=l===null?Gv(u,null,y,T):Es(u,l.child,y,T)}function v0(l,u,y,T,E){y=y.render;var R=u.ref;return Ts(u,E),T=wf(l,u,y,T,R,E),y=Sf(),l===null||rr?(he&&y&&rf(u),u.flags|=1,nr(l,u,T,E),u.child):(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~E,Rn(l,u,E))}function _0(l,u,y,T,E){if(l===null){var R=y.type;return typeof R!="function"||td(R)||R.defaultProps!==void 0||y.compare!==null||y.defaultProps!==void 0?((l=pu(y.type,null,T,u,u.mode,E)).ref=u.ref,l.return=u,u.child=l):(u.tag=15,u.type=R,b0(l,u,R,T,E))}if(R=l.child,(l.lanes&E)==0){var z=R.memoizedProps;if((y=(y=y.compare)!==null?y:Bl)(z,T)&&l.ref===u.ref)return Rn(l,u,E)}return u.flags|=1,(l=ei(R,T)).ref=u.ref,l.return=u,u.child=l}function b0(l,u,y,T,E){if(l!==null){var R=l.memoizedProps;if(Bl(R,T)&&l.ref===u.ref){if(rr=!1,u.pendingProps=T=R,(l.lanes&E)==0)return u.lanes=l.lanes,Rn(l,u,E);131072&l.flags&&(rr=!0)}}return If(l,u,y,T,E)}function x0(l,u,y){var T=u.pendingProps,E=T.children,R=l!==null?l.memoizedState:null;if(T.mode==="hidden")if(!(1&u.mode))u.memoizedState={baseLanes:0,cachePool:null,transitions:null},se(Is,hr),hr|=y;else{if(!(1073741824&y))return l=R!==null?R.baseLanes|y:y,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,se(Is,hr),hr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=R!==null?R.baseLanes:y,se(Is,hr),hr|=T}else R!==null?(T=R.baseLanes|y,u.memoizedState=null):T=y,se(Is,hr),hr|=T;return nr(l,u,E,y),u.child}function w0(l,u){var y=u.ref;(l===null&&y!==null||l!==null&&l.ref!==y)&&(u.flags|=512,u.flags|=2097152)}function If(l,u,y,T,E){var R=ur(y)?Ti:qe.current;return R=_s(u,R),Ts(u,E),y=wf(l,u,y,T,R,E),T=Sf(),l===null||rr?(he&&T&&rf(u),u.flags|=1,nr(l,u,y,E),u.child):(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~E,Rn(l,u,E))}function S0(l,u,y,T,E){if(ur(y)){var R=!0;Pl(u)}else R=!1;if(Ts(u,E),u.stateNode===null)Ql(l,u),jv(u,y,T),mf(u,y,T,E),T=!0;else if(l===null){var z=u.stateNode,Z=u.memoizedProps;z.props=Z;var et=z.context,st=y.contextType;typeof st=="object"&&st!==null?st=br(st):st=_s(u,st=ur(y)?Ti:qe.current);var lt=y.getDerivedStateFromProps,vt=typeof lt=="function"||typeof z.getSnapshotBeforeUpdate=="function";vt||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Z!==T||et!==st)&&$v(u,z,T,st),Xn=!1;var ot=u.memoizedState;z.state=ot,jl(u,T,z,E),et=u.memoizedState,Z!==T||ot!==et||er.current||Xn?(typeof lt=="function"&&(pf(u,y,lt,T),et=u.memoizedState),(Z=Xn||Uv(u,y,Z,T,ot,et,st))?(vt||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(u.flags|=4194308)):(typeof z.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=T,u.memoizedState=et),z.props=T,z.state=et,z.context=st,T=Z):(typeof z.componentDidMount=="function"&&(u.flags|=4194308),T=!1)}else{z=u.stateNode,Lv(l,u),Z=u.memoizedProps,st=u.type===u.elementType?Z:qr(u.type,Z),z.props=st,vt=u.pendingProps,ot=z.context,typeof(et=y.contextType)=="object"&&et!==null?et=br(et):et=_s(u,et=ur(y)?Ti:qe.current);var pt=y.getDerivedStateFromProps;(lt=typeof pt=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Z!==vt||ot!==et)&&$v(u,z,T,et),Xn=!1,ot=u.memoizedState,z.state=ot,jl(u,T,z,E);var At=u.memoizedState;Z!==vt||ot!==At||er.current||Xn?(typeof pt=="function"&&(pf(u,y,pt,T),At=u.memoizedState),(st=Xn||Uv(u,y,st,T,ot,At,et)||!1)?(lt||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(T,At,et),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(T,At,et)),typeof z.componentDidUpdate=="function"&&(u.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof z.componentDidUpdate!="function"||Z===l.memoizedProps&&ot===l.memoizedState||(u.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&ot===l.memoizedState||(u.flags|=1024),u.memoizedProps=T,u.memoizedState=At),z.props=T,z.state=At,z.context=et,T=st):(typeof z.componentDidUpdate!="function"||Z===l.memoizedProps&&ot===l.memoizedState||(u.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&ot===l.memoizedState||(u.flags|=1024),T=!1)}return kf(l,u,y,T,R,E)}function kf(l,u,y,T,E,R){w0(l,u);var z=(128&u.flags)!=0;if(!T&&!z)return E&&wv(u,y,!1),Rn(l,u,R);T=u.stateNode,w3.current=u;var Z=z&&typeof y.getDerivedStateFromError!="function"?null:T.render();return u.flags|=1,l!==null&&z?(u.child=Es(u,l.child,null,R),u.child=Es(u,null,Z,R)):nr(l,u,Z,R),u.memoizedState=T.state,E&&wv(u,y,!0),u.child}function T0(l){var u=l.stateNode;u.pendingContext?bv(0,u.pendingContext,u.pendingContext!==u.context):u.context&&bv(0,u.context,!1),gf(l,u.containerInfo)}function E0(l,u,y,T,E){return ws(),of(E),u.flags|=256,nr(l,u,y,T),u.child}var La,Ba,Yl,Kl,Rf={dehydrated:null,treeContext:null,retryLane:0};function Nf(l){return{baseLanes:l,cachePool:null,transitions:null}}function A0(l,u,y){var T,E=u.pendingProps,R=be.current,z=!1,Z=(128&u.flags)!=0;if((T=Z)||(T=(l===null||l.memoizedState!==null)&&(2&R)!=0),T?(z=!0,u.flags&=-129):l!==null&&l.memoizedState===null||(R|=1),se(be,1&R),l===null)return af(u),(l=u.memoizedState)!==null&&(l=l.dehydrated)!==null?(1&u.mode?Hh(l)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(Z=E.children,l=E.fallback,z?(E=u.mode,z=u.child,Z={mode:"hidden",children:Z},!(1&E)&&z!==null?(z.childLanes=0,z.pendingProps=Z):z=mu(Z,E,0,null),l=Ri(l,E,y,null),z.return=u,l.return=u,z.sibling=l,u.child=z,u.child.memoizedState=Nf(y),u.memoizedState=Rf,l):Mf(u,Z));if((R=l.memoizedState)!==null&&(T=R.dehydrated)!==null)return function(st,lt,vt,ot,pt,At,jt){if(vt)return 256&lt.flags?(lt.flags&=-257,Zl(st,lt,jt,ot=Of(Error(s(422))))):lt.memoizedState!==null?(lt.child=st.child,lt.flags|=128,null):(At=ot.fallback,pt=lt.mode,ot=mu({mode:"visible",children:ot.children},pt,0,null),(At=Ri(At,pt,jt,null)).flags|=2,ot.return=lt,At.return=lt,ot.sibling=At,lt.child=ot,1&lt.mode&&Es(lt,st.child,null,jt),lt.child.memoizedState=Nf(jt),lt.memoizedState=Rf,At);if(!(1&lt.mode))return Zl(st,lt,jt,null);if(Hh(pt))return ot=zL(pt).digest,At=Error(s(419)),ot=Of(At,ot,void 0),Zl(st,lt,jt,ot);if(vt=(jt&st.childLanes)!=0,rr||vt){if((ot=De)!==null){switch(jt&-jt){case 4:pt=2;break;case 16:pt=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:pt=32;break;case 536870912:pt=268435456;break;default:pt=0}(pt=pt&(ot.suspendedLanes|jt)?0:pt)!==0&&pt!==At.retryLane&&(At.retryLane=pt,ln(st,pt),Sr(ot,st,pt,-1))}return Jf(),Zl(st,lt,jt,ot=Of(Error(s(421))))}return _v(pt)?(lt.flags|=128,lt.child=st.child,lt=k3.bind(null,st),HL(pt,lt),null):(st=At.treeContext,yt&&(_r=VL(pt),cr=lt,he=!0,Gr=null,Ca=!1,st!==null&&(yr[vr++]=on,yr[vr++]=In,yr[vr++]=Ei,on=st.id,In=st.overflow,Ei=lt)),lt=Mf(lt,ot.children),lt.flags|=4096,lt)}(l,u,Z,E,T,R,y);if(z){z=E.fallback,Z=u.mode,T=(R=l.child).sibling;var et={mode:"hidden",children:E.children};return!(1&Z)&&u.child!==R?((E=u.child).childLanes=0,E.pendingProps=et,u.deletions=null):(E=ei(R,et)).subtreeFlags=14680064&R.subtreeFlags,T!==null?z=ei(T,z):(z=Ri(z,Z,y,null)).flags|=2,z.return=u,E.return=u,E.sibling=z,u.child=E,E=z,z=u.child,Z=(Z=l.child.memoizedState)===null?Nf(y):{baseLanes:Z.baseLanes|y,cachePool:null,transitions:Z.transitions},z.memoizedState=Z,z.childLanes=l.childLanes&~y,u.memoizedState=Rf,E}return l=(z=l.child).sibling,E=ei(z,{mode:"visible",children:E.children}),!(1&u.mode)&&(E.lanes=y),E.return=u,E.sibling=null,l!==null&&((y=u.deletions)===null?(u.deletions=[l],u.flags|=16):y.push(l)),u.child=E,u.memoizedState=null,E}function Mf(l,u){return(u=mu({mode:"visible",children:u},l.mode,0,null)).return=l,l.child=u}function Zl(l,u,y,T){return T!==null&&of(T),Es(u,l.child,null,y),(l=Mf(u,u.pendingProps.children)).flags|=2,u.memoizedState=null,l}function C0(l,u,y){l.lanes|=u;var T=l.alternate;T!==null&&(T.lanes|=u),hf(l.return,u,y)}function Lf(l,u,y,T,E){var R=l.memoizedState;R===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:T,tail:y,tailMode:E}:(R.isBackwards=u,R.rendering=null,R.renderingStartTime=0,R.last=T,R.tail=y,R.tailMode=E)}function O0(l,u,y){var T=u.pendingProps,E=T.revealOrder,R=T.tail;if(nr(l,u,T.children,y),(2&(T=be.current))!=0)T=1&T|2,u.flags|=128;else{if(l!==null&&128&l.flags)t:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&C0(l,y,u);else if(l.tag===19)C0(l,y,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break t;for(;l.sibling===null;){if(l.return===null||l.return===u)break t;l=l.return}l.sibling.return=l.return,l=l.sibling}T&=1}if(se(be,T),(1&u.mode)==0)u.memoizedState=null;else switch(E){case"forwards":for(y=u.child,E=null;y!==null;)(l=y.alternate)!==null&&Hl(l)===null&&(E=y),y=y.sibling;(y=E)===null?(E=u.child,u.child=null):(E=y.sibling,y.sibling=null),Lf(u,!1,E,y,R);break;case"backwards":for(y=null,E=u.child,u.child=null;E!==null;){if((l=E.alternate)!==null&&Hl(l)===null){u.child=E;break}l=E.sibling,E.sibling=y,y=E,E=l}Lf(u,!0,y,null,R);break;case"together":Lf(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Ql(l,u){!(1&u.mode)&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Rn(l,u,y){if(l!==null&&(u.dependencies=l.dependencies),Pi|=u.lanes,(y&u.childLanes)==0)return null;if(l!==null&&u.child!==l.child)throw Error(s(153));if(u.child!==null){for(y=ei(l=u.child,l.pendingProps),u.child=y,y.return=u;l.sibling!==null;)l=l.sibling,(y=y.sibling=ei(l,l.pendingProps)).return=u;y.sibling=null}return u.child}function hn(l){l.flags|=4}function P0(l,u){if(l!==null&&l.child===u.child)return!0;if(16&u.flags)return!1;for(l=u.child;l!==null;){if(12854&l.flags||12854&l.subtreeFlags)return!1;l=l.sibling}return!0}if(ct)La=function(l,u){for(var y=u.child;y!==null;){if(y.tag===5||y.tag===6)U(l,y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},Ba=function(){},Yl=function(l,u,y,T,E){if((l=l.memoizedProps)!==T){var R=u.stateNode,z=un(xr.current);y=Y(R,y,l,T,E,z),(u.updateQueue=y)&&hn(u)}},Kl=function(l,u,y,T){y!==T&&hn(u)};else if(_t){La=function(l,u,y,T){for(var E=u.child;E!==null;){if(E.tag===5){var R=E.stateNode;y&&T&&(R=yv(R,E.type,E.memoizedProps,E)),U(l,R)}else if(E.tag===6)R=E.stateNode,y&&T&&(R=vv(R,E.memoizedProps,E)),U(l,R);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)(R=E.child)!==null&&(R.return=E),La(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===u)break;for(;E.sibling===null;){if(E.return===null||E.return===u)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};var I0=function(l,u,y,T){for(var E=u.child;E!==null;){if(E.tag===5){var R=E.stateNode;y&&T&&(R=yv(R,E.type,E.memoizedProps,E)),gv(l,R)}else if(E.tag===6)R=E.stateNode,y&&T&&(R=vv(R,E.memoizedProps,E)),gv(l,R);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)(R=E.child)!==null&&(R.return=E),I0(l,E,!0,!0);else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===u)break;for(;E.sibling===null;){if(E.return===null||E.return===u)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};Ba=function(l,u){var y=u.stateNode;if(!P0(l,u)){l=y.containerInfo;var T=mv(l);I0(T,u,!1,!1),y.pendingChildren=T,hn(u),DL(l,T)}},Yl=function(l,u,y,T,E){var R=l.stateNode,z=l.memoizedProps;if((l=P0(l,u))&&z===T)u.stateNode=R;else{var Z=u.stateNode,et=un(xr.current),st=null;z!==T&&(st=Y(Z,y,z,T,E,et)),l&&st===null?u.stateNode=R:(R=FL(R,st,y,z,T,u,l,Z),H(R,y,T,E,et)&&hn(u),u.stateNode=R,l?hn(u):La(R,u,!1,!1))}},Kl=function(l,u,y,T){y!==T?(l=un(As.current),y=un(xr.current),u.stateNode=j(T,l,y,u),hn(u)):u.stateNode=l.stateNode}}else Ba=function(){},Yl=function(){},Kl=function(){};function Fa(l,u){if(!he)switch(l.tailMode){case"hidden":u=l.tail;for(var y=null;u!==null;)u.alternate!==null&&(y=u),u=u.sibling;y===null?l.tail=null:y.sibling=null;break;case"collapsed":y=l.tail;for(var T=null;y!==null;)y.alternate!==null&&(T=y),y=y.sibling;T===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:T.sibling=null}}function Ze(l){var u=l.alternate!==null&&l.alternate.child===l.child,y=0,T=0;if(u)for(var E=l.child;E!==null;)y|=E.lanes|E.childLanes,T|=14680064&E.subtreeFlags,T|=14680064&E.flags,E.return=l,E=E.sibling;else for(E=l.child;E!==null;)y|=E.lanes|E.childLanes,T|=E.subtreeFlags,T|=E.flags,E.return=l,E=E.sibling;return l.subtreeFlags|=T,l.childLanes=y,u}function S3(l,u,y){var T=u.pendingProps;switch(nf(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(u),null;case 1:case 17:return ur(u.type)&&Wh(),Ze(u),null;case 3:return y=u.stateNode,Cs(),ce(er),ce(qe),_f(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),l!==null&&l.child!==null||(Ll(u)?hn(u):l===null||l.memoizedState.isDehydrated&&!(256&u.flags)||(u.flags|=1024,Gr!==null&&(Zf(Gr),Gr=null))),Ba(l,u),Ze(u),null;case 5:yf(u),y=un(As.current);var E=u.type;if(l!==null&&u.stateNode!=null)Yl(l,u,E,T,y),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!T){if(u.stateNode===null)throw Error(s(166));return Ze(u),null}if(l=un(xr.current),Ll(u)){if(!yt)throw Error(s(175));l=WL(u.stateNode,u.type,u.memoizedProps,y,l,u,!Ca),u.updateQueue=l,l!==null&&hn(u)}else{var R=L(E,T,y,l,u);La(R,u,!1,!1),u.stateNode=R,H(R,E,T,y,l)&&hn(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return Ze(u),null;case 6:if(l&&u.stateNode!=null)Kl(l,u,l.memoizedProps,T);else{if(typeof T!="string"&&u.stateNode===null)throw Error(s(166));if(l=un(As.current),y=un(xr.current),Ll(u)){if(!yt)throw Error(s(176));if(l=u.stateNode,y=u.memoizedProps,(T=XL(l,y,u,!Ca))&&(E=cr)!==null)switch(E.tag){case 3:r3(E.stateNode.containerInfo,l,y,(1&E.mode)!=0);break;case 5:n3(E.type,E.memoizedProps,E.stateNode,l,y,(1&E.mode)!=0)}T&&hn(u)}else u.stateNode=j(T,l,y,u)}return Ze(u),null;case 13:if(ce(be),T=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(he&&_r!==null&&1&u.mode&&!(128&u.flags))Rv(),ws(),u.flags|=98560,E=!1;else if(E=Ll(u),T!==null&&T.dehydrated!==null){if(l===null){if(!E)throw Error(s(318));if(!yt)throw Error(s(344));if(!(E=(E=u.memoizedState)!==null?E.dehydrated:null))throw Error(s(317));YL(E,u)}else ws(),!(128&u.flags)&&(u.memoizedState=null),u.flags|=4;Ze(u),E=!1}else Gr!==null&&(Zf(Gr),Gr=null),E=!0;if(!E)return 65536&u.flags?u:null}return 128&u.flags?(u.lanes=y,u):((y=T!==null)!=(l!==null&&l.memoizedState!==null)&&y&&(u.child.flags|=8192,1&u.mode&&(l===null||1&be.current?ke===0&&(ke=3):Jf())),u.updateQueue!==null&&(u.flags|=4),Ze(u),null);case 4:return Cs(),Ba(l,u),l===null&&Ft(u.stateNode.containerInfo),Ze(u),null;case 10:return cf(u.type._context),Ze(u),null;case 19:if(ce(be),(E=u.memoizedState)===null)return Ze(u),null;if(T=(128&u.flags)!=0,(R=E.rendering)===null)if(T)Fa(E,!1);else{if(ke!==0||l!==null&&128&l.flags)for(l=u.child;l!==null;){if((R=Hl(l))!==null){for(u.flags|=128,Fa(E,!1),(l=R.updateQueue)!==null&&(u.updateQueue=l,u.flags|=4),u.subtreeFlags=0,l=y,y=u.child;y!==null;)E=l,(T=y).flags&=14680066,(R=T.alternate)===null?(T.childLanes=0,T.lanes=E,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=R.childLanes,T.lanes=R.lanes,T.child=R.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=R.memoizedProps,T.memoizedState=R.memoizedState,T.updateQueue=R.updateQueue,T.type=R.type,E=R.dependencies,T.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext}),y=y.sibling;return se(be,1&be.current|2),u.child}l=l.sibling}E.tail!==null&&Le()>Wf&&(u.flags|=128,T=!0,Fa(E,!1),u.lanes=4194304)}else{if(!T)if((l=Hl(R))!==null){if(u.flags|=128,T=!0,(l=l.updateQueue)!==null&&(u.updateQueue=l,u.flags|=4),Fa(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!he)return Ze(u),null}else 2*Le()-E.renderingStartTime>Wf&&y!==1073741824&&(u.flags|=128,T=!0,Fa(E,!1),u.lanes=4194304);E.isBackwards?(R.sibling=u.child,u.child=R):((l=E.last)!==null?l.sibling=R:u.child=R,E.last=R)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=Le(),u.sibling=null,l=be.current,se(be,T?1&l|2:1&l),u):(Ze(u),null);case 22:case 23:return Qf(),y=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==y&&(u.flags|=8192),y&&1&u.mode?1073741824&hr&&(Ze(u),ct&&6&u.subtreeFlags&&(u.flags|=8192)):Ze(u),null;case 24:case 25:return null}throw Error(s(156,u.tag))}function T3(l,u){switch(nf(u),u.tag){case 1:return ur(u.type)&&Wh(),65536&(l=u.flags)?(u.flags=-65537&l|128,u):null;case 3:return Cs(),ce(er),ce(qe),_f(),65536&(l=u.flags)&&!(128&l)?(u.flags=-65537&l|128,u):null;case 5:return yf(u),null;case 13:if(ce(be),(l=u.memoizedState)!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(s(340));ws()}return 65536&(l=u.flags)?(u.flags=-65537&l|128,u):null;case 19:return ce(be),null;case 4:return Cs(),null;case 10:return cf(u.type._context),null;case 22:case 23:return Qf(),null;default:return null}}var Jl=!1,We=!1,E3=typeof WeakSet=="function"?WeakSet:Set,St=null;function Ps(l,u){var y=l.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(T){fe(l,u,T)}else y.current=null}function k0(l,u,y){try{y()}catch(T){fe(l,u,T)}}var R0=!1;function Da(l,u,y){var T=u.updateQueue;if((T=T!==null?T.lastEffect:null)!==null){var E=T=T.next;do{if((E.tag&l)===l){var R=E.destroy;E.destroy=void 0,R!==void 0&&k0(u,y,R)}E=E.next}while(E!==T)}}function tu(l,u){if((u=(u=u.updateQueue)!==null?u.lastEffect:null)!==null){var y=u=u.next;do{if((y.tag&l)===l){var T=y.create;y.destroy=T()}y=y.next}while(y!==u)}}function Bf(l){var u=l.ref;if(u!==null){var y=l.stateNode;l.tag===5?l=V(y):l=y,typeof u=="function"?u(l):u.current=l}}function N0(l){var u=l.alternate;u!==null&&(l.alternate=null,N0(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode)!==null&&ne(u),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function M0(l){return l.tag===5||l.tag===3||l.tag===4}function L0(l){t:for(;;){for(;l.sibling===null;){if(l.return===null||M0(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(2&l.flags||l.child===null||l.tag===4)continue t;l.child.return=l,l=l.child}if(!(2&l.flags))return l.stateNode}}function Ff(l,u,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,u?Cl(y,l,u):Zt(y,l);else if(T!==4&&(l=l.child)!==null)for(Ff(l,u,y),l=l.sibling;l!==null;)Ff(l,u,y),l=l.sibling}function Df(l,u,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,u?Ie(y,l,u):Wt(y,l);else if(T!==4&&(l=l.child)!==null)for(Df(l,u,y),l=l.sibling;l!==null;)Df(l,u,y),l=l.sibling}var Qe=null,fn=!1;function dn(l,u,y){for(y=y.child;y!==null;)Uf(l,u,y),y=y.sibling}function Uf(l,u,y){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(kl,y)}catch{}switch(y.tag){case 5:We||Ps(y,u);case 6:if(ct){var T=Qe,E=fn;Qe=null,dn(l,u,y),fn=E,(Qe=T)!==null&&(fn?$h(Qe,y.stateNode):jh(Qe,y.stateNode))}else dn(l,u,y);break;case 18:ct&&Qe!==null&&(fn?t3(Qe,y.stateNode):JL(Qe,y.stateNode));break;case 4:ct?(T=Qe,E=fn,Qe=y.stateNode.containerInfo,fn=!0,dn(l,u,y),Qe=T,fn=E):(_t&&(T=y.stateNode.containerInfo,E=mv(T),zh(T,E)),dn(l,u,y));break;case 0:case 11:case 14:case 15:if(!We&&(T=y.updateQueue)!==null&&(T=T.lastEffect)!==null){E=T=T.next;do{var R=E,z=R.destroy;R=R.tag,z!==void 0&&(2&R||4&R)&&k0(y,u,z),E=E.next}while(E!==T)}dn(l,u,y);break;case 1:if(!We&&(Ps(y,u),typeof(T=y.stateNode).componentWillUnmount=="function"))try{T.props=y.memoizedProps,T.state=y.memoizedState,T.componentWillUnmount()}catch(Z){fe(y,u,Z)}dn(l,u,y);break;case 21:dn(l,u,y);break;case 22:1&y.mode?(We=(T=We)||y.memoizedState!==null,dn(l,u,y),We=T):dn(l,u,y);break;default:dn(l,u,y)}}function B0(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var y=l.stateNode;y===null&&(y=l.stateNode=new E3),u.forEach(function(T){var E=R3.bind(null,l,T);y.has(T)||(y.add(T),T.then(E,E))})}}function Vr(l,u){var y=u.deletions;if(y!==null)for(var T=0;T<y.length;T++){var E=y[T];try{var R=l,z=u;if(ct){var Z=z;t:for(;Z!==null;){switch(Z.tag){case 5:Qe=Z.stateNode,fn=!1;break t;case 3:case 4:Qe=Z.stateNode.containerInfo,fn=!0;break t}Z=Z.return}if(Qe===null)throw Error(s(160));Uf(R,z,E),Qe=null,fn=!1}else Uf(R,z,E);var et=E.alternate;et!==null&&(et.return=null),E.return=null}catch(st){fe(E,u,st)}}if(12854&u.subtreeFlags)for(u=u.child;u!==null;)F0(u,l),u=u.sibling}function F0(l,u){var y=l.alternate,T=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Vr(u,l),pn(l),4&T){try{Da(3,l,l.return),tu(3,l)}catch(ot){fe(l,l.return,ot)}try{Da(5,l,l.return)}catch(ot){fe(l,l.return,ot)}}break;case 1:Vr(u,l),pn(l),512&T&&y!==null&&Ps(y,y.return);break;case 5:if(Vr(u,l),pn(l),512&T&&y!==null&&Ps(y,y.return),ct){if(32&l.flags){var E=l.stateNode;try{pv(E)}catch(ot){fe(l,l.return,ot)}}if(4&T&&(E=l.stateNode)!=null){var R=l.memoizedProps;if(y=y!==null?y.memoizedProps:R,T=l.type,u=l.updateQueue,l.updateQueue=null,u!==null)try{lr(E,u,T,y,R,l)}catch(ot){fe(l,l.return,ot)}}}break;case 6:if(Vr(u,l),pn(l),4&T&&ct){if(l.stateNode===null)throw Error(s(162));E=l.stateNode,R=l.memoizedProps,y=y!==null?y.memoizedProps:R;try{Qt(E,y,R)}catch(ot){fe(l,l.return,ot)}}break;case 3:if(Vr(u,l),pn(l),4&T){if(ct&&yt&&y!==null&&y.memoizedState.isDehydrated)try{ZL(u.containerInfo)}catch(ot){fe(l,l.return,ot)}if(_t){E=u.containerInfo,R=u.pendingChildren;try{zh(E,R)}catch(ot){fe(l,l.return,ot)}}}break;case 4:if(Vr(u,l),pn(l),4&T&&_t){E=(R=l.stateNode).containerInfo,R=R.pendingChildren;try{zh(E,R)}catch(ot){fe(l,l.return,ot)}}break;case 13:Vr(u,l),pn(l),8192&(E=l.child).flags&&(R=E.memoizedState!==null,E.stateNode.isHidden=R,!R||E.alternate!==null&&E.alternate.memoizedState!==null||(Vf=Le())),4&T&&B0(l);break;case 22:var z=y!==null&&y.memoizedState!==null;if(1&l.mode?(We=(y=We)||z,Vr(u,l),We=y):Vr(u,l),pn(l),8192&T){if(y=l.memoizedState!==null,(l.stateNode.isHidden=y)&&!z&&(1&l.mode)!=0)for(St=l,T=l.child;T!==null;){for(u=St=T;St!==null;){var Z=(z=St).child;switch(z.tag){case 0:case 11:case 14:case 15:Da(4,z,z.return);break;case 1:Ps(z,z.return);var et=z.stateNode;if(typeof et.componentWillUnmount=="function"){var st=z,lt=z.return;try{var vt=st;et.props=vt.memoizedProps,et.state=vt.memoizedState,et.componentWillUnmount()}catch(ot){fe(st,lt,ot)}}break;case 5:Ps(z,z.return);break;case 22:if(z.memoizedState!==null){j0(u);continue}}Z!==null?(Z.return=z,St=Z):j0(u)}T=T.sibling}if(ct){t:if(T=null,ct)for(u=l;;){if(u.tag===5){if(T===null){T=u;try{E=u.stateNode,y?RL(E):ML(u.stateNode,u.memoizedProps)}catch(ot){fe(l,l.return,ot)}}}else if(u.tag===6){if(T===null)try{R=u.stateNode,y?NL(R):LL(R,u.memoizedProps)}catch(ot){fe(l,l.return,ot)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===l)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break t;for(;u.sibling===null;){if(u.return===null||u.return===l)break t;T===u&&(T=null),u=u.return}T===u&&(T=null),u.sibling.return=u.return,u=u.sibling}}}break;case 19:Vr(u,l),pn(l),4&T&&B0(l);break;case 21:break;default:Vr(u,l),pn(l)}}function pn(l){var u=l.flags;if(2&u){try{if(ct){t:{for(var y=l.return;y!==null;){if(M0(y)){var T=y;break t}y=y.return}throw Error(s(160))}switch(T.tag){case 5:var E=T.stateNode;32&T.flags&&(pv(E),T.flags&=-33),Df(l,L0(l),E);break;case 3:case 4:var R=T.stateNode.containerInfo;Ff(l,L0(l),R);break;default:throw Error(s(161))}}}catch(z){fe(l,l.return,z)}l.flags&=-3}4096&u&&(l.flags&=-4097)}function A3(l,u,y){St=l,D0(l)}function D0(l,u,y){for(var T=(1&l.mode)!=0;St!==null;){var E=St,R=E.child;if(E.tag===22&&T){var z=E.memoizedState!==null||Jl;if(!z){var Z=E.alternate,et=Z!==null&&Z.memoizedState!==null||We;Z=Jl;var st=We;if(Jl=z,(We=et)&&!st)for(St=E;St!==null;)et=(z=St).child,z.tag===22&&z.memoizedState!==null?$0(E):et!==null?(et.return=z,St=et):$0(E);for(;R!==null;)St=R,D0(R),R=R.sibling;St=E,Jl=Z,We=st}U0(l)}else 8772&E.subtreeFlags&&R!==null?(R.return=E,St=R):U0(l)}}function U0(l){for(;St!==null;){var u=St;if(8772&u.flags){var y=u.alternate;try{if(8772&u.flags)switch(u.tag){case 0:case 11:case 15:We||tu(5,u);break;case 1:var T=u.stateNode;if(4&u.flags&&!We)if(y===null)T.componentDidMount();else{var E=u.elementType===u.type?y.memoizedProps:qr(u.type,y.memoizedProps);T.componentDidUpdate(E,y.memoizedState,T.__reactInternalSnapshotBeforeUpdate)}var R=u.updateQueue;R!==null&&Fv(u,R,T);break;case 3:var z=u.updateQueue;if(z!==null){if(y=null,u.child!==null)switch(u.child.tag){case 5:y=V(u.child.stateNode);break;case 1:y=u.child.stateNode}Fv(u,z,y)}break;case 5:var Z=u.stateNode;y===null&&4&u.flags&&ye(Z,u.type,u.memoizedProps,u);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(yt&&u.memoizedState===null){var et=u.alternate;if(et!==null){var st=et.memoizedState;if(st!==null){var lt=st.dehydrated;lt!==null&&QL(lt)}}}break;default:throw Error(s(163))}We||512&u.flags&&Bf(u)}catch(vt){fe(u,u.return,vt)}}if(u===l){St=null;break}if((y=u.sibling)!==null){y.return=u.return,St=y;break}St=u.return}}function j0(l){for(;St!==null;){var u=St;if(u===l){St=null;break}var y=u.sibling;if(y!==null){y.return=u.return,St=y;break}St=u.return}}function $0(l){for(;St!==null;){var u=St;try{switch(u.tag){case 0:case 11:case 15:var y=u.return;try{tu(4,u)}catch(et){fe(u,y,et)}break;case 1:var T=u.stateNode;if(typeof T.componentDidMount=="function"){var E=u.return;try{T.componentDidMount()}catch(et){fe(u,E,et)}}var R=u.return;try{Bf(u)}catch(et){fe(u,R,et)}break;case 5:var z=u.return;try{Bf(u)}catch(et){fe(u,z,et)}}}catch(et){fe(u,u.return,et)}if(u===l){St=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,St=Z;break}St=u.return}}var eu=0,ru=1,nu=2,iu=3,su=4;if(typeof Symbol=="function"&&Symbol.for){var Ua=Symbol.for;eu=Ua("selector.component"),ru=Ua("selector.has_pseudo_class"),nu=Ua("selector.role"),iu=Ua("selector.test_id"),su=Ua("selector.text")}function jf(l){var u=Nt(l);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(s(364));return u}if((l=bt(l))===null)throw Error(s(362));return l.stateNode.current}function $f(l,u){switch(u.$$typeof){case eu:if(l.type===u.value)return!0;break;case ru:t:{u=u.value,l=[l,0];for(var y=0;y<l.length;){var T=l[y++],E=l[y++],R=u[E];if(T.tag!==5||!mt(T)){for(;R!=null&&$f(T,R);)R=u[++E];if(E===u.length){u=!0;break t}for(T=T.child;T!==null;)l.push(T,E),T=T.sibling}}u=!1}return u;case nu:if(l.tag===5&&It(l.stateNode,u.value))return!0;break;case su:if((l.tag===5||l.tag===6)&&(l=Dt(l))!==null&&0<=l.indexOf(u.value))return!0;break;case iu:if(l.tag===5&&typeof(l=l.memoizedProps["data-testname"])=="string"&&l.toLowerCase()===u.value.toLowerCase())return!0;break;default:throw Error(s(365))}return!1}function zf(l){switch(l.$$typeof){case eu:return"<"+(N(l.value)||"Unknown")+">";case ru:return":has("+(zf(l)||"")+")";case nu:return'[role="'+l.value+'"]';case su:return'"'+l.value+'"';case iu:return'[data-testname="'+l.value+'"]';default:throw Error(s(365))}}function z0(l,u){var y=[];l=[l,0];for(var T=0;T<l.length;){var E=l[T++],R=l[T++],z=u[R];if(E.tag!==5||!mt(E)){for(;z!=null&&$f(E,z);)z=u[++R];if(R===u.length)y.push(E);else for(E=E.child;E!==null;)l.push(E,R),E=E.sibling}}return y}function Hf(l,u){if(!gt)throw Error(s(363));l=z0(l=jf(l),u),u=[],l=Array.from(l);for(var y=0;y<l.length;){var T=l[y++];if(T.tag===5)mt(T)||u.push(T.stateNode);else for(T=T.child;T!==null;)l.push(T),T=T.sibling}return u}var C3=Math.ceil,au=a.ReactCurrentDispatcher,Gf=a.ReactCurrentOwner,Se=a.ReactCurrentBatchConfig,Gt=0,De=null,Ae=null,je=0,hr=0,Is=Vn(0),ke=0,ja=null,Pi=0,ou=0,qf=0,$a=null,fr=null,Vf=0,Wf=1/0,Kn=null;function ks(){Wf=Le()+500}var H0,lu=!1,Xf=null,Zn=null,uu=!1,Qn=null,cu=0,za=0,Yf=null,hu=-1,fu=0;function Xe(){return 6&Gt?Le():hu!==-1?hu:hu=Le()}function Jn(l){return 1&l.mode?2&Gt&&je!==0?je&-je:f3.transition!==null?(fu===0&&(fu=Sv()),fu):(l=Xt)!==0?l:ie():1}function Sr(l,u,y,T){if(50<za)throw za=0,Yf=null,Error(s(185));Aa(l,y,T),2&Gt&&l===De||(l===De&&(!(2&Gt)&&(ou|=y),ke===4&&ti(l,je)),ir(l,T),y===1&&Gt===0&&!(1&u.mode)&&(ks(),Rl&&an()))}function ir(l,u){var y=l.callbackNode;(function(E,R){for(var z=E.suspendedLanes,Z=E.pingedLanes,et=E.expirationTimes,st=E.pendingLanes;0<st;){var lt=31-zr(st),vt=1<<lt,ot=et[lt];ot===-1?vt&z&&!(vt&Z)||(et[lt]=o3(vt,R)):ot<=R&&(E.expiredLanes|=vt),st&=~vt}})(l,u);var T=Il(l,l===De?je:0);if(T===0)y!==null&&Ev(y),l.callbackNode=null,l.callbackPriority=0;else if(u=T&-T,l.callbackPriority!==u){if(y!=null&&Ev(y),u===1)l.tag===0?function(E){Rl=!0,Cv(E)}(q0.bind(null,l)):Cv(q0.bind(null,l)),nt?at(function(){!(6&Gt)&&an()}):Jh(tf,an),y=null;else{switch(Tv(T)){case 1:y=tf;break;case 4:y=c3;break;case 16:default:y=Av;break;case 536870912:y=h3}y=J0(y,G0.bind(null,l))}l.callbackPriority=u,l.callbackNode=y}}function G0(l,u){if(hu=-1,fu=0,(6&Gt)!=0)throw Error(s(327));var y=l.callbackNode;if(ki()&&l.callbackNode!==y)return null;var T=Il(l,l===De?je:0);if(T===0)return null;if(30&T||T&l.expiredLanes||u)u=du(l,T);else{u=T;var E=Gt;Gt|=2;var R=X0();for(De===l&&je===u||(Kn=null,ks(),Ii(l,u));;)try{P3();break}catch(Z){W0(l,Z)}uf(),au.current=R,Gt=E,Ae!==null?u=0:(De=null,je=0,u=ke)}if(u!==0){if(u===2&&(E=Kh(l))!==0&&(T=E,u=Kf(l,E)),u===1)throw y=ja,Ii(l,0),ti(l,T),ir(l,Le()),y;if(u===6)ti(l,T);else{if(E=l.current.alternate,(30&T)==0&&!function(Z){for(var et=Z;;){if(16384&et.flags){var st=et.updateQueue;if(st!==null&&(st=st.stores)!==null)for(var lt=0;lt<st.length;lt++){var vt=st[lt],ot=vt.getSnapshot;vt=vt.value;try{if(!Hr(ot(),vt))return!1}catch{return!1}}}if(st=et.child,16384&et.subtreeFlags&&st!==null)st.return=et,et=st;else{if(et===Z)break;for(;et.sibling===null;){if(et.return===null||et.return===Z)return!0;et=et.return}et.sibling.return=et.return,et=et.sibling}}return!0}(E)&&((u=du(l,T))===2&&(R=Kh(l))!==0&&(T=R,u=Kf(l,R)),u===1))throw y=ja,Ii(l,0),ti(l,T),ir(l,Le()),y;switch(l.finishedWork=E,l.finishedLanes=T,u){case 0:case 1:throw Error(s(345));case 2:case 5:Rs(l,fr,Kn);break;case 3:if(ti(l,T),(130023424&T)===T&&10<(u=Vf+500-Le())){if(Il(l,0)!==0)break;if(((E=l.suspendedLanes)&T)!==T){Xe(),l.pingedLanes|=l.suspendedLanes&E;break}l.timeoutHandle=W(Rs.bind(null,l,fr,Kn),u);break}Rs(l,fr,Kn);break;case 4:if(ti(l,T),(4194240&T)===T)break;for(u=l.eventTimes,E=-1;0<T;){var z=31-zr(T);R=1<<z,(z=u[z])>E&&(E=z),T&=~R}if(T=E,10<(T=(120>(T=Le()-T)?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*C3(T/1960))-T)){l.timeoutHandle=W(Rs.bind(null,l,fr,Kn),T);break}Rs(l,fr,Kn);break;default:throw Error(s(329))}}}return ir(l,Le()),l.callbackNode===y?G0.bind(null,l):null}function Kf(l,u){var y=$a;return l.current.memoizedState.isDehydrated&&(Ii(l,u).flags|=256),(l=du(l,u))!==2&&(u=fr,fr=y,u!==null&&Zf(u)),l}function Zf(l){fr===null?fr=l:fr.push.apply(fr,l)}function ti(l,u){for(u&=~qf,u&=~ou,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var y=31-zr(u),T=1<<y;l[y]=-1,u&=~T}}function q0(l){if(6&Gt)throw Error(s(327));ki();var u=Il(l,0);if(!(1&u))return ir(l,Le()),null;var y=du(l,u);if(l.tag!==0&&y===2){var T=Kh(l);T!==0&&(u=T,y=Kf(l,T))}if(y===1)throw y=ja,Ii(l,0),ti(l,u),ir(l,Le()),y;if(y===6)throw Error(s(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Rs(l,fr,Kn),ir(l,Le()),null}function V0(l){Qn!==null&&Qn.tag===0&&!(6&Gt)&&ki();var u=Gt;Gt|=1;var y=Se.transition,T=Xt;try{if(Se.transition=null,Xt=1,l)return l()}finally{Xt=T,Se.transition=y,!(6&(Gt=u))&&an()}}function Qf(){hr=Is.current,ce(Is)}function Ii(l,u){l.finishedWork=null,l.finishedLanes=0;var y=l.timeoutHandle;if(y!==tt&&(l.timeoutHandle=tt,Q(y)),Ae!==null)for(y=Ae.return;y!==null;){var T=y;switch(nf(T),T.tag){case 1:(T=T.type.childContextTypes)!=null&&Wh();break;case 3:Cs(),ce(er),ce(qe),_f();break;case 5:yf(T);break;case 4:Cs();break;case 13:case 19:ce(be);break;case 10:cf(T.type._context);break;case 22:case 23:Qf()}y=y.return}if(De=l,Ae=l=ei(l.current,null),je=hr=u,ke=0,ja=null,qf=ou=Pi=0,fr=$a=null,Ci!==null){for(u=0;u<Ci.length;u++)if((T=(y=Ci[u]).interleaved)!==null){y.interleaved=null;var E=T.next,R=y.pending;if(R!==null){var z=R.next;R.next=E,T.next=z}y.pending=T}Ci=null}return l}function W0(l,u){for(;;){var y=Ae;try{if(uf(),Gl.current=Xl,ql){for(var T=ve.memoizedState;T!==null;){var E=T.queue;E!==null&&(E.pending=null),T=T.next}ql=!1}if(Oi=0,Fe=Be=ve=null,ka=!1,Ra=0,Gf.current=null,y===null||y.return===null){ke=1,ja=u,Ae=null;break}t:{var R=l,z=y.return,Z=y,et=u;if(u=je,Z.flags|=32768,et!==null&&typeof et=="object"&&typeof et.then=="function"){var st=et,lt=Z,vt=lt.tag;if(!(1&lt.mode)&&(vt===0||vt===11||vt===15)){var ot=lt.alternate;ot?(lt.updateQueue=ot.updateQueue,lt.memoizedState=ot.memoizedState,lt.lanes=ot.lanes):(lt.updateQueue=null,lt.memoizedState=null)}var pt=g0(z);if(pt!==null){pt.flags&=-257,y0(pt,z,Z,0,u),1&pt.mode&&m0(R,st,u),et=st;var At=(u=pt).updateQueue;if(At===null){var jt=new Set;jt.add(et),u.updateQueue=jt}else At.add(et);break t}if(!(1&u)){m0(R,st,u),Jf();break t}et=Error(s(426))}else if(he&&1&Z.mode){var ut=g0(z);if(ut!==null){!(65536&ut.flags)&&(ut.flags|=256),y0(ut,z,Z,0,u),of(Os(et,Z));break t}}R=et=Os(et,Z),ke!==4&&(ke=2),$a===null?$a=[R]:$a.push(R),R=z;do{switch(R.tag){case 3:R.flags|=65536,u&=-u,R.lanes|=u,Bv(R,d0(0,et,u));break t;case 1:Z=et;var J=R.type,it=R.stateNode;if(!(128&R.flags)&&(typeof J.getDerivedStateFromError=="function"||it!==null&&typeof it.componentDidCatch=="function"&&(Zn===null||!Zn.has(it)))){R.flags|=65536,u&=-u,R.lanes|=u,Bv(R,p0(R,Z,u));break t}}R=R.return}while(R!==null)}K0(y)}catch(ft){u=ft,Ae===y&&y!==null&&(Ae=y=y.return);continue}break}}function X0(){var l=au.current;return au.current=Xl,l===null?Xl:l}function Jf(){ke!==0&&ke!==3&&ke!==2||(ke=4),De===null||!(268435455&Pi)&&!(268435455&ou)||ti(De,je)}function du(l,u){var y=Gt;Gt|=2;var T=X0();for(De===l&&je===u||(Kn=null,Ii(l,u));;)try{O3();break}catch(E){W0(l,E)}if(uf(),Gt=y,au.current=T,Ae!==null)throw Error(s(261));return De=null,je=0,ke}function O3(){for(;Ae!==null;)Y0(Ae)}function P3(){for(;Ae!==null&&!l3();)Y0(Ae)}function Y0(l){var u=H0(l.alternate,l,hr);l.memoizedProps=l.pendingProps,u===null?K0(l):Ae=u,Gf.current=null}function K0(l){var u=l;do{var y=u.alternate;if(l=u.return,(32768&u.flags)==0){if((y=S3(y,u,hr))!==null)return void(Ae=y)}else{if((y=T3(y,u))!==null)return y.flags&=32767,void(Ae=y);if(l===null)return ke=6,void(Ae=null);l.flags|=32768,l.subtreeFlags=0,l.deletions=null}if((u=u.sibling)!==null)return void(Ae=u);Ae=u=l}while(u!==null);ke===0&&(ke=5)}function Rs(l,u,y){var T=Xt,E=Se.transition;try{Se.transition=null,Xt=1,function(R,z,Z,et){do ki();while(Qn!==null);if(6&Gt)throw Error(s(327));Z=R.finishedWork;var st=R.finishedLanes;if(Z===null)return null;if(R.finishedWork=null,R.finishedLanes=0,Z===R.current)throw Error(s(177));R.callbackNode=null,R.callbackPriority=0;var lt=Z.lanes|Z.childLanes;if(function(pt,At){var jt=pt.pendingLanes&~At;pt.pendingLanes=At,pt.suspendedLanes=0,pt.pingedLanes=0,pt.expiredLanes&=At,pt.mutableReadLanes&=At,pt.entangledLanes&=At,At=pt.entanglements;var ut=pt.eventTimes;for(pt=pt.expirationTimes;0<jt;){var J=31-zr(jt),it=1<<J;At[J]=0,ut[J]=-1,pt[J]=-1,jt&=~it}}(R,lt),R===De&&(Ae=De=null,je=0),!(2064&Z.subtreeFlags)&&!(2064&Z.flags)||uu||(uu=!0,J0(Av,function(){return ki(),null})),lt=(15990&Z.flags)!=0,(15990&Z.subtreeFlags)!=0||lt){lt=Se.transition,Se.transition=null;var vt=Xt;Xt=1;var ot=Gt;Gt|=4,Gf.current=null,function(pt,At){for(G(pt.containerInfo),St=At;St!==null;)if(At=(pt=St).child,(1028&pt.subtreeFlags)!=0&&At!==null)At.return=pt,St=At;else for(;St!==null;){pt=St;try{var jt=pt.alternate;if(1024&pt.flags)switch(pt.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(jt!==null){var ut=jt.memoizedProps,J=jt.memoizedState,it=pt.stateNode,ft=it.getSnapshotBeforeUpdate(pt.elementType===pt.type?ut:qr(pt.type,ut),J);it.__reactInternalSnapshotBeforeUpdate=ft}break;case 3:ct&&BL(pt.stateNode.containerInfo);break;default:throw Error(s(163))}}catch(Rt){fe(pt,pt.return,Rt)}if((At=pt.sibling)!==null){At.return=pt.return,St=At;break}St=pt.return}jt=R0,R0=!1}(R,Z),F0(Z,R),D(R.containerInfo),R.current=Z,A3(Z),u3(),Gt=ot,Xt=vt,Se.transition=lt}else R.current=Z;if(uu&&(uu=!1,Qn=R,cu=st),lt=R.pendingLanes,lt===0&&(Zn=null),function(pt){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(kl,pt,void 0,(128&pt.current.flags)==128)}catch{}}(Z.stateNode),ir(R,Le()),z!==null)for(et=R.onRecoverableError,Z=0;Z<z.length;Z++)st=z[Z],et(st.value,{componentStack:st.stack,digest:st.digest});if(lu)throw lu=!1,R=Xf,Xf=null,R;1&cu&&R.tag!==0&&ki(),lt=R.pendingLanes,1&lt?R===Yf?za++:(za=0,Yf=R):za=0,an()}(l,u,y,T)}finally{Se.transition=E,Xt=T}return null}function ki(){if(Qn!==null){var l=Tv(cu),u=Se.transition,y=Xt;try{if(Se.transition=null,Xt=16>l?16:l,Qn===null)var T=!1;else{if(l=Qn,Qn=null,cu=0,(6&Gt)!=0)throw Error(s(331));var E=Gt;for(Gt|=4,St=l.current;St!==null;){var R=St,z=R.child;if(16&St.flags){var Z=R.deletions;if(Z!==null){for(var et=0;et<Z.length;et++){var st=Z[et];for(St=st;St!==null;){var lt=St;switch(lt.tag){case 0:case 11:case 15:Da(8,lt,R)}var vt=lt.child;if(vt!==null)vt.return=lt,St=vt;else for(;St!==null;){var ot=(lt=St).sibling,pt=lt.return;if(N0(lt),lt===st){St=null;break}if(ot!==null){ot.return=pt,St=ot;break}St=pt}}}var At=R.alternate;if(At!==null){var jt=At.child;if(jt!==null){At.child=null;do{var ut=jt.sibling;jt.sibling=null,jt=ut}while(jt!==null)}}St=R}}if(2064&R.subtreeFlags&&z!==null)z.return=R,St=z;else t:for(;St!==null;){if(2048&(R=St).flags)switch(R.tag){case 0:case 11:case 15:Da(9,R,R.return)}var J=R.sibling;if(J!==null){J.return=R.return,St=J;break t}St=R.return}}var it=l.current;for(St=it;St!==null;){var ft=(z=St).child;if(2064&z.subtreeFlags&&ft!==null)ft.return=z,St=ft;else t:for(z=it;St!==null;){if(2048&(Z=St).flags)try{switch(Z.tag){case 0:case 11:case 15:tu(9,Z)}}catch(Jt){fe(Z,Z.return,Jt)}if(Z===z){St=null;break t}var Rt=Z.sibling;if(Rt!==null){Rt.return=Z.return,St=Rt;break t}St=Z.return}}if(Gt=E,an(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(kl,l)}catch{}T=!0}return T}finally{Xt=y,Se.transition=u}}return!1}function Z0(l,u,y){l=Yn(l,u=d0(0,u=Os(y,u),1),1),u=Xe(),l!==null&&(Aa(l,1,u),ir(l,u))}function fe(l,u,y){if(l.tag===3)Z0(l,l,y);else for(;u!==null;){if(u.tag===3){Z0(u,l,y);break}if(u.tag===1){var T=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Zn===null||!Zn.has(T))){u=Yn(u,l=p0(u,l=Os(y,l),1),1),l=Xe(),u!==null&&(Aa(u,1,l),ir(u,l));break}}u=u.return}}function I3(l,u,y){var T=l.pingCache;T!==null&&T.delete(u),u=Xe(),l.pingedLanes|=l.suspendedLanes&y,De===l&&(je&y)===y&&(ke===4||ke===3&&(130023424&je)===je&&500>Le()-Vf?Ii(l,0):qf|=y),ir(l,u)}function Q0(l,u){u===0&&(1&l.mode?(u=Yh,!(130023424&(Yh<<=1))&&(Yh=4194304)):u=1);var y=Xe();(l=ln(l,u))!==null&&(Aa(l,u,y),ir(l,y))}function k3(l){var u=l.memoizedState,y=0;u!==null&&(y=u.retryLane),Q0(l,y)}function R3(l,u){var y=0;switch(l.tag){case 13:var T=l.stateNode,E=l.memoizedState;E!==null&&(y=E.retryLane);break;case 19:T=l.stateNode;break;default:throw Error(s(314))}T!==null&&T.delete(u),Q0(l,y)}function J0(l,u){return Jh(l,u)}function N3(l,u,y,T){this.tag=l,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(l,u,y,T){return new N3(l,u,y,T)}function td(l){return!(!(l=l.prototype)||!l.isReactComponent)}function ei(l,u){var y=l.alternate;return y===null?((y=Tr(l.tag,u,l.key,l.mode)).elementType=l.elementType,y.type=l.type,y.stateNode=l.stateNode,y.alternate=l,l.alternate=y):(y.pendingProps=u,y.type=l.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=14680064&l.flags,y.childLanes=l.childLanes,y.lanes=l.lanes,y.child=l.child,y.memoizedProps=l.memoizedProps,y.memoizedState=l.memoizedState,y.updateQueue=l.updateQueue,u=l.dependencies,y.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},y.sibling=l.sibling,y.index=l.index,y.ref=l.ref,y}function pu(l,u,y,T,E,R){var z=2;if(T=l,typeof l=="function")td(l)&&(z=1);else if(typeof l=="string")z=5;else t:switch(l){case h:return Ri(y.children,E,R,u);case d:z=8,E|=8;break;case p:return(l=Tr(12,y,u,2|E)).elementType=p,l.lanes=R,l;case v:return(l=Tr(13,y,u,E)).elementType=v,l.lanes=R,l;case b:return(l=Tr(19,y,u,E)).elementType=b,l.lanes=R,l;case S:return mu(y,E,R,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case f:z=10;break t;case m:z=9;break t;case g:z=11;break t;case _:z=14;break t;case w:z=16,T=null;break t}throw Error(s(130,l==null?l:typeof l,""))}return(u=Tr(z,y,u,E)).elementType=l,u.type=T,u.lanes=R,u}function Ri(l,u,y,T){return(l=Tr(7,l,T,u)).lanes=y,l}function mu(l,u,y,T){return(l=Tr(22,l,T,u)).elementType=S,l.lanes=y,l.stateNode={isHidden:!1},l}function ed(l,u,y){return(l=Tr(6,l,null,u)).lanes=y,l}function rd(l,u,y){return(u=Tr(4,l.children!==null?l.children:[],l.key,u)).lanes=y,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function M3(l,u,y,T,E){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=tt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zh(0),this.expirationTimes=Zh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zh(0),this.identifierPrefix=T,this.onRecoverableError=E,yt&&(this.mutableSourceEagerHydrationData=null)}function t_(l,u,y,T,E,R,z,Z,et){return l=new M3(l,u,y,Z,et),u===1?(u=1,R===!0&&(u|=8)):u=0,R=Tr(3,null,null,u),l.current=R,R.stateNode=l,R.memoizedState={element:T,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},df(R),l}function e_(l){if(!l)return Wn;t:{if(P(l=l._reactInternals)!==l||l.tag!==1)throw Error(s(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(ur(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(u!==null);throw Error(s(171))}if(l.tag===1){var y=l.type;if(ur(y))return xv(l,y,u)}return u}function r_(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(s(188)):(l=Object.keys(l).join(","),Error(s(268,l)));return(l=C(u))===null?null:l.stateNode}function n_(l,u){if((l=l.memoizedState)!==null&&l.dehydrated!==null){var y=l.retryLane;l.retryLane=y!==0&&y<u?y:u}}function gu(l,u){n_(l,u),(l=l.alternate)&&n_(l,u)}function L3(l){return(l=C(l))===null?null:l.stateNode}function B3(){return null}return H0=function(l,u,y){if(l!==null)if(l.memoizedProps!==u.pendingProps||er.current)rr=!0;else{if(!(l.lanes&y)&&!(128&u.flags))return rr=!1,function(vt,ot,pt){switch(ot.tag){case 3:T0(ot),ws();break;case 5:qv(ot);break;case 1:ur(ot.type)&&Pl(ot);break;case 4:gf(ot,ot.stateNode.containerInfo);break;case 10:Nv(0,ot.type._context,ot.memoizedProps.value);break;case 13:var At=ot.memoizedState;if(At!==null)return At.dehydrated!==null?(se(be,1&be.current),ot.flags|=128,null):pt&ot.child.childLanes?A0(vt,ot,pt):(se(be,1&be.current),(vt=Rn(vt,ot,pt))!==null?vt.sibling:null);se(be,1&be.current);break;case 19:if(At=(pt&ot.childLanes)!=0,(128&vt.flags)!=0){if(At)return O0(vt,ot,pt);ot.flags|=128}var jt=ot.memoizedState;if(jt!==null&&(jt.rendering=null,jt.tail=null,jt.lastEffect=null),se(be,be.current),At)break;return null;case 22:case 23:return ot.lanes=0,x0(vt,ot,pt)}return Rn(vt,ot,pt)}(l,u,y);rr=(131072&l.flags)!=0}else rr=!1,he&&1048576&u.flags&&Ov(u,Ml,u.index);switch(u.lanes=0,u.tag){case 2:var T=u.type;Ql(l,u),l=u.pendingProps;var E=_s(u,qe.current);Ts(u,y),E=wf(null,u,T,l,E,y);var R=Sf();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,ur(T)?(R=!0,Pl(u)):R=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,df(u),E.updater=$l,u.stateNode=E,E._reactInternals=u,mf(u,T,l,y),u=kf(null,u,T,!0,R,y)):(u.tag=0,he&&R&&rf(u),nr(null,u,E,y),u=u.child),u;case 16:T=u.elementType;t:{switch(Ql(l,u),l=u.pendingProps,T=(E=T._init)(T._payload),u.type=T,E=u.tag=function(vt){if(typeof vt=="function")return td(vt)?1:0;if(vt!=null){if((vt=vt.$$typeof)===g)return 11;if(vt===_)return 14}return 2}(T),l=qr(T,l),E){case 0:u=If(null,u,T,l,y);break t;case 1:u=S0(null,u,T,l,y);break t;case 11:u=v0(null,u,T,l,y);break t;case 14:u=_0(null,u,T,qr(T.type,l),y);break t}throw Error(s(306,T,""))}return u;case 0:return T=u.type,E=u.pendingProps,If(l,u,T,E=u.elementType===T?E:qr(T,E),y);case 1:return T=u.type,E=u.pendingProps,S0(l,u,T,E=u.elementType===T?E:qr(T,E),y);case 3:t:{if(T0(u),l===null)throw Error(s(387));T=u.pendingProps,E=(R=u.memoizedState).element,Lv(l,u),jl(u,T,null,y);var z=u.memoizedState;if(T=z.element,yt&&R.isDehydrated){if(R={element:T,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},u.updateQueue.baseState=R,u.memoizedState=R,256&u.flags){u=E0(l,u,T,y,E=Os(Error(s(423)),u));break t}if(T!==E){u=E0(l,u,T,y,E=Os(Error(s(424)),u));break t}for(yt&&(_r=qL(u.stateNode.containerInfo),cr=u,he=!0,Gr=null,Ca=!1),y=Gv(u,null,T,y),u.child=y;y;)y.flags=-3&y.flags|4096,y=y.sibling}else{if(ws(),T===E){u=Rn(l,u,y);break t}nr(l,u,T,y)}u=u.child}return u;case 5:return qv(u),l===null&&af(u),T=u.type,E=u.pendingProps,R=l!==null?l.memoizedProps:null,z=E.children,K(T,E)?z=null:R!==null&&K(T,R)&&(u.flags|=32),w0(l,u),nr(l,u,z,y),u.child;case 6:return l===null&&af(u),null;case 13:return A0(l,u,y);case 4:return gf(u,u.stateNode.containerInfo),T=u.pendingProps,l===null?u.child=Es(u,null,T,y):nr(l,u,T,y),u.child;case 11:return T=u.type,E=u.pendingProps,v0(l,u,T,E=u.elementType===T?E:qr(T,E),y);case 7:return nr(l,u,u.pendingProps,y),u.child;case 8:case 12:return nr(l,u,u.pendingProps.children,y),u.child;case 10:t:{if(T=u.type._context,E=u.pendingProps,R=u.memoizedProps,Nv(0,T,z=E.value),R!==null)if(Hr(R.value,z)){if(R.children===E.children&&!er.current){u=Rn(l,u,y);break t}}else for((R=u.child)!==null&&(R.return=u);R!==null;){var Z=R.dependencies;if(Z!==null){z=R.child;for(var et=Z.firstContext;et!==null;){if(et.context===T){if(R.tag===1){(et=kn(-1,y&-y)).tag=2;var st=R.updateQueue;if(st!==null){var lt=(st=st.shared).pending;lt===null?et.next=et:(et.next=lt.next,lt.next=et),st.pending=et}}R.lanes|=y,(et=R.alternate)!==null&&(et.lanes|=y),hf(R.return,y,u),Z.lanes|=y;break}et=et.next}}else if(R.tag===10)z=R.type===u.type?null:R.child;else if(R.tag===18){if((z=R.return)===null)throw Error(s(341));z.lanes|=y,(Z=z.alternate)!==null&&(Z.lanes|=y),hf(z,y,u),z=R.sibling}else z=R.child;if(z!==null)z.return=R;else for(z=R;z!==null;){if(z===u){z=null;break}if((R=z.sibling)!==null){R.return=z.return,z=R;break}z=z.return}R=z}nr(l,u,E.children,y),u=u.child}return u;case 9:return E=u.type,T=u.pendingProps.children,Ts(u,y),T=T(E=br(E)),u.flags|=1,nr(l,u,T,y),u.child;case 14:return E=qr(T=u.type,u.pendingProps),_0(l,u,T,E=qr(T.type,E),y);case 15:return b0(l,u,u.type,u.pendingProps,y);case 17:return T=u.type,E=u.pendingProps,E=u.elementType===T?E:qr(T,E),Ql(l,u),u.tag=1,ur(T)?(l=!0,Pl(u)):l=!1,Ts(u,y),jv(u,T,E),mf(u,T,E,y),kf(null,u,T,!0,l,y);case 19:return O0(l,u,y);case 22:return x0(l,u,y)}throw Error(s(156,u.tag))},t.attemptContinuousHydration=function(l){if(l.tag===13){var u=ln(l,134217728);u!==null&&Sr(u,l,134217728,Xe()),gu(l,134217728)}},t.attemptDiscreteHydration=function(l){if(l.tag===13){var u=ln(l,1);u!==null&&Sr(u,l,1,Xe()),gu(l,1)}},t.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var u=Jn(l),y=ln(l,u);y!==null&&Sr(y,l,u,Xe()),gu(l,u)}},t.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var y=Ea(u.pendingLanes);y!==0&&(Qh(u,1|y),ir(u,Le()),!(6&Gt)&&(ks(),an()))}break;case 13:V0(function(){var T=ln(l,1);if(T!==null){var E=Xe();Sr(T,l,1,E)}}),gu(l,1)}},t.batchedUpdates=function(l,u){var y=Gt;Gt|=1;try{return l(u)}finally{(Gt=y)===0&&(ks(),Rl&&an())}},t.createComponentSelector=function(l){return{$$typeof:eu,value:l}},t.createContainer=function(l,u,y,T,E,R,z){return t_(l,u,!1,null,0,T,0,R,z)},t.createHasPseudoClassSelector=function(l){return{$$typeof:ru,value:l}},t.createHydrationContainer=function(l,u,y,T,E,R,z,Z,et){return(l=t_(y,T,!0,l,0,R,0,Z,et)).context=e_(null),y=l.current,(R=kn(T=Xe(),E=Jn(y))).callback=u??null,Yn(y,R,E),l.current.lanes=E,Aa(l,E,T),ir(l,T),l},t.createPortal=function(l,u,y){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:T==null?null:""+T,children:l,containerInfo:u,implementation:y}},t.createRoleSelector=function(l){return{$$typeof:nu,value:l}},t.createTestNameSelector=function(l){return{$$typeof:iu,value:l}},t.createTextSelector=function(l){return{$$typeof:su,value:l}},t.deferredUpdates=function(l){var u=Xt,y=Se.transition;try{return Se.transition=null,Xt=16,l()}finally{Xt=u,Se.transition=y}},t.discreteUpdates=function(l,u,y,T,E){var R=Xt,z=Se.transition;try{return Se.transition=null,Xt=1,l(u,y,T,E)}finally{Xt=R,Se.transition=z,Gt===0&&ks()}},t.findAllNodes=Hf,t.findBoundingRects=function(l,u){if(!gt)throw Error(s(363));u=Hf(l,u),l=[];for(var y=0;y<u.length;y++)l.push(ht(u[y]));for(u=l.length-1;0<u;u--)for(var T=(y=l[u]).x,E=T+y.width,R=y.y,z=R+y.height,Z=u-1;0<=Z;Z--)if(u!==Z){var et=l[Z],st=et.x,lt=st+et.width,vt=et.y,ot=vt+et.height;if(T>=st&&R>=vt&&E<=lt&&z<=ot){l.splice(u,1);break}if(!(T!==st||y.width!==et.width||ot<R||vt>z)){vt>R&&(et.height+=vt-R,et.y=R),ot<z&&(et.height=z-vt),l.splice(u,1);break}if(!(R!==vt||y.height!==et.height||lt<T||st>E)){st>T&&(et.width+=st-T,et.x=T),lt<E&&(et.width=E-st),l.splice(u,1);break}}return l},t.findHostInstance=r_,t.findHostInstanceWithNoPortals=function(l){return(l=(l=I(l))!==null?M(l):null)===null?null:l.stateNode},t.findHostInstanceWithWarning=function(l){return r_(l)},t.flushControlled=function(l){var u=Gt;Gt|=1;var y=Se.transition,T=Xt;try{Se.transition=null,Xt=1,l()}finally{Xt=T,Se.transition=y,(Gt=u)===0&&(ks(),an())}},t.flushPassiveEffects=ki,t.flushSync=V0,t.focusWithin=function(l,u){if(!gt)throw Error(s(363));for(u=z0(l=jf(l),u),u=Array.from(u),l=0;l<u.length;){var y=u[l++];if(!mt(y)){if(y.tag===5&&re(y.stateNode))return!0;for(y=y.child;y!==null;)u.push(y),y=y.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Xt},t.getFindAllNodesFailureDescription=function(l,u){if(!gt)throw Error(s(363));var y=0,T=[];l=[jf(l),0];for(var E=0;E<l.length;){var R=l[E++],z=l[E++],Z=u[z];if((R.tag!==5||!mt(R))&&($f(R,Z)&&(T.push(zf(Z)),++z>y&&(y=z)),z<u.length))for(R=R.child;R!==null;)l.push(R,z),R=R.sibling}if(y<u.length){for(l=[];y<u.length;y++)l.push(zf(u[y]));return`findAllNodes was able to match part of the selector:
798
- `+T.join(" > ")+`
799
-
800
- No matching component was found for:
801
- `+l.join(" > ")}return null},t.getPublicRootInstance=function(l){return(l=l.current).child?l.child.tag===5?V(l.child.stateNode):l.child.stateNode:null},t.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:L3,findFiberByHostInstance:l.findFiberByHostInstance||B3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{kl=u.inject(l),sn=u}catch{}l=!!u.checkDCE}}return l},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(l,u,y,T){if(!gt)throw Error(s(363));l=Hf(l,u);var E=Pe(l,y,T).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(l,u){var y=u._getVersion;y=y(u._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[u,y]:l.mutableSourceEagerHydrationData.push(u,y)},t.runWithPriority=function(l,u){var y=Xt;try{return Xt=l,u()}finally{Xt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(l,u,y,T){var E=u.current,R=Xe(),z=Jn(E);return y=e_(y),u.context===null?u.context=y:u.pendingContext=y,(u=kn(R,z)).payload={element:l},(T=T===void 0?null:T)!==null&&(u.callback=T),(l=Yn(E,u,z))!==null&&(Sr(l,E,z,R),Ul(l,E,z)),z},t}),ug}({get exports(){return th},set exports(e){th=e}}).exports=fT();var dT=US(th),fg={name:"root",private:!0,workspaces:["packages/*"],scripts:{build:"nx run-many --target=build --all --parallel","build:force":"nx run-many --target=build --all --parallel --skip-nx-cache","build:docs":"nx run @pixi/react-docs:deploy",clean:"rimraf packages/*/dist packages/*/build",lint:"eslint .",prepare:"husky install",prerelease:"./scripts/checkReleaseBranch.mjs && npm run lint && npm run test:force && npm run build:force",release:"lerna publish --no-private",test:"nx run-many --target=test --all --parallel","test:force":"nx run-many --target=test --all --parallel --skip-nx-cache","test:ci":"nx run-many --target=test:ci --all --parallel","test:ci:force":"nx run-many --target=test:ci --all --parallel --skip-nx-cache","test:types":"nx run-many --target=test:types --all --parallel","test:types:force":"nx run-many --target=test:types --all --parallel --skip-nx-cache"},husky:{hooks:{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,js,mjs}":["eslint --cache --fix"]},resolutions:{"get-pkg-repo":"4.1.1","hosted-git-info":"^2.1.4"},dependencies:{"@babel/runtime":"^7.14.8","@pixi/app":"^7.1.1","@pixi/constants":"^7.1.1","@pixi/core":"^7.1.1","@pixi/display":"^7.1.1","@pixi/extensions":"^7.1.1","@pixi/graphics":"^7.1.1","@pixi/math":"^7.1.1","@pixi/mesh":"^7.1.1","@pixi/mesh-extras":"^7.1.1","@pixi/particle-container":"^7.1.1","@pixi/sprite":"^7.1.1","@pixi/sprite-animated":"^7.1.1","@pixi/sprite-tiling":"^7.1.1","@pixi/text":"^7.1.1","@pixi/text-bitmap":"^7.1.1","@pixi/ticker":"^7.1.1","@react-spring/animated":"^9.6.1","@react-spring/types":"^9.6.1",react:"^18.0.0","react-dom":"^18.0.0","react-reconciler":"0.29.0","react-spring":"^9.6.1"},devDependencies:{"@babel/cli":"^7.20.7","@babel/core":"^7.20.7","@babel/eslint-parser":"^7.19.1","@babel/plugin-transform-runtime":"^7.19.6","@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@nrwl/nx-cloud":"latest","@pixi/eslint-config":"^4.0.1","@rollup/plugin-alias":"^4.0.2","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-replace":"^5.0.2","@rollup/plugin-terser":"^0.2.1","@rollup/plugin-typescript":"^10.0.1","@types/jest":"^29.2.4","@types/react":"17.0.15","@types/react-dom":"17.0.9","@types/react-reconciler":"0.28.2","babel-jest":"^29.3.1","babel-plugin-module-resolver":"4.1.0","cross-env":"^7.0.3",eslint:"^8.29.0","eslint-plugin-react":"^7.31.11",husky:"^8.0.2",jest:"^29.3.1","jest-environment-jsdom":"^29.3.1","jest-extended":"^3.2.0","jest-watch-typeahead":"^2.2.1",lerna:"^6.0.3","lint-staged":"^13.1.0",nx:"15.3.0",rimraf:"^3.0.2",rollup:"^3.7.0","rollup-plugin-filesize":"^9.1.2","rollup-plugin-visualizer":"^5.9.0","ts-jest":"^29.0.3","ts-node":"^10.9.1",typescript:"^4.9.4"}},rh={},Wo={get exports(){return rh},set exports(e){rh=e}};(function(){var e,t,r,n,i,s;typeof performance<"u"&&performance!==null&&performance.now?Wo.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Wo.exports=function(){return(e()-i)/1e6},t=process.hrtime,n=(e=function(){var a;return 1e9*(a=t())[0]+a[1]})(),s=1e9*process.uptime(),i=n-s):Date.now?(Wo.exports=function(){return Date.now()-r},r=Date.now()):(Wo.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(DS);var dg,ss={},bi={};({get exports(){return ss},set exports(e){ss=e}}).exports=(dg||(dg=1,bi.ConcurrentRoot=1,bi.ContinuousEventPriority=4,bi.DefaultEventPriority=16,bi.DiscreteEventPriority=1,bi.IdleEventPriority=536870912,bi.LegacyRoot=0),bi);var pT={};function nh(e,t){e.addChild&&(e.addChild(t),typeof t.didMount=="function"&&t.didMount(t,e))}function pg(e,t){var r,n,i;(r=e.willUnmount)===null||r===void 0||r.call(e,e,t),((n=e.config)===null||n===void 0?void 0:n.destroyChildren)!==!1&&(i=e.children)!==null&&i!==void 0&&i.length&&Tn(e.children).forEach(function(s){pg(s,e)})}function mg(e,t){var r;pg(t,e),e.removeChild(t);var n=(r=t.config)!==null&&r!==void 0?r:{},i=n.destroy,s=i===void 0||i,a=n.destroyChildren,o=a===void 0||a,c=n.destroyTexture,h=c!==void 0&&c,d=n.destroyBaseTexture,p=d!==void 0&&d;s&&t.destroy({children:o,texture:h,baseTexture:p})}function gg(e,t,r){_e(t!==r,"pixi-react: PixiFiber cannot insert node before itself"),e.children.indexOf(t)!==-1&&e.removeChild(t);var n=e.getChildIndex(r);e.addChildAt(t,n)}var yg=null,Dr=dT({getRootHostContext:function(){return pT},getChildHostContext:function(e){return e},getChildHostContextForEventComponent:function(e){return e},getPublicInstance:function(e){return e},getCurrentEventPriority:function(){return function(){var e,t;if(typeof window>"u")return ss.DefaultEventPriority;switch((e=window)===null||e===void 0||(t=e.event)===null||t===void 0?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return ss.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return ss.ContinuousEventPriority;default:return ss.DefaultEventPriority}}()},prepareForCommit:function(){return null},resetAfterCommit:function(){},createInstance:function(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=lT[e];if(typeof s=="function"&&(t=s(i,n)),!t){var a=ag[e];a&&((t=a.create(n,{root:i})).didMount=a.didMount?a.didMount.bind(t):void 0,t.willUnmount=a.willUnmount?a.willUnmount.bind(t):void 0,t.applyProps=a.applyProps?a.applyProps.bind(t):void 0,t.config=a.config)}return t&&(t.__reactpixi={root:i},(typeof((r=t)===null||r===void 0?void 0:r.applyProps)=="function"?t.applyProps:rn)(t,{},n)),t},hideInstance:function(e){e.visible=!1},unhideInstance:function(e,t){var r=t==null||!t.hasOwnProperty("visible")||t.visible;e.visible=r},finalizeInitialChildren:function(e,t,r){return!1},prepareUpdate:function(e,t,r,n,i,s){return yg=function(a,o,c,h){var d=null;for(var p in c)!h.hasOwnProperty(p)&&c.hasOwnProperty(p)&&c[p]!==null&&(p===Qc||(d||(d=[]),d.push(p,null)));for(var f in h){var m=h[f],g=c!==null?c[f]:void 0;!h.hasOwnProperty(f)||m===g||m===null&&g===null||f===Qc||(d||(d=[]),d.push(f,m))}return d}(0,0,r,n)},shouldSetTextContent:function(e,t){return!1},shouldDeprioritizeSubtree:function(e,t){var r=t.alpha===void 0||t.alpha>0,n=t.renderable===void 0||t.renderable===!0,i=t.visible===void 0||t.visible===!0;return!(r&&n&&i)},createTextInstance:function(e,t,r){_e(!1,'pixi-react: Error trying to add text node "'.concat(e,'"'),"PixiFiber does not support text nodes as children of a Pixi component. To pass a string value to your component, use a property other than children. If you wish to display some text, you can use &lt;Text text={string} /&gt; instead.")},unhideTextInstance:function(e,t){},mountEventComponent:function(){},updateEventComponent:function(){},handleEventTarget:function(){},scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,warnsIfNotActing:!1,now:rh,isPrimaryRenderer:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,appendInitialChild:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=nh.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendInitialChild"}),s},appendChild:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=nh.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendChild"}),s},appendChildToContainer:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=nh.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendChildToContainer"}),s},removeChild:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=mg.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"removeChild"}),s},removeChildFromContainer:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=mg.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"removeChildFromContainer"}),s},insertBefore:gg,insertInContainerBefore:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=gg.apply(null,n);return(e=n[0].__reactpixi)===null||e===void 0||(t=e.root)===null||t===void 0||t.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"insertInContainerBefore"}),s},commitUpdate:function(e,t,r,n,i){var s,a,o=e&&e.applyProps;typeof o!="function"&&(o=rn),(o(e,n,i)||yg)&&((s=e.__reactpixi)===null||s===void 0||(a=s.root)===null||a===void 0||a.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"commitUpdate"}))},commitMount:function(e,t,r,n,i){},commitTextUpdate:function(e,t,r){},resetTextContent:function(e){},clearContainer:function(e){},getFundamentalComponentInstance:function(e){throw new Error("Not yet implemented.")},mountFundamentalComponent:function(e){throw new Error("Not yet implemented.")},shouldUpdateFundamentalComponent:function(e){throw new Error("Not yet implemented.")},unmountFundamentalComponent:function(e){throw new Error("Not yet implemented.")},getInstanceFromNode:function(e){throw new Error("Not yet implemented.")},isOpaqueHydratingObject:function(e){throw new Error("Not yet implemented")},makeOpaqueHydratingObject:function(e){throw new Error("Not yet implemented.")},makeClientIdInDEV:function(e){throw new Error("Not yet implemented")},beforeActiveInstanceBlur:function(e){},afterActiveInstanceBlur:function(){},detachDeletedInstance:function(){},preparePortalMount:function(e){}}),mT=fg.dependencies["react-dom"].replace(/[^0-9.]/g,""),gT=fg.name;Dr.injectIntoDevTools({bundleType:0,version:mT,rendererPackageName:gT,findHostInstanceByFiber:Dr.findHostInstance});var Hn=new Map;function vg(e){if(_e(Ke.prototype.isPrototypeOf(e),"Invalid argument `container`, expected instance of `PIXI.Container`."),Hn.has(e)){var t=Hn.get(e).pixiFiberContainer;Dr.updateContainer(null,t,void 0,function(){Hn.delete(e)})}}function _g(e){_e(Ke.prototype.isPrototypeOf(e),"Invalid argument `container`, expected instance of `PIXI.Container`.");var t=Hn.get(e);if(_e(!t,"Pixi React: createRoot should only be called once"),!t){var r=Dr.createContainer(e);t={pixiFiberContainer:r,reactRoot:{render:function(n){return Dr.updateContainer(n,r,void 0),Dr.getPublicRootInstance(r)},unmount:function(){vg(e),Hn.delete(e)}}},Hn.set(e,t)}return t.reactRoot}function yT(e,t,r){var n;return console.warn("Pixi React Deprecation Warning: render is deprecated, use createRoot instead"),r!==void 0&&console.warn("Pixi React Deprecation Warning: render callback no longer exists in React 18"),Hn.has(t)?n=Hn.get(t).reactRoot:n=_g(t),n.render(e)}function vT(e){vg(e)}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ca.apply(this,arguments)}function _T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jm(n.key),n)}}function En(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xo(e,t){return Xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Xo(e,t)}function xT(e,t){if(t&&(ar(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return En(e)}function Yo(e){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(e)}var Ko=dt.createContext(null),bg=Ko.Provider,xg=Ko.Consumer,wT=function(e){var t=dt.forwardRef(function(r,n){return dt.createElement(xg,null,function(i){return dt.createElement(e,ca({},r,{ref:n,app:i}))})});return t.displayName="withPIXIApp(".concat(e.displayName||e.name,")"),t};function ST(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,n=Yo(e);if(t){var i=Yo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xT(this,r)}}function wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Sg=function(){},Tg={width:oe.number,height:oe.number,onMount:oe.func,onUnmount:oe.func,raf:oe.bool,renderOnComponentChange:oe.bool,children:oe.node,options:oe.shape({autoStart:oe.bool,width:oe.number,height:oe.number,useContextAlpha:oe.bool,backgroundAlpha:oe.number,autoDensity:oe.bool,antialias:oe.bool,preserveDrawingBuffer:oe.bool,resolution:oe.number,forceCanvas:oe.bool,backgroundColor:oe.number,clearBeforeRender:oe.bool,powerPreference:oe.string,sharedTicker:oe.bool,sharedLoader:oe.bool,resizeTo:function(e,t){var r=e[t];r&&_e(r===window||r instanceof HTMLElement,"Invalid prop `resizeTo` of type ".concat(ar(r),", expect `window` or an `HTMLElement`."))},view:function(e,t,r){var n=e[t];n&&_e(n instanceof HTMLCanvasElement,"Invalid prop `view` of type ".concat(ar(n),", supplied to ").concat(r,", expected `<canvas> Element`"))}})},TT={width:800,height:600,onMount:Sg,onUnmount:Sg,raf:!0,renderOnComponentChange:!0},ih=function(e){(function(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(a&&a.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),a&&Xo(s,a)})(i,dt.Component);var t,r,n=ST(i);function i(){var s;_T(this,i);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return xe(En(s=n.call.apply(n,[this].concat(o))),"_canvas",null),xe(En(s),"_mediaQuery",null),xe(En(s),"_ticker",null),xe(En(s),"_needsUpdate",!0),xe(En(s),"app",null),xe(En(s),"updateSize",function(){var h=s.props,d=h.width,p=h.height,f=h.options;f!=null&&f.resolution||(s.app.renderer.resolution=window.devicePixelRatio,s.resetInteractionManager()),s.app.renderer.resize(d,p)}),xe(En(s),"needsRenderUpdate",function(){s._needsUpdate=!0}),xe(En(s),"renderStage",function(){var h=s.props,d=h.renderOnComponentChange;!h.raf&&d&&s._needsUpdate&&(s._needsUpdate=!1,s.app.renderer.render(s.app.stage))}),s}return t=i,(r=[{key:"componentDidMount",value:function(){var s=this.props,a=s.onMount,o=s.width,c=s.height,h=s.options,d=s.raf,p=s.renderOnComponentChange;this.app=new la(Zo(Zo({width:o,height:c,view:this._canvas},h),{},{autoDensity:(h==null?void 0:h.autoDensity)!==!1})),this.app.ticker.autoStart=!1,this.app.ticker[d?"start":"stop"](),this.app.stage.__reactpixi={root:this.app.stage},this.mountNode=Dr.createContainer(this.app.stage),Dr.updateContainer(this.getChildren(),this.mountNode,this),a(this.app),h!=null&&h.autoDensity&&window.matchMedia&&(h==null?void 0:h.resolution)===void 0&&(this._mediaQuery=window.matchMedia("(-webkit-min-device-pixel-ratio: 1.3), (min-resolution: 120dpi)"),this._mediaQuery.addListener(this.updateSize)),p&&!d&&(this._ticker=new me,this._ticker.autoStart=!0,this._ticker.add(this.renderStage),this.app.stage.on("__REACT_PIXI_REQUEST_RENDER__",this.needsRenderUpdate)),this.updateSize(),this.renderStage()}},{key:"componentDidUpdate",value:function(s,a,o){var c,h=this.props,d=h.width,p=h.height,f=h.raf,m=h.renderOnComponentChange,g=h.options;(g==null?void 0:g.resolution)!==void 0&&(s==null?void 0:s.options.resolution)!==(g==null?void 0:g.resolution)&&(this.app.renderer.resolution=g.resolution,this.resetInteractionManager()),s.height===p&&s.width===d&&((c=s.options)===null||c===void 0?void 0:c.resolution)===(g==null?void 0:g.resolution)||this.updateSize(),s.raf!==f&&this.app.ticker[f?"start":"stop"](),Dr.updateContainer(this.getChildren(),this.mountNode,this),s.width===d&&s.height===p&&s.raf===f&&s.renderOnComponentChange===m&&s.options===g||(this._needsUpdate=!0,this.renderStage())}},{key:"resetInteractionManager",value:function(){var s=this.app.renderer.plugins.interaction;s!=null&&s.resolution&&(s.resolution=this.app.renderer.resolution)}},{key:"getChildren",value:function(){var s=this.props.children;return dt.createElement(bg,{value:this.app},s)}},{key:"componentDidCatch",value:function(s,a){console.error("Error occurred in `Stage`."),console.error(s),console.error(a)}},{key:"componentWillUnmount",value:function(){this.props.onUnmount(this.app),this._ticker&&(this._ticker.remove(this.renderStage),this._ticker.destroy()),this.app.stage.off("__REACT_PIXI_REQUEST_RENDER__",this.needsRenderUpdate),Dr.updateContainer(null,this.mountNode,this),this._mediaQuery&&(this._mediaQuery.removeListener(this.updateSize),this._mediaQuery=null),this.app.destroy()}},{key:"render",value:function(){var s,a,o=this,c=this.props.options;return c&&c.view?(_e(c.view instanceof HTMLCanvasElement,"options.view needs to be a `HTMLCanvasElement`"),null):dt.createElement("canvas",ca({},(s=this.props,a=[].concat(Tn(Object.keys(Tg)),Tn(Object.keys(Jc))),Object.keys(s).filter(function(h){return!a.includes(h)}).reduce(function(h,d){return Zo(Zo({},h),{},xe({},d,s[d]))},{})),{ref:function(h){return o._canvas=h}}))}}])&&bT(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),i}();ih.propTypes=Tg,ih.defaultProps=TT;var ET=ih;function Eg(){var e=dt.useContext(Ko);return _e(e instanceof la,"No Context found with `%s`. Make sure to wrap component with `%s`","PIXI.Application","AppProvider"),e}function AT(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=Eg();_e(typeof e=="function","`useTick` needs a callback function."),_e(r instanceof la,"No Context found with `%s`. Make sure to wrap component with `%s`","PIXI.Application","AppProvider");var n=dt.useRef(null);dt.useEffect(function(){n.current=e},[e]),dt.useEffect(function(){if(t){var i=function(s){return n.current.apply(r.ticker,[s,r.ticker])};return r.ticker.add(i),function(){r.ticker&&r.ticker.remove(i)}}},[t])}function CT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sh(e,t,r){return sh=CT()?Reflect.construct.bind():function(n,i,s){var a=[null];a.push.apply(a,i);var o=new(Function.bind.apply(n,a));return s&&Xo(o,s.prototype),o},sh.apply(null,arguments)}var OT=["children","apply"];function Ag(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ag(Object(r),!0).forEach(function(n){xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ag(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var PT=function(e,t){_e(ar(t)==="object","Second argument needs to be an indexed object with { prop: Filter }");var r=Object.keys(t),n=function(i){var s=i.children,a=i.apply,o=zn(i,OT),c=dt.useRef(dt.useMemo(function(){return r.map(function(p){var f,m=(o==null||(f=o[p])===null||f===void 0?void 0:f.construct)||[];return sh(t[p],Tn(m))})},[r])),h=dt.useMemo(function(){return r.reduce(function(p,f,m){return Qo(Qo({},p),{},xe({},f,c.current[m]))},{})},[r]),d=dt.useMemo(function(){return Object.keys(o).filter(rg(eg(r))).reduce(function(p,f){return Qo(Qo({},p),{},xe({},f,o[f]))},{})},[o,r]);return r.forEach(function(p,f){return Object.assign(c.current[f],o[p])}),a&&function(){for(var p=arguments.length,f=new Array(p),m=0;m<p;m++)f[m]=arguments[m];return f.every(function(g){return typeof g=="function"})}(a)&&a.call(e,h),dt.createElement(e,ca({},d,{filters:c.current}),s)};return n.displayName="FilterWrapper",n.propTypes={children:oe.node,apply:oe.func},n},IT=tr.BitmapText,kT=tr.Container,RT=tr.Graphics,NT=tr.NineSlicePlane,MT=tr.ParticleContainer,LT=tr.Sprite,BT=tr.AnimatedSprite,FT=tr.Text,DT=tr.TilingSprite,UT=tr.SimpleMesh,jT=tr.SimpleRope;const $T=id(Object.freeze(Object.defineProperty({__proto__:null,AnimatedSprite:BT,AppConsumer:xg,AppContext:Ko,AppProvider:bg,BitmapText:IT,Container:kT,Graphics:RT,NineSlicePlane:NT,ParticleContainer:MT,PixiComponent:uT,PixiFiber:Dr,SimpleMesh:UT,SimpleRope:jT,Sprite:LT,Stage:ET,TYPES:tr,Text:FT,TilingSprite:DT,applyDefaultProps:rn,createRoot:_g,eventHandlers:qo,render:yT,unmountComponentAtNode:vT,useApp:Eg,useTick:AT,withFilters:PT,withPixiApp:wT},Symbol.toStringTag,{value:"Module"})));od.exports=$T;var qt=od.exports,zT=`attribute vec2 aVertexPosition;
497
+ `))}}let Up=0;const ti={textureCount:0,uboCount:0};class Dl{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Up++}systemCheck(){if(!lp())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,r){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const n=t.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(ti.textureCount=0,ti.uboCount=0,this.syncUniformGroup(t.uniformGroup,ti)),i}setUniforms(t){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,t,this.renderer)}syncUniformGroup(t,r){const n=this.getGlProgram();(!t.static||t.dirtyId!==n.uniformDirtyGroups[t.id])&&(n.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,n,r))}syncUniforms(t,r,n){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(r.uniformData,t.uniforms,this.renderer,n)}createSyncGroups(t){const r=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=np(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[r],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,r){const n=this.getGlProgram();if(!t.static||t.dirtyId!==0||!n.uniformGroups[t.id]){t.dirtyId=0;const i=n.uniformGroups[t.id]||this.createSyncBufferGroup(t,n,r);t.buffer.update(),i(n.uniformData,t.uniforms,this.renderer,ti,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(t,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=Dp(t,this.shader.program.uniformData)),t.autoManage){const l=new Float32Array(o.size/4);t.buffer.update(l)}return r.uniformGroups[t.id]=o.syncFunc,r.uniformGroups[t.id]}getSignature(t,r,n){const i=t.uniforms,s=[`${n}-`];for(const a in i)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const r=this.gl,n=t.program,i=Pp(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Dl.extension={type:pt.RendererSystem,name:"shader"},wt.add(Dl);class ei{constructor(t){this.renderer=t}run(t){const{renderer:r}=this;r.runners.init.emit(r.options),t.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}ei.defaultOptions={hello:!1},ei.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"startup"},wt.add(ei);function jp(e,t=[]){return t[ut.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.ADD]=[e.ONE,e.ONE],t[ut.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.NONE]=[0,0],t[ut.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[ut.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[ut.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[ut.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ut.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[ut.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[ut.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[ut.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[ut.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ut.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const Gp=0,$p=1,qp=2,Hp=3,zp=4,Vp=5,Hs=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ut.NONE,this._blendEq=!1,this.map=[],this.map[Gp]=this.setBlend,this.map[$p]=this.setOffset,this.map[qp]=this.setCullFace,this.map[Hp]=this.setDepthTest,this.map[zp]=this.setFrontFace,this.map[Vp]=this.setDepthMask,this.checks=[],this.defaultState=new Un,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=jp(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,r=0;for(;t;)t&1&&this.map[r].call(this,!!(e.data&1<<r)),t=t>>1,r++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e=e||this.defaultState;for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(e){this.updateCheck(Hs.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Hs.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;const t=this.blendModes[e],r=this.gl;t.length===2?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,t){const r=this.checks.indexOf(e);t&&r===-1?this.checks.push(e):!t&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null}};let Ul=Hs;Ul.extension={type:pt.RendererSystem,name:"state"},wt.add(Ul);class Xp extends _n{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const r=(t.priority??[]).filter(i=>t.systems[i]),n=[...r,...Object.keys(t.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(t.systems[i],i)}addRunners(...t){t.forEach(r=>{this.runners[r]=new se(r)})}addSystem(t,r){const n=new t(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(t,r){const n=Object.keys(this._systemsHash);t.items.forEach(i=>{const s=n.find(a=>this._systemsHash[a]===i);i[t.name](r[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const ri=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=ri.defaultMaxIdle,this.checkCountMax=ri.defaultCheckCountMax,this.mode=ri.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==ji.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let r=!1;for(let n=0;n<t.length;n++){const i=t[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){let n=0;for(let i=0;i<t.length;i++)t[i]!==null&&(t[n++]=t[i]);t.length=n}}unload(e){const t=this.renderer.texture,r=e._texture;r&&!r.framebuffer&&t.destroyTexture(r);for(let n=e.children.length-1;n>=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};let ue=ri;ue.defaultMode=ji.AUTO,ue.defaultMaxIdle=60*60,ue.defaultCheckCountMax=60*10,ue.extension={type:pt.RendererSystem,name:"textureGC"},wt.add(ue);class zs{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=mt.UNSIGNED_BYTE,this.internalFormat=rt.RGBA,this.samplerType=0}}function Wp(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[mt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA8,[rt.RGB]:e.RGB8,[rt.RG]:e.RG8,[rt.RED]:e.R8,[rt.RGBA_INTEGER]:e.RGBA8UI,[rt.RGB_INTEGER]:e.RGB8UI,[rt.RG_INTEGER]:e.RG8UI,[rt.RED_INTEGER]:e.R8UI,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[mt.BYTE]:{[rt.RGBA]:e.RGBA8_SNORM,[rt.RGB]:e.RGB8_SNORM,[rt.RG]:e.RG8_SNORM,[rt.RED]:e.R8_SNORM,[rt.RGBA_INTEGER]:e.RGBA8I,[rt.RGB_INTEGER]:e.RGB8I,[rt.RG_INTEGER]:e.RG8I,[rt.RED_INTEGER]:e.R8I},[mt.UNSIGNED_SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16UI,[rt.RGB_INTEGER]:e.RGB16UI,[rt.RG_INTEGER]:e.RG16UI,[rt.RED_INTEGER]:e.R16UI,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[mt.SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16I,[rt.RGB_INTEGER]:e.RGB16I,[rt.RG_INTEGER]:e.RG16I,[rt.RED_INTEGER]:e.R16I},[mt.UNSIGNED_INT]:{[rt.RGBA_INTEGER]:e.RGBA32UI,[rt.RGB_INTEGER]:e.RGB32UI,[rt.RG_INTEGER]:e.RG32UI,[rt.RED_INTEGER]:e.R32UI,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[mt.INT]:{[rt.RGBA_INTEGER]:e.RGBA32I,[rt.RGB_INTEGER]:e.RGB32I,[rt.RG_INTEGER]:e.RG32I,[rt.RED_INTEGER]:e.R32I},[mt.FLOAT]:{[rt.RGBA]:e.RGBA32F,[rt.RGB]:e.RGB32F,[rt.RG]:e.RG32F,[rt.RED]:e.R32F,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[mt.HALF_FLOAT]:{[rt.RGBA]:e.RGBA16F,[rt.RGB]:e.RGB16F,[rt.RG]:e.RG16F,[rt.RED]:e.R16F},[mt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB565},[mt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA4},[mt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGB5_A1},[mt.UNSIGNED_INT_2_10_10_10_REV]:{[rt.RGBA]:e.RGB10_A2,[rt.RGBA_INTEGER]:e.RGB10_A2UI},[mt.UNSIGNED_INT_10F_11F_11F_REV]:{[rt.RGB]:e.R11F_G11F_B10F},[mt.UNSIGNED_INT_5_9_9_9_REV]:{[rt.RGB]:e.RGB9_E5},[mt.UNSIGNED_INT_24_8]:{[rt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[mt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[rt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[mt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA,[rt.RGB]:e.RGB,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[mt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB},[mt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA},[mt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGBA}},t}class jl{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new gt,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Wp(t);const r=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new zs(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new zs(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(t,r=0){const{gl:n}=this;if(t=t==null?void 0:t.castToBaseTexture(),t!=null&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[r]!==t&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[r]=t}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===t&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(t.target,this.emptyTextures[t.target].texture),n[i]=null)}ensureSamplerType(t){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let s=t-1;s>=0;--s){const a=r[s];a&&a._glTextures[i].samplerType!==Ui.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const r=new zs(this.gl.createTexture());return r.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),r}initTextureType(t,r){var n;r.internalFormat=((n=this.internalFormats[t.type])==null?void 0:n[t.format])??t.format,this.webGLVersion===2&&t.type===mt.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=t.type}updateTexture(t){var i;const r=t._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(t,r),(i=t.resource)!=null&&i.upload(n,t,r))r.samplerType!==Ui.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,a=t.realHeight,o=n.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(t.target,0,r.internalFormat,s,a,0,t.format,r.type,null))}t.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(t),r.dirtyId=t.dirtyId}destroyTexture(t,r){const{gl:n}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),n.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(t);i!==-1&&Bn(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===qe.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=$r.CLAMP:r.wrapMode=t.wrapMode,(n=t.resource)!=null&&n.style(this.renderer,t,r)||this.setStyle(t,r),r.dirtyStyleId=t.dirtyStyleId)}setStyle(t,r){const n=this.gl;if(r.mipmap&&t.mipmap!==qe.ON_MANUAL&&n.generateMipmap(t.target),n.texParameteri(t.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(t.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===we.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===we.LINEAR){const s=Math.min(t.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===we.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===we.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}jl.extension={type:pt.RendererSystem,name:"texture"},wt.add(jl);class Gl{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glTransformFeedbacks[n]||this.createGLTransformFeedback(t);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:r,renderer:n,CONTEXT_UID:i}=this,s=r.createTransformFeedback();t._glTransformFeedbacks[i]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];o&&(n.buffer.update(o),o._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,r){const n=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];if(!o)continue;const l=o._glBuffers[this.CONTEXT_UID];l&&(l.refCount--,l.refCount===0&&!r&&s.dispose(o,r))}n&&(r||i.deleteTransformFeedback(n),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Gl.extension={type:pt.RendererSystem,name:"transformFeedback"},wt.add(Gl);class ni{constructor(t){this.renderer=t}init(t){this.screen=new At(0,0,t.width,t.height),this.element=t.view||vt.ADAPTER.createCanvas(),this.resolution=t.resolution||vt.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,r){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){var r;t&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}ni.defaultOptions={width:800,height:600,resolution:vt.RESOLUTION,autoDensity:!1},ni.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"_view"},wt.add(ni),vt.PREFER_ENV=$e.WEBGL2,vt.STRICT_TEXTURE_CACHE=!1,vt.RENDER_OPTIONS={...Yn.defaultOptions,...Wn.defaultOptions,...ni.defaultOptions,...ei.defaultOptions},Object.defineProperties(vt,{WRAP_MODE:{get(){return gt.defaultOptions.wrapMode},set(e){xt("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),gt.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return gt.defaultOptions.scaleMode},set(e){xt("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),gt.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return gt.defaultOptions.mipmap},set(e){xt("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),gt.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return gt.defaultOptions.anisotropicLevel},set(e){xt("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),gt.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return xt("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Oe.defaultResolution},set(e){Oe.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return xt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Oe.defaultMultisample},set(e){Oe.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return le.defaultMaxTextures},set(e){xt("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),le.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return le.defaultBatchSize},set(e){xt("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),le.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return le.canUploadSameBuffer},set(e){xt("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),le.canUploadSameBuffer=e}},GC_MODE:{get(){return ue.defaultMode},set(e){xt("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),ue.defaultMode=e}},GC_MAX_IDLE:{get(){return ue.defaultMaxIdle},set(e){xt("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),ue.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return ue.defaultCheckCountMax},set(e){xt("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),ue.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return Se.defaultVertexPrecision},set(e){xt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Se.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Se.defaultFragmentPrecision},set(e){xt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Se.defaultFragmentPrecision=e}}});var an=(e=>(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(an||{});class Vs{constructor(t,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=r,this.priority=n,this.once=i}match(t,r=null){return this.fn===t&&this.context===r}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=t?null:r,this.previous=null,r}}const Kt=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Vs(null,null,1/0),this.deltaMS=1/Kt.targetFPMS,this.elapsedMS=1/Kt.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,r=an.NORMAL){return this._addListener(new Vs(e,t,r))}addOnce(e,t,r=an.NORMAL){return this._addListener(new Vs(e,t,r,!0))}_addListener(e){let t=this._head.next,r=this._head;if(!t)e.connect(r);else{for(;t;){if(e.priority>t.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}return this._startIfPossible(),this}remove(e,t){let r=this._head.next;for(;r;)r.match(e,t)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*Kt.targetFPMS;const r=this._head;let n=r.next;for(;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,t)/1e3,Kt.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!Kt._shared){const e=Kt._shared=new Kt;e.autoStart=!0,e._protected=!0}return Kt._shared}static get system(){if(!Kt._system){const e=Kt._system=new Kt;e.autoStart=!0,e._protected=!0}return Kt._system}};let Zt=Kt;Zt.targetFPMS=.06,Object.defineProperties(vt,{TARGET_FPMS:{get(){return Zt.targetFPMS},set(e){xt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Zt.targetFPMS=e}}});class $l{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,an.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Zt.shared:new Zt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}$l.extension=pt.Application,wt.add($l);const Yp=[];wt.handleByList(pt.Renderer,Yp);class ql{constructor(t){this.renderer=t}contextChange(t){let r;if(this.renderer.context.webGLVersion===1){const n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else{const n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n)}r>=Dt.HIGH?this.multisample=Dt.HIGH:r>=Dt.MEDIUM?this.multisample=Dt.MEDIUM:r>=Dt.LOW?this.multisample=Dt.LOW:this.multisample=Dt.NONE}destroy(){}}ql.extension={type:pt.RendererSystem,name:"_multisample"},wt.add(ql);class Kp{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Hl{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);r.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:r}=this;r.bindBuffer(t,null)}bindBufferBase(t,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[r]=t,n.bindBufferBase(n.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(t,r,n){const{gl:i,CONTEXT_UID:s}=this;n=n||0;const a=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,a.buffer,n*256,256)}update(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);if(t._updateID!==i.updateID)if(i.updateID=t._updateID,r.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)r.bufferSubData(t.type,0,t.data);else{const s=t.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,r.bufferData(t.type,t.data,s)}}dispose(t,r){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const n=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],t)}createGLBuffer(t){const{CONTEXT_UID:r,gl:n}=this;return t._glBuffers[r]=new Kp(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}Hl.extension={type:pt.RendererSystem,name:"buffer"},wt.add(Hl);class zl{constructor(t){this.renderer=t}render(t,r){const n=this.renderer;let i,s,a,o;if(r&&(i=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=a,!n.context.isLost){if(i||(this.lastObjectRendered=t),!o){const l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(s??n.background.clearBeforeRender)&&n.renderTexture.clear(),t.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}zl.extension={type:pt.RendererSystem,name:"objectRenderer"},wt.add(zl);const Xs=class extends Xp{constructor(e){super(),this.type=Da.WEBGL,e=Object.assign({},vt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new ae({projectionMatrix:new Ot},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Xs.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(xt("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=Xs.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:Ad()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return xt("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return xt("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return xt("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return xt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){xt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return xt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){xt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return xt("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};let Sr=Xs;Sr.extension={type:pt.Renderer,priority:1},Sr.__plugins={},Sr.__systems={},wt.handleByMap(pt.RendererPlugin,Sr.__plugins),wt.handleByMap(pt.RendererSystem,Sr.__systems),wt.add(Sr);class Vl extends Jr{constructor(t,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let s=0;s<t;s++){const a=new gt;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,r){for(let n=0;n<this.length;n++)t[n]&&(t[n].castToBaseTexture?this.addBaseTextureAt(t[n].castToBaseTexture(),n):t[n]instanceof Jr?this.addResourceAt(t[n],n):this.addResourceAt(rl(t[n],r),n))}dispose(){for(let t=0,r=this.length;t<r;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[r].setResource(t),this}bind(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=t,this.items[r].on("update",t.update,t)}unbind(t){super.unbind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",t.update,t)}load(){if(this._load)return this._load;const r=this.items.map(n=>n.resource).filter(n=>n).map(n=>n.load());return this._load=Promise.all(r).then(()=>{const{realWidth:n,realHeight:i}=this.items[0];return this.resize(n,i),Promise.resolve(this)}),this._load}}class Zp extends Vl{constructor(t,r){const{width:n,height:i}=r||{};let s,a;Array.isArray(t)?(s=t,a=t.length):a=t,super(a,{width:n,height:i}),s&&this.initFromArray(s,r)}addBaseTextureAt(t,r){if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=lr.TEXTURE_2D_ARRAY}upload(t,r,n){const{length:i,itemDirtyIds:s,items:a}=this,{gl:o}=t;n.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,i,0,r.format,n.type,null);for(let l=0;l<i;l++){const h=a[l];s[l]<h.dirtyId&&(s[l]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,l,h.resource.width,h.resource.height,1,r.format,n.type,h.resource.source))}return!0}}class Qp extends Ue{constructor(t){super(t)}static test(t){const{OffscreenCanvas:r}=globalThis;return r&&t instanceof r?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const on=class extends Vl{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==on.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let a=0;a<on.SIDES;a++)this.items[a].target=lr.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,e&&this.initFromArray(e,t),i!==!1&&this.load()}bind(e){super.bind(e),e.target=lr.TEXTURE_CUBE_MAP}addBaseTextureAt(e,t,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[t])throw new Error(`Index ${t} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=lr.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,r){const n=this.itemDirtyIds;for(let i=0;i<on.SIDES;i++){const s=this.items[i];(n[i]<s.dirtyId||r.dirtyId<t.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(e,s,r),n[i]=s.dirtyId):n[i]<-1&&(e.gl.texImage2D(s.target,0,r.internalFormat,t.realWidth,t.realHeight,0,t.format,r.type,null),n[i]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===on.SIDES}};let Xl=on;Xl.SIDES=6;class Or extends Ue{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=Or.EMPTY,i=t):(n=t,i=null),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(t,r)=>{if(this.url===null){t(this);return}try{const n=await vt.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const s=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Me.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),t(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}}),this._load)}upload(t,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(t,r,n)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return Or._EMPTY=Or._EMPTY??vt.ADAPTER.createCanvas(0,0),Or._EMPTY}}const ii=class extends Ue{constructor(e,t){t=t||{},super(vt.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),e(this)},ii.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Ue.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,i=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,i=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),i=Math.round(i);const s=this.source;s.width=n,s.height=i,s._pixiId=`canvas_${Qr()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=ii.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&ii.SVG_XML.test(e)}};let Ws=ii;Ws.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Ws.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Ys=class extends Ue{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Ue.crossOrigin(r,n,t.crossorigin);for(let i=0;i<e.length;++i){const s=document.createElement("source");let{src:a,mime:o}=e[i];a=a||e[i];const l=a.split("?").shift().toLowerCase(),h=l.slice(l.lastIndexOf(".")+1);o=o||Ys.MIME_TYPES[h]||`video/${h}`,s.src=a,s.type=o,r.appendChild(s)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){const t=Zt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(t=>{this.valid?t(this):(this._resolve=t,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Zt.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(Zt.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._isConnectedToTicker&&(Zt.shared.remove(this.update,this),this._isConnectedToTicker=!1);const e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Zt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Zt.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e)}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Ys.TYPES.includes(t)}};let Ks=Ys;Ks.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ks.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},Ps.push(Or,bl,Qp,Ks,Ws,Ms,Xl,Zp);var Jp=`attribute vec2 aVertexPosition;
802
498
  attribute vec2 aTextureCoord;
803
499
 
804
500
  uniform mat3 projectionMatrix;
@@ -809,7 +505,7 @@ void main(void)
809
505
  {
810
506
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
811
507
  vTextureCoord = aTextureCoord;
812
- }`,HT=`varying vec2 vTextureCoord;
508
+ }`,ty=`varying vec2 vTextureCoord;
813
509
  uniform sampler2D uSampler;
814
510
 
815
511
  uniform float gamma;
@@ -840,7 +536,7 @@ void main(void)
840
536
 
841
537
  gl_FragColor = c * alpha;
842
538
  }
843
- `;class ah extends wn{constructor(t){super(zT,HT),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,t)}apply(t,r,n,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,r,n,i)}}var xi=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(xi||{});class Jo{constructor(t=0,r=0,n=0,i=0){this._x=Number(t),this._y=Number(r),this._width=Number(n),this._height=Number(i),this._hull=[new xt,new xt,new xt,new xt],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(t){this._x=t,this.dirtyID++}get y(){return this._y}set y(t){this._y=t,this.dirtyID++}get width(){return this._width}set width(t){this._width=t,this.dirtyID++}get height(){return this._height}set height(t){this._height=t,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[t,r,n,i]=this._hull;t.set(this._x,this._y),r.set(this._x+this._width,this._y),n.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new Jo(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}equals(t){return t?t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height:!1}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}}const Cg=new xt;class tl{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof Jo&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new Jo(t,r,n,i),this._rotation=s,this._center=new Jr(this.updateCenter,this),this._hull=[new xt,new xt,new xt,new xt],this._matrix=new ee,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(t){this.center.copyFrom(t)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(t){return t?this.innerBounds.equals(t.innerBounds)&&this.rotation===t.rotation:!1}contains(t,r){typeof t=="number"&&(t=Cg.set(t,r));const n=this._matrix.applyInverse(t,Cg);return this.innerBounds.contains(n.x,n.y)}copyFrom(t){return this.innerBounds.copyFrom(t.innerBounds),this.rotation=t.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const t=this.innerBounds,r=this._rotation,n=this._center,[i,s,a,o]=this._hull,c=this._matrix;n._x=t.x+t.width/2,n._y=t.y+t.height/2,c.identity().translate(-n.x,-n.y).rotate(r).translate(n.x,n.y),c.apply(t.topLeft,i),c.apply(t.topRight,s),c.apply(t.bottomRight,a),c.apply(t.bottomLeft,o),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const t=this.center,r=this.innerBounds;r.x=t.x-r.width/2,r.y=t.y-r.height/2}}class Og{constructor(t,r){this._history=new Array(t),this._decayRatio=r,this._currentIndex=0;for(let n=0;n<t;n++)this._history[n]=0}next(t){const{_history:r,_decayRatio:n}=this,i=r.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,r[this._currentIndex]=t;let s=0,a=0;for(let o=this._currentIndex+1;o<i;o++)s=(s+r[o])*n,a=(a+1)*n;for(let o=0;o<=this._currentIndex;o++)s=(s+r[o])*n,a=(a+1)*n;return this._average=s/a,this._average}absDev(){let t=0;for(let r=0,n=this._history.length;r<n;r++)t+=Math.abs(this._history[r]-this._average);return t/this._history.length}}class el{constructor(t={}){el.prototype.__init.call(this),this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=t.reserve||0,this._capacityRatio=t.capacityRatio||1.2,this._decayRatio=t.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new Og(128,this._decayRatio),this._marginAverageProvider=new Og(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(t){this._freeList.length=Math.ceil(t)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(t){let r,n;Array.isArray(t)?(r=t,n=t.length):(n=t,r=new Array(n)),this._borrowRate+=n,this._flowRate+=n;let i=0;if(this._freeCount>0){const s=this._freeList,a=Math.min(this._freeCount,n);let o=this._freeCount;for(let c=0;c<a;c++)r[i]=s[o-1],++i,--o;this._freeCount=o}for(;i<n;)r[i]=this.create(),++i;return r}release(t){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=t,++this._freeCount}releaseArray(t){this._returnRate+=t.length,this._flowRate-=t.length,this._freeCount+t.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+t.length));for(let r=0,n=t.length;r<n;r++)this._freeList[this._freeCount]=t[r],++this._freeCount}reserve(t){if(this._reserveCount=t,this._freeCount<t){const r=this._freeCount-t;for(let n=0;n<r;n++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(t){if(this._freeCount>t){this.capacity>t*this._capacityRatio&&(this.capacity=t*this._capacityRatio);const n=Math.min(this._freeCount,this.capacity);for(let i=t;i<n;i++)this._freeList[i]=null}}startGC(t=me.shared){t.add(this._gcTick,null,Qi.UTILITY)}stopGC(t=me.shared){t.remove(this._gcTick)}__init(){this._gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const t=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const r=this._freeCount,n=this._freeList.length;if(r<128&&this._borrowRateAverage<128&&n<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+t){const s=i+t;this.capacity=Math.min(this._freeList.length,Math.ceil(s)),this._freeCount=this._freeList.length}}}}var oh;const Pg=new Map;class Ig{static build(t){let r=Pg.get(t);return r||(r=new class extends el{create(){return new t}},Pg.set(t,r),r)}static buildFunctional(t){return new(oh=class extends el{constructor(...n){super(...n),oh.prototype.__init.call(this)}__init(){this.create=t}},oh)}}const kg={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},GT=mr;class qT extends GT{constructor(t,r,n={},i,s,a){super(),this.transformer=t;const o=Object.assign({},kg,n);this._handle=r,this._style=o,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=a||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new xt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp}get handle(){return this._handle}set handle(t){this._handle=t,this._dirty=!0}get style(){return this._style}set style(t){this._style=Object.assign({},kg,t),this._dirty=!0}render(t){this._dirty&&(this.draw(),this._dirty=!1),super.render(t)}draw(){const t=this._handle,r=this._style,n=r.radius;if(this.clear().lineStyle(r.outlineThickness,r.outlineColor).beginFill(r.color),r.shape==="square")this.drawRect(-n/2,-n/2,n,n);else if(r.shape==="tooth")switch(t){case"middleLeft":this.drawPolygon([-n/2,-n/2,-n/2,n/2,n/2,n/2,n*1.1,0,n/2,-n/2]);break;case"topCenter":this.drawPolygon([-n/2,-n/2,n/2,-n/2,n/2,n/2,0,n*1.1,-n/2,n/2]);break;case"middleRight":this.drawPolygon([-n/2,n/2,-n*1.1,0,-n/2,-n/2,n/2,-n/2,n/2,n/2]);break;case"bottomCenter":this.drawPolygon([0,-n*1.1,n/2,-n/2,n/2,n/2,-n/2,n/2,-n/2,-n/2]);break;case"rotator":this.drawCircle(0,0,n/Math.sqrt(2));break;default:this.drawRect(-n/2,-n/2,n,n);break}else this.drawCircle(0,0,n);this.endFill()}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){this._pointerDown&&(this._pointerDragging?this.onDrag(t):this.onDragStart(t),t.stopPropagation())}onPointerUp(t){this._pointerDragging&&this.onDragEnd(t),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(t){this._pointerPosition.copyFrom(t.data.global),this._pointerDragging=!0}onDrag(t){const r=t.data.global;this.onHandleDelta&&this.onHandleDelta(r),this._pointerPosition.copyFrom(r)}onDragEnd(t){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function rl(e,t,r,n){const{x:i,y:s}=r,{x:a,y:o}=n;if(Math.abs(a-i)<.01)return Math.abs(e-i);if(Math.abs(o-s)<.01)return Math.abs(t-s);const c=(o-s)/(a-i);return Math.abs((c*e-t+(o-c*a))/Math.sqrt(c*c+1))}const Rg=Ig.build(xt),VT=[new xt,new xt,new xt,new xt],WT=new ee,as=new xt,XT=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],YT=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],KT=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],ZT=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],lh=new Array(12),QT=[XT,YT,KT,ZT],JT=mr;class tE extends JT{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new mr),this.addChild(new mr),this.addChild(new mr),this.addChild(new mr)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=ha.topCenter,this.boxScalingHandles[1].cursor=ha.middleRight,this.boxScalingHandles[2].cursor=ha.bottomCenter,this.boxScalingHandles[3].cursor=ha.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:a,boxScalingTolerance:o}=this.transformer,[c,h,d,p]=t.hull,{x:f,y:m}=r.applyInverse(n,as);if(a){const g=rl(f,m,c,h)*r.d,v=rl(f,m,c,p)*r.a,b=rl(f,m,h,d)*r.a,_=rl(f,m,p,d)*r.d,w=Math.min(g,v,b,_);if(w<o)switch(w){case g:return"topCenter";case v:return"middleLeft";case b:return"middleRight";case _:return"bottomCenter"}}if(i&&!t.contains(f,m)){const g=Math.sqrt((c.x-f)**2+(c.y-m)**2),v=Math.sqrt((h.x-f)**2+(h.y-m)**2),b=Math.sqrt((p.x-f)**2+(p.y-m)**2),_=Math.sqrt((d.x-f)**2+(d.y-m)**2),w=Math.min(g,v,b,_);if(w<s*1.45)switch(w){case g:return"boxRotateTopLeft";case v:return"boxRotateTopRight";case b:return"boxRotateBottomLeft";case _:return"boxRotateBottomRight"}}return null}drawBounds(t){const r=VT;for(let n=0;n<4;n++)this.transformer.projectToLocal(t.hull[n],r[n]);this.drawPolygon(r)}drawBoxScalingTolerance(t,r=this.transformer.boxScalingTolerance){t.innerBounds.pad(-r);const n=Rg.allocateArray(4);n.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(2.5*r);const i=Rg.allocateArray(4);i.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const a=n[s],o=n[(s+1)%4],c=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(a,c,h,o).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,a=WT.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let o=0;o<4;o++){const c=QT[o];let h;switch(o){case 0:h=t;break;case 1:h=r;break;case 2:h=n;break;case 3:h=i;break}for(let d=0;d<c.length;d+=2){const p=c[d],f=c[d+1];as.set(p,f),a.apply(as,as),lh[d]=as.x+h.x,lh[d+1]=as.y+h.y}this.drawPolygon(lh.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const Ng=new ee;function Mg(e){const t=Ng.identity();return t.c=Math.tan(e),t}function Lg(e){const t=Ng.identity();return t.b=Math.tan(e),t}function Bg(e,t,r,n=e.pivot){const i=t.a,s=t.b,a=t.c,o=t.d,c=-Math.atan2(-a,o),h=Math.atan2(s,i);return r=r??h,e.pivot.set(n.x,n.y),e.rotation=r,e.skew.x=r+c,e.skew.y=-r+h,e.scale.x=Math.sqrt(i*i+s*s),e.scale.y=Math.sqrt(a*a+o*o),e.position.x=t.tx+(n.x*t.a+n.y*t.c),e.position.y=t.ty+(n.x*t.b+n.y*t.d),e}const nl=new ee,eE=new ee;function rE(e,t,r){if(!r){const s=e.parent?e.parent:e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}const n=e.worldTransform,i=e.parent?eE.copyFrom(e.parent.worldTransform):ee.IDENTITY;nl.copyFrom(n),nl.prepend(t),nl.prepend(i.invert()),Bg(e.transform,nl)}const il=new Ws,nE=[new xt,new xt,new xt,new xt],os=new ee,ls=new xt,uh=new tl,iE=new Vt,Fg=[new xt,new xt,new xt,new xt],Dg=new xt,Ug=new ee,sl=Ig.build(xt),ha={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},al=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],jg={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},sE=[...al,"rotator","skewHorizontal","skewVertical"],aE=4,oE=16,lE=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],uE=Math.PI/90,cE=[Math.PI/4,-Math.PI/4],hE=Math.PI/90,$g={color:0,thickness:2},fE=Ke;let dE=class Er extends fE{constructor(t={}){super(),Er.prototype.__init.call(this),Er.prototype.__init2.call(this),Er.prototype.__init3.call(this),Er.prototype.__init4.call(this),Er.prototype.__init5.call(this),this.interactive=!0,this.cursors=Object.assign({default:"move"},t.cursors),this.cursor=this.cursors.default,this.boundingBoxes=t.boundingBoxes||"all",this.group=t.group||[],this.boxRotationTolerance=t.boxRotationTolerance||oE,this.boxScalingTolerance=t.boxScalingTolerance||aE,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new ee,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||lE,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:uE,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||cE,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:hE,this.boxRotationEnabled=t.boxRotationEnabled===!0,this.boxScalingEnabled=t.boxScalingEnabled===!0,this._rotateEnabled=t.rotateEnabled!==!1,this._scaleEnabled=t.scaleEnabled!==!1,this._skewEnabled=t.skewEnabled===!0,this.translateEnabled=t.translateEnabled!==!1,this.transientGroupTilt=t.transientGroupTilt!==void 0?t.transientGroupTilt:!0,this.wireframe=this.addChild(new tE(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},$g,t.wireframeStyle||{});const r=t.handleConstructor||qT,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,o=>{this.rotateGroup("rotator",o)},this.commitGroup))},s=al.reduce((o,c)=>{const h=new r(this,c,n,null,this.commitGroup,ha[c]);return h.onHandleDelta=d=>{this.scaleGroup(h.handle,d)},h.visible=this._scaleEnabled,o[c]=h,this.addChild(o[c]),o},{}),a={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,o=>{this.skewGroup("skewHorizontal",o)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,o=>{this.skewGroup("skewVertical",o)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,a),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new xt,boxRotateTopLeft:new xt,boxRotateTopRight:new xt,boxRotateBottomLeft:new xt,boxRotateBottomRight:new xt,topLeft:new xt,topCenter:new xt,topRight:new xt,middleLeft:new xt,middleCenter:new xt,middleRight:new xt,bottomLeft:new xt,bottomCenter:new xt,bottomRight:new xt,skewHorizontal:new xt,skewVertical:new xt},this.groupBounds=new tl,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new xt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerupoutside",this.onPointerUp)}get enabledHandles(){return this._enabledHandles}set enabledHandles(t){!this._enabledHandles&&!t||(this._enabledHandles=t,sE.forEach(r=>{this.handles[r].visible=!1}),t?t.forEach(r=>{this.handles[r].visible=!0}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,al.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(t){const r=this.handles;for(const n in r)r[n].style=t;this._handleStyle=t}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(t){if(this._rotateEnabled!==t){if(this._rotateEnabled=t,this._enabledHandles)return;this.handles.rotator.visible=t}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(t){if(this._scaleEnabled!==t){if(this._scaleEnabled=t,this._enabledHandles)return;al.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=t)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(t){if(this._skewEnabled!==t){if(this._skewEnabled=t,this._enabledHandles)return;this.handles.skewHorizontal.visible=t,this.handles.skewVertical.visible=t}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(t){this._wireframeStyle=Object.assign({},$g,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=os.identity().translate(t.x,t.y);this.prependTransform(r)}}__init2(){this.rotateGroup=(t,r)=>{this._transformHandle=t,this._transformType="rotate";const n=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[t],ls);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,Dg);const s=n.center,a=Math.atan2(i.y-s.y,i.x-s.x);let c=Math.atan2(r.y-s.y,r.x-s.x)-a,h=this.groupBounds.rotation+c;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),c=h-this.groupBounds.rotation;const d=os.identity().translate(-s.x,-s.y).rotate(c).translate(s.x,s.y);this.prependTransform(d,!0),this.updateGroupBounds(h),this._skewX+=c,this._skewY+=c}}__init3(){this.scaleGroup=(t,r)=>{this._transformHandle=t,this._transformType="scale";const n=jg[t].x,i=jg[t].y,s=this.handles,a=this.groupBounds,o=a.rotation,c=a.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],ls);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,Dg);const d=r.x-h.x,p=r.y-h.y,f=(a.topRight.x-a.topLeft.x)/c.width,m=(a.topRight.y-a.topLeft.y)/c.width,g=(a.bottomLeft.x-a.topLeft.x)/c.height,v=(a.bottomLeft.y-a.topLeft.y)/c.height,b=d*f+p*m,_=d*g+p*v;let w=1+b*n/c.width,S=1+_*i/c.height;this.lockAspectRatio&&(t==="topLeft"||t==="topRight"||t==="bottomLeft"||t==="bottomRight")&&(w>S?S=w:w=S);const A=os.identity();if(n!==0&&w!==0){const N=this.centeredScaling?a.center:n===1?a.topLeft:a.topRight;A.translate(-N.x,-N.y).rotate(-o).scale(w,1).rotate(o).translate(N.x,N.y)}if(i!==0&&S!==0){const N=this.centeredScaling?a.center:i===1?a.topLeft:a.bottomLeft;A.translate(-N.x,-N.y).rotate(-o).scale(1,S).rotate(o).translate(N.x,N.y)}if((S<0||w<0)&&!(S<0&&w<0))switch(t){case"topLeft":case"bottomLeft":this.swapHandles(s.topLeft,s.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(s.topCenter,s.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(s.topRight,s.bottomRight);break}this.prependTransform(A)}}__init4(){this.skewGroup=(t,r)=>{this._transformHandle=t,this._transformType="skew";const n=this.groupBounds,i=ls.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,a=os.identity().translate(-s.x,-s.y);let o=this.groupBounds.rotation;if(t==="skewHorizontal"){const c=this._skewX;this._skewX=Math.atan2(i.y-s.y,i.x-s.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),a.prepend(Lg(-c)),a.prepend(Lg(this._skewX))}else{const c=this._skewY,h=Math.atan2(i.y-s.y,i.x-s.x)-Math.PI/2;this._skewY=h,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),a.prepend(Mg(c)),a.prepend(Mg(-this._skewY)),o-=this._skewY-c}a.translate(s.x,s.y),this.prependTransform(a,!0),this.updateGroupBounds(o)}}__init5(){this.commitGroup=()=>{this._transformHandle=null,this._transformType="none",this.transientGroupTilt!==!1&&this.group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit")}}render(t){this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw(),super.render(t)}draw(){const t=this.group,{color:r,thickness:n}=this._wireframeStyle;this.wireframe.clear(),this.boundingBoxes!=="none"&&this.wireframe.lineStyle(n,r),this.translateEnabled&&this.wireframe.beginFill(16777215,1e-4);for(let s=0,a=t.length;s<a&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(Er.calculateOrientedBounds(t[s],uh));const i=t.length!==1?Er.calculateGroupOrientedBounds(t,this.groupBounds.rotation,uh,!0):Er.calculateOrientedBounds(t[0],uh);this.wireframe.drawBounds(i),this.drawHandles(i),this.groupBounds.copyFrom(i),this.boxRotationEnabled&&(this.wireframe.closePath().beginFill(16777215,1e-4).lineStyle(),this.wireframe.drawBoxRotationTolerance()),this.boxScalingEnabled&&(this.wireframe.closePath().beginFill(16773375,1e-4).lineStyle(),this.wireframe.drawBoxScalingTolerance(i)),this.lazyDirty=!1}drawHandles(t){const r=this.handles,n=this.handleAnchors,{topLeft:i,topRight:s,bottomLeft:a,bottomRight:o,center:c}=t,[h,d,p,f]=Fg,m=ls;if(this.projectToLocal(i,h),this.projectToLocal(s,d),this.projectToLocal(a,p),this.projectToLocal(o,f),this.projectToLocal(c,m),n.topLeft.copyFrom(h),n.topCenter.set((h.x+d.x)/2,(h.y+d.y)/2),n.topRight.copyFrom(d),n.middleLeft.set((h.x+p.x)/2,(h.y+p.y)/2),n.middleCenter.set((h.x+f.x)/2,(h.y+f.y)/2),n.middleRight.set((d.x+f.x)/2,(d.y+f.y)/2),n.bottomLeft.copyFrom(p),n.bottomCenter.set((p.x+f.x)/2,(p.y+f.y)/2),n.bottomRight.copyFrom(f),this.boxRotationEnabled&&(n.boxRotateTopLeft.copyFrom(n.topLeft),n.boxRotateTopRight.copyFrom(n.topRight),n.boxRotateBottomLeft.copyFrom(n.bottomLeft),n.boxRotateBottomRight.copyFrom(n.bottomRight)),this._rotateEnabled){const g=(h.x+d.x)/2,v=(h.y+d.y)/2;let b=-(h.y-d.y),_=h.x-d.x;const w=Math.sqrt(b*b+_*_);b*=32/w,_*=32/w,r.rotator.position.x=g+b,r.rotator.position.y=v+_,this.wireframe.moveTo(g,v).lineTo(r.rotator.position.x,r.rotator.position.y),this.handleAnchors.rotator.copyFrom(r.rotator.position)}if(this._skewEnabled){const g=m.x,v=m.y;this.worldTransform.apply(m,m),n.skewHorizontal.set(m.x+Math.cos(this._skewX)*this.skewRadius,m.y+Math.sin(this._skewX)*this.skewRadius),n.skewVertical.set(m.x+-Math.sin(this._skewY)*this.skewRadius,m.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(n.skewHorizontal,n.skewHorizontal),this.worldTransform.applyInverse(n.skewVertical,n.skewVertical),m.set(g,v),this.wireframe.beginFill(this.wireframeStyle.color).drawCircle(m.x,m.y,this.wireframeStyle.thickness*2).endFill(),this.wireframe.moveTo(m.x,m.y).lineTo(r.skewHorizontal.x,r.skewHorizontal.y).moveTo(m.x,m.y).lineTo(r.skewVertical.x,r.skewVertical.y)}for(const g in r){let v=this.groupBounds.rotation;g==="skewHorizontal"?v=this._skewX:g==="skewVertical"&&(v=this._skewY);const b=r[g];b.rotation=v,b.position.copyFrom(n[g]),b.getBounds(!1,iE)}}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){const r=this._pointerPosition,n=sl.allocate().copyFrom(t.data.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const s=n.x,a=n.y;if(this._pointerDragging)switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,n);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,n);break;default:if(this.translateEnabled){const[o,c,h]=Fg;o.set(0,0),c.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(o,o),this.projectionTransform.applyInverse(c,c),h.set(c.x-o.x,c.y-o.y),this.translateGroup(h)}}else this._transformHandle=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n),this.setCursorFromHoveredHandle(i);this._pointerPosition.x=s,this._pointerPosition.y=a,this._pointerDragging=!0,t.stopPropagation()}sl.release(n)}onPointerUp(t){this._pointerDragging=!1,this._pointerDown=!1,this.commitGroup(),t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}prependTransform(t,r=!1){const n=this.group;for(let i=0,s=n.length;i<s;i++)rE(n[i],t,!1);Ug.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",Ug)}updateGroupBounds(t=this.groupBounds.rotation){Er.calculateGroupOrientedBounds(this.group,t,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(t,r,n){if(t=t%(Math.PI*2),!n||n.length===1||!r)return t;for(let i=0,s=n.length;i<s;i++)if(Math.abs(t-n[i])<=r)return n[i];return t}swapHandles(t,r){const n=t.handle,i=r.handle,s=t.cursor,a=r.cursor,o=t.x,c=r.x,h=t.y,d=r.y;t.handle=i,r.handle=n,t.position.set(c,d),r.position.set(o,h),t.cursor=a,r.cursor=s,this.handles[n]=r,this.handles[i]=t,this._transformHandle===n?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=n)}setCursorFromHoveredHandle(t){if(t&&t.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(t)switch(t){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(t,r){return r||(r=new xt),this.projectionTransform.apply(t,r),this.worldTransform.applyInverse(r,r),r}static calculateTransformedCorners(t,r=t.worldTransform,n,i=0){const s=t.getLocalBounds();return t.getBounds(),n=n||[new xt,new xt,new xt,new xt],n[i].set(s.x,s.y),n[i+1].set(s.x+s.width,s.y),n[i+2].set(s.x+s.width,s.y+s.height),n[i+3].set(s.x,s.y+s.height),r.apply(n[i],n[i]),r.apply(n[i+1],n[i+1]),r.apply(n[i+2],n[i+2]),r.apply(n[i+3],n[i+3]),n}static calculateOrientedBounds(t,r){const n=t.parent?t.parent:t.enableTempParent();t.updateTransform(),t.disableTempParent(n),Bg(il,t.worldTransform),il.updateLocalTransform();const i=il.rotation,s=Er.calculateTransformedCorners(t,t.worldTransform,nE),a=(s[0].x+s[1].x+s[2].x+s[3].x)/4,o=(s[0].y+s[1].y+s[2].y+s[3].y)/4,c=os.identity().translate(-a,-o).rotate(-il.rotation).translate(a,o);return c.apply(s[0],s[0]),c.apply(s[1],s[1]),c.apply(s[2],s[2]),c.apply(s[3],s[3]),r=r||new tl,r.rotation=i,r.innerBounds.x=Math.min(s[0].x,s[1].x,s[2].x,s[3].x),r.innerBounds.y=Math.min(s[0].y,s[1].y,s[2].y,s[3].y),r.innerBounds.width=Math.max(s[0].x,s[1].x,s[2].x,s[3].x)-r.innerBounds.x,r.innerBounds.height=Math.max(s[0].y,s[1].y,s[2].y,s[3].y)-r.innerBounds.y,r}static calculateGroupOrientedBounds(t,r,n,i=!1){const s=t.length,a=sl.allocateArray(s*4);for(let f=0;f<s;f++){const m=t[f];if(!i){const g=m.parent?m.parent:m.enableTempParent();m.updateTransform(),m.disableTempParent(g)}Er.calculateTransformedCorners(m,m.worldTransform,a,f*4)}const o=os.identity().rotate(-r);let c=Number.MAX_VALUE,h=Number.MAX_VALUE,d=-Number.MAX_VALUE,p=-Number.MAX_VALUE;for(let f=0,m=a.length;f<m;f++){const g=a[f];o.apply(g,g);const v=g.x,b=g.y;c=v<c?v:c,h=b<h?b:h,d=v>d?v:d,p=b>p?b:p}return sl.releaseArray(a),n=n||new tl,n.innerBounds.x=c,n.innerBounds.y=h,n.innerBounds.width=d-c,n.innerBounds.height=p-h,n.rotation=r,o.applyInverse(n.center,ls),n.center.copyFrom(ls),n}};function pE(e,t,r,n){for(const i in t){const s=r[i],a=n[i],o=t[i];s!==a&&(s&&e.off(o,s),a&&e.on(o,a))}}const ol={},mE=ee.IDENTITY,gE={transformchange:"transformchange",transformcommit:"transformcommit"},yE=qt.PixiComponent("Transformer",{create:e=>new dE(e),applyProps(e,t,r){if(qt.applyDefaultProps(e,t,r),pE(e,gE,t,r),r.cursors&&Object.assign(e.cursors,r.cursors),e.group=r.group||[],e.boundingBoxes=r.boundingBoxes||"all",e.boxScalingEnabled=r.boxScalingEnabled===!0,e.boxScalingTolerance=r.boxScalingTolerance!==void 0?r.boxScalingTolerance:e.boxScalingTolerance,e.boxRotationEnabled=r.boxRotationEnabled===!0,e.boxRotationTolerance=r.boxRotationTolerance!==void 0?r.boxRotationTolerance:e.boxRotationTolerance,e.centeredScaling=r.centeredScaling,e.enabledHandles=r.enabledHandles,e.lockAspectRatio=r.lockAspectRatio,e.projectionTransform.copyFrom(r.projectionTransform||mE),e.skewRadius=r.skewRadius||e.skewRadius,e.rotateEnabled=r.rotateEnabled!==!1,e.scaleEnabled=r.scaleEnabled!==!1,e.skewEnabled=r.skewEnabled===!0,e.translateEnabled=r.translateEnabled!==!1,e.transientGroupTilt=r.transientGroupTilt,t.handleConstructor!==r.handleConstructor)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");t.rotationSnaps!==r.rotationSnaps&&(e.rotationSnaps=r.rotationSnaps),t.rotationSnapTolerance!==r.rotationSnapTolerance&&(e.rotationSnapTolerance=r.rotationSnapTolerance),t.skewSnaps!==r.skewSnaps&&(e.skewSnaps=r.skewSnaps),t.skewSnapTolerance!==r.skewSnapTolerance&&(e.skewSnapTolerance=r.skewSnapTolerance);const n=t.handleStyle||ol,i=r.handleStyle||ol;(n.color!==i.color||n.outlineColor!==i.outlineColor||n.outlineThickness!==i.outlineThickness||n.radius!==i.radius||n.shape!==i.shape)&&(e.handleStyle=i);const s=t.wireframeStyle||ol,a=r.wireframeStyle||ol;(s.color!==a.color||s.thickness!==a.thickness)&&(e.wireframeStyle=a)}}),ch=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o=""})=>{const c=Ar.utils.string2hex("#F3C409"),h=Ar.utils.string2hex("#F3C409"),d=Mt.useRef({isDragging:!1}),p=Mt.useCallback(()=>{s&&!d.current.isDragging&&s(!0)},[s]),f=Mt.useCallback(()=>{s&&!d.current.isDragging&&s(!1)},[s]),m=Mt.useCallback(()=>{d.current.isDragging=!0},[]),g=Mt.useCallback(()=>{d.current.isDragging=!1},[]),v=Mt.useCallback(()=>{d.current.isDragging=!1},[]),b=Mt.useCallback(()=>{console.log("dobule click in pixi transformer"),a&&a({uniqueId:o})},[a]),_=Mt.useCallback(S=>{d.current.isDragging=!0,i&&i(S)},[i]),w=Mt.useCallback(()=>{if(t.current===null)return;const S=t.current.x,x=t.current.y,A=t.current.width,N=t.current.height,O=t.current.rotation,P=[t.current.scale.x,t.current.scale.y];n&&n({uniqueId:o,transformation:{x:Math.round(S),y:Math.round(x),width:Math.round(Math.max(5,A)),height:Math.round(Math.max(5,N)),rotate:Math.round(O),scale:P}}),d.current.isDragging=!1},[n]);return Mt.useEffect(()=>(e.current&&(e.current.on("mouseover",p),e.current.on("mouseout",f),e.current.on("mousedown",m),e.current.on("mouseup",g),e.current.on("mouseupoutside",v),e.current.addListener("dblclick",b)),()=>{e.current&&(e.current.off("mouseover",p),e.current.off("mouseout",f),e.current.off("mousedown",m),e.current.off("mouseup",g),e.current.off("mouseupoutside",v),e.current.removeListener("dblclick",b))}),[]),$t.jsx(yE,{ref:e,group:r?[t.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:h},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:c,shape:"circle",radius:9},transformchange:_,transformcommit:w})};var ll={};Object.defineProperty(ll,"__esModule",{value:!0});var vE=dt,hh;function zg(){return hh||(hh=document.createElement("div")),hh}function _E(e,t,r){var n;return vE.useEffect(function(){n=n||zg();var i=function(s){var a=s.detail;t(a)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function bE(e,t){var r=zg(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function xE(){var e;function t(r){e=r}return t.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});e==null||e.dispatchEvent(i)},t}var Hg=ll.emitCustomEvent=bE;ll.newCustomEventEmitter=xE;var fa=ll.useCustomEventListener=_E;const us=Mt.createContext({}),Gn={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},wE=({children:e})=>{const[t,r]=dt.useState(!1),[n,i]=dt.useState(!1),s=dt.useRef(),a=dt.useRef(),o=dt.useRef(.001);dt.useLayoutEffect(()=>(a.current=Wr.context(()=>{s.current&&s.current.progress(0).kill(),s.current=Wr.timeline({paused:!0,defaults:{duration:0}})}),()=>a.current.revert()),[]);const c=dt.useCallback(()=>{let w=s.current.time();o.current=w},[]);dt.useEffect(()=>{const _=s.current;_.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){_.pause(),c()}).eventCallback("onUpdate",function(){c()}).eventCallback("onPause",function(){console.log("onPause",_.progress()),c()}).eventCallback("onResume",function(){console.log("onResume",_.progress()),c()}).eventCallback("onComplete",function(){_.seek(0),_.pause(),c()})},[]);const h=dt.useCallback(()=>{s.current.revert()},[]),d=dt.useCallback(()=>{s.current.restart(),r(!0)},[]),p=dt.useCallback(()=>{const _=s.current;_.repeat(1),_.restart()},[]),f=dt.useCallback(_=>{s.current.seek(_)},[]),m=dt.useCallback(()=>{s.current.seek(4)},[]),g=dt.useCallback(()=>{const _=s.current;return _?_.totalDuration():0},[]),v=()=>{s.current.pause(),Hg(Gn.PAUSE),r(!1)},b=()=>{const _=s.current;r(!0),_.resume(),Hg(Gn.RESUME)};return fa(Gn.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),fa(Gn.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),$t.jsx(us.Provider,{value:{gsapCtx:a,tl:s,handlePlay:b,handlePause:v,handleReset:h,handleSeek:f,handleSeekTest:m,handleRestart:d,handleRepeat:p,playerTimeRef:o,isDragging:n,getTimelineDuration:g},children:e})},fh=e=>{let t={};switch(e){case"NONE":case"none":break;case"BOUNCE_IN":t.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":t.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":t.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":t.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":t.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":t.from={ease:"bounce.in",y:2,duration:2};break;case"BOUNCE_OUT_DOWN":break;case"BOUNCE_OUT_LEFT":break;case"BOUNCE_OUT_RIGHT":break;case"BOUNCE_OUT_UP":break;case"FADE_IN":t.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":t.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":t.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":t.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":t.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break}return t};var SE=Object.prototype;function TE(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||SE;return e===r}var Gg=TE;function EE(e,t){return function(r){return e(t(r))}}var AE=EE,CE=AE,OE=CE(Object.keys,Object),PE=OE,IE=Gg,kE=PE,RE=Object.prototype,NE=RE.hasOwnProperty;function ME(e){if(!IE(e))return kE(e);var t=[];for(var r in Object(e))NE.call(e,r)&&r!="constructor"&&t.push(r);return t}var qg=ME,LE=typeof Nn=="object"&&Nn&&Nn.Object===Object&&Nn,Vg=LE,BE=Vg,FE=typeof self=="object"&&self&&self.Object===Object&&self,DE=BE||FE||Function("return this")(),An=DE,UE=An,jE=UE.Symbol,ul=jE,Wg=ul,Xg=Object.prototype,$E=Xg.hasOwnProperty,zE=Xg.toString,da=Wg?Wg.toStringTag:void 0;function HE(e){var t=$E.call(e,da),r=e[da];try{e[da]=void 0;var n=!0}catch{}var i=zE.call(e);return n&&(t?e[da]=r:delete e[da]),i}var GE=HE,qE=Object.prototype,VE=qE.toString;function WE(e){return VE.call(e)}var XE=WE,Yg=ul,YE=GE,KE=XE,ZE="[object Null]",QE="[object Undefined]",Kg=Yg?Yg.toStringTag:void 0;function JE(e){return e==null?e===void 0?QE:ZE:Kg&&Kg in Object(e)?YE(e):KE(e)}var pa=JE;function tA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var dh=tA,eA=pa,rA=dh,nA="[object AsyncFunction]",iA="[object Function]",sA="[object GeneratorFunction]",aA="[object Proxy]";function oA(e){if(!rA(e))return!1;var t=eA(e);return t==iA||t==sA||t==nA||t==aA}var Zg=oA,lA=An,uA=lA["__core-js_shared__"],cA=uA,ph=cA,Qg=function(){var e=/[^.]+$/.exec(ph&&ph.keys&&ph.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function hA(e){return!!Qg&&Qg in e}var fA=hA,dA=Function.prototype,pA=dA.toString;function mA(e){if(e!=null){try{return pA.call(e)}catch{}try{return e+""}catch{}}return""}var Jg=mA,gA=Zg,yA=fA,vA=dh,_A=Jg,bA=/[\\^$.*+?()[\]{}|]/g,xA=/^\[object .+?Constructor\]$/,wA=Function.prototype,SA=Object.prototype,TA=wA.toString,EA=SA.hasOwnProperty,AA=RegExp("^"+TA.call(EA).replace(bA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CA(e){if(!vA(e)||yA(e))return!1;var t=gA(e)?AA:xA;return t.test(_A(e))}var OA=CA;function PA(e,t){return e==null?void 0:e[t]}var IA=PA,kA=OA,RA=IA;function NA(e,t){var r=RA(e,t);return kA(r)?r:void 0}var cs=NA,MA=cs,LA=An,BA=MA(LA,"DataView"),FA=BA,DA=cs,UA=An,jA=DA(UA,"Map"),mh=jA,$A=cs,zA=An,HA=$A(zA,"Promise"),GA=HA,qA=cs,VA=An,WA=qA(VA,"Set"),XA=WA,YA=cs,KA=An,ZA=YA(KA,"WeakMap"),QA=ZA,gh=FA,yh=mh,vh=GA,_h=XA,bh=QA,ty=pa,hs=Jg,ey="[object Map]",JA="[object Object]",ry="[object Promise]",ny="[object Set]",iy="[object WeakMap]",sy="[object DataView]",t2=hs(gh),e2=hs(yh),r2=hs(vh),n2=hs(_h),i2=hs(bh),wi=ty;(gh&&wi(new gh(new ArrayBuffer(1)))!=sy||yh&&wi(new yh)!=ey||vh&&wi(vh.resolve())!=ry||_h&&wi(new _h)!=ny||bh&&wi(new bh)!=iy)&&(wi=function(e){var t=ty(e),r=t==JA?e.constructor:void 0,n=r?hs(r):"";if(n)switch(n){case t2:return sy;case e2:return ey;case r2:return ry;case n2:return ny;case i2:return iy}return t});var ay=wi;function s2(e){return e!=null&&typeof e=="object"}var ma=s2,a2=pa,o2=ma,l2="[object Arguments]";function u2(e){return o2(e)&&a2(e)==l2}var c2=u2,oy=c2,h2=ma,ly=Object.prototype,f2=ly.hasOwnProperty,d2=ly.propertyIsEnumerable,p2=oy(function(){return arguments}())?oy:function(e){return h2(e)&&f2.call(e,"callee")&&!d2.call(e,"callee")},xh=p2,m2=Array.isArray,nn=m2,g2=9007199254740991;function y2(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=g2}var wh=y2,v2=Zg,_2=wh;function b2(e){return e!=null&&_2(e.length)&&!v2(e)}var cl=b2,hl={exports:{}};function x2(){return!1}var w2=x2;hl.exports,function(e,t){var r=An,n=w2,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?r.Buffer:void 0,c=o?o.isBuffer:void 0,h=c||n;e.exports=h}(hl,hl.exports);var Sh=hl.exports,S2=pa,T2=wh,E2=ma,A2="[object Arguments]",C2="[object Array]",O2="[object Boolean]",P2="[object Date]",I2="[object Error]",k2="[object Function]",R2="[object Map]",N2="[object Number]",M2="[object Object]",L2="[object RegExp]",B2="[object Set]",F2="[object String]",D2="[object WeakMap]",U2="[object ArrayBuffer]",j2="[object DataView]",$2="[object Float32Array]",z2="[object Float64Array]",H2="[object Int8Array]",G2="[object Int16Array]",q2="[object Int32Array]",V2="[object Uint8Array]",W2="[object Uint8ClampedArray]",X2="[object Uint16Array]",Y2="[object Uint32Array]",le={};le[$2]=le[z2]=le[H2]=le[G2]=le[q2]=le[V2]=le[W2]=le[X2]=le[Y2]=!0,le[A2]=le[C2]=le[U2]=le[O2]=le[j2]=le[P2]=le[I2]=le[k2]=le[R2]=le[N2]=le[M2]=le[L2]=le[B2]=le[F2]=le[D2]=!1;function K2(e){return E2(e)&&T2(e.length)&&!!le[S2(e)]}var Z2=K2;function Q2(e){return function(t){return e(t)}}var J2=Q2,fl={exports:{}};fl.exports,function(e,t){var r=Vg,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,a=s&&r.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o}(fl,fl.exports);var tC=fl.exports,eC=Z2,rC=J2,uy=tC,cy=uy&&uy.isTypedArray,nC=cy?rC(cy):eC,Th=nC,iC=qg,sC=ay,aC=xh,oC=nn,lC=cl,uC=Sh,cC=Gg,hC=Th,fC="[object Map]",dC="[object Set]",pC=Object.prototype,mC=pC.hasOwnProperty;function gC(e){if(e==null)return!0;if(lC(e)&&(oC(e)||typeof e=="string"||typeof e.splice=="function"||uC(e)||hC(e)||aC(e)))return!e.length;var t=sC(e);if(t==fC||t==dC)return!e.size;if(cC(e))return!iC(e).length;for(var r in e)if(mC.call(e,r))return!1;return!0}var yC=gC;const gr=ni(yC),vC=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Eh=e=>{const[t,r]=Mt.useState(!1),[,n]=dt.useState(!1),[,i]=dt.useState(!1),s=dt.useRef(null),a=dt.useRef(null),o=dt.useRef(null),c=dt.useRef(null),{tl:h}=dt.useContext(us),{uniqueId:d,startAt:p,endAt:f,initialAlpha:m,transformation:{x:g,y:v,width:b,height:_,colorCorrection:w,animation:S,effect:x},applyTransformer:A}=e;console.log("all abstract props",e);const{contrast:N=1,saturation:O=1,brightness:P=1,alpha:B=1,blurRadius:I=0}=w||{},C={...P>1&&{brightness:P},...N>1&&{contrast:N},...O>1&&{saturation:O},...B!==0&&{alpha:B}};Mt.useEffect(()=>{s.current&&r(!0)},[]),Mt.useEffect(()=>{let V=Wr.context(()=>{});if(s.current&&h.current){const q={duration:Number(f)-Number(p)},X=fh(S||"None");V=Wr.context(()=>{var G,D;gr(X.from)?gr(X.to)?gr(X.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},p).from(o.current,{...q},p).to(s.current,{alpha:0,duration:.1},Number(f)-.1):h.current.fromTo(s.current,(G=X.fromTo)==null?void 0:G.from,(D=X.fromTo)==null?void 0:D.to,p).from(o.current,{...q},p).to(s.current,{alpha:0,duration:.2},f-.2):h.current.to(s.current,{alpha:1,duration:.2,...X.to},p).from(o.current,{...q},p).to(s.current,{alpha:0,duration:.2},f-.2):h.current.from(s.current,{...X.from},p).to(o.current,{alpha:1,duration:.2},p).from(o.current,{...q},p).to(s.current,{alpha:0,duration:.2},f-.2)})}return()=>V.revert()},[S,p,f]);const k=Mt.useCallback(()=>{n(!0)},[]),M=Mt.useCallback(V=>{console.log("changeEnd",V),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(V))},[]),F=qt.withFilters(qt.Container,{...I>0&&{blur:Ar.filters.BlurFilter},...!gr(C)&&{adjust:ah},matrix:Ar.filters.ColorMatrixFilter}),$=(w==null?void 0:w.enabled)||x&&x!==xi.Normal;return $t.jsxs(qt.Container,{ref:a,children:[$t.jsxs(qt.Container,{ref:s,alpha:m,position:[g,v],pivot:[g,v],width:b,height:_,children:[$&&$t.jsx(F,{scale:1,blur:{blur:I,quality:4},adjust:C,apply:({matrix:V})=>{x===xi.BlackAndWhite?V.desaturate():x===xi.Sepia?V.sepia():x===xi.RetroVintage||x===xi.NightVision?V.negative():x===xi.Normal&&V.reset()},matrix:{enabled:!0,matrix:vC},children:$t.jsx(qt.Container,{ref:o,children:e.children})}),!$&&$t.jsx(qt.Container,{ref:o,children:e.children})]}),A&&$t.jsx(ch,{pixiTransformerRef:c,imageRef:s,isMounted:t,transformCommit:M,transformChange:k,mouseoverEvent:i,uniqueId:d})]})},_C=e=>{const t=dt.useRef(null),r=dt.useRef(null),{src:n,transformation:{x:i,y:s,width:a,height:o,anchor:c},pointerdown:h,pointerup:d,mousedown:p,mouseup:f,pointerover:m,mouseover:g,mouseout:v}=e;return $t.jsx(Eh,{...e,children:$t.jsx(qt.Container,{ref:r,children:$t.jsx(qt.Sprite,{image:n,width:a,height:o,anchor:c,ref:t,x:i,y:s,interactive:!0,pointerdown:h,pointerup:d,pointerover:m,mousedown:p,mouseup:f,mouseover:g,mouseout:v})})})};var bC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ah={},xC={get exports(){return Ah},set exports(e){Ah=e}};/*!
539
+ `;class Zs extends Oe{constructor(t){super(Jp,ty),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,t)}apply(t,r,n,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,r,n,i)}}var er=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(er||{});class Qs{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?At.EMPTY:(t=t||new At(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,r){const{a:n,b:i,c:s,d:a,tx:o,ty:l}=t,h=n*r.x+s*r.y+o,c=i*r.x+a*r.y+l;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let r=this.minX,n=this.minY,i=this.maxX,s=this.maxY,a=t[0],o=t[1];r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[2],o=t[3],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[4],o=t[5],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[6],o=t[7],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,this.minX=r,this.minY=n,this.maxX=i,this.maxY=s}addFrame(t,r,n,i,s){this.addFrameMatrix(t.worldTransform,r,n,i,s)}addFrameMatrix(t,r,n,i,s){const a=t.a,o=t.b,l=t.c,h=t.d,c=t.tx,f=t.ty;let u=this.minX,d=this.minY,p=this.maxX,v=this.maxY,g=a*r+l*n+c,y=o*r+h*n+f;u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*i+l*n+c,y=o*i+h*n+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*r+l*s+c,y=o*r+h*s+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*i+l*s+c,y=o*i+h*s+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,this.minX=u,this.minY=d,this.maxX=p,this.maxY=v}addVertexData(t,r,n){let i=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let l=r;l<n;l+=2){const h=t[l],c=t[l+1];i=h<i?h:i,s=c<s?c:s,a=h>a?h:a,o=c>o?c:o}this.minX=i,this.minY=s,this.maxX=a,this.maxY=o}addVertices(t,r,n,i){this.addVerticesMatrix(t.worldTransform,r,n,i)}addVerticesMatrix(t,r,n,i,s=0,a=s){const o=t.a,l=t.b,h=t.c,c=t.d,f=t.tx,u=t.ty;let d=this.minX,p=this.minY,v=this.maxX,g=this.maxY;for(let y=n;y<i;y+=2){const b=r[y],_=r[y+1],m=o*b+h*_+f,x=c*_+l*b+u;d=Math.min(d,m-s),v=Math.max(v,m+s),p=Math.min(p,x-a),g=Math.max(g,x+a)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=g}addBounds(t){const r=this.minX,n=this.minY,i=this.maxX,s=this.maxY;this.minX=t.minX<r?t.minX:r,this.minY=t.minY<n?t.minY:n,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,r){const n=t.minX>r.minX?t.minX:r.minX,i=t.minY>r.minY?t.minY:r.minY,s=t.maxX<r.maxX?t.maxX:r.maxX,a=t.maxY<r.maxY?t.maxY:r.maxY;if(n<=s&&i<=a){const o=this.minX,l=this.minY,h=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>h?s:h,this.maxY=a>c?a:c}}addBoundsMatrix(t,r){this.addFrameMatrix(r,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,r){const n=t.minX>r.x?t.minX:r.x,i=t.minY>r.y?t.minY:r.y,s=t.maxX<r.x+r.width?t.maxX:r.x+r.width,a=t.maxY<r.y+r.height?t.maxY:r.y+r.height;if(n<=s&&i<=a){const o=this.minX,l=this.minY,h=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>h?s:h,this.maxY=a>c?a:c}}pad(t=0,r=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=r,this.maxY+=r)}addFramePad(t,r,n,i,s,a){t-=s,r-=a,n+=s,i+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class Rr extends _n{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Hn,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Qs,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const r=Object.keys(t);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(Rr.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,r){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new At),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new At),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Qs);const r=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-s,a}toGlobal(t,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,r)}toLocal(t,r,n,i){return r&&(t=r.toGlobal(t,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,n)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)}setTransform(t=0,r=0,n=1,i=1,s=0,a=0,o=0,l=0,h=0){return this.position.x=t,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=l,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new ey),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*Yd}set angle(t){this.transform.rotation=t*Kd}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=t,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class ey extends Rr{constructor(){super(...arguments),this.sortDirty=null}}Rr.prototype.displayObjectUpdateTransform=Rr.prototype.updateTransform;const ry=new Ot;function ny(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const Js=class extends Rr{constructor(){super(),this.children=[],this.sortableChildren=Js.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.addChild(e[t]);else{const t=e[0];t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this)}return e[0]}addChildAt(e,t){if(t<0||t>this.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const r=this.getChildIndex(e),n=this.getChildIndex(t);this.children[r]=t,this.children[n]=e,this.onChildrenChange(r<n?r:n)}getChildIndex(e){const t=this.children.indexOf(e);if(t===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return t}setChildIndex(e,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(e);Bn(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.removeChild(e[t]);else{const t=e[0],r=this.children.indexOf(t);if(r===-1)return null;t.parent=null,t.transform._parentID=-1,Bn(this.children,r,1),this._boundsID++,this.onChildrenChange(r),t.emit("removed",this),this.emit("childRemoved",t,this,r)}return e[0]}removeChildAt(e){const t=this.getChildAt(e);return t.parent=null,t.transform._parentID=-1,Bn(this.children,e,1),this._boundsID++,this.onChildrenChange(e),t.emit("removed",this),this.emit("childRemoved",t,this,e),t}removeChildren(e=0,t=this.children.length){const r=e,n=t,i=n-r;let s;if(i>0&&i<=n){s=this.children.splice(r,i);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(i===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let e=!1;for(let t=0,r=this.children.length;t<r;++t){const n=this.children[t];n._lastSortedIndex=t,!e&&n.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(ny),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e<t;++e){const r=this.children[e];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){const t=this.children[e];if(!(!t.visible||!t.renderable))if(t.calculateBounds(),t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(t._bounds,r._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}getLocalBounds(e,t=!1){const r=super.getLocalBounds(e);if(!t)for(let n=0,i=this.children.length;n<i;++n){const s=this.children[n];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const t=e.renderTexture.sourceFrame;if(!(t.width>0&&t.height>0))return;let r,n;this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==Js.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=ry.copyFrom(n),n.prepend(i)):n=i),r&&t.intersects(r,n))this._render(e);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],l=o.cullable;o.cullable=l||!this.cullArea,o.render(e),o.cullable=l}}render(e){var t;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(t=this.filters)!=null&&t.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let r=0,n=this.children.length;r<n;++r)this.children[r].render(e)}}renderAdvanced(e){var i,s,a;const t=this.filters,r=this._mask;if(t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<t.length;o++)t[o].enabled&&this._enabledFilters.push(t[o])}const n=t&&((i=this._enabledFilters)==null?void 0:i.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ut.NONE));if(n&&e.batch.flush(),t&&((s=this._enabledFilters)!=null&&s.length)&&e.filter.push(this,this._enabledFilters),r&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let o=0,l=this.children.length;o<l;++o)this.children[o].render(e)}n&&e.batch.flush(),r&&e.mask.pop(this),t&&((a=this._enabledFilters)!=null&&a.length)&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;const t=typeof e=="boolean"?e:e==null?void 0:e.children,r=this.removeChildren(0,this.children.length);if(t)for(let n=0;n<r.length;++n)r[n].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){const t=this.getLocalBounds().width;t!==0?this.scale.x=e/t:this.scale.x=1,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){const t=this.getLocalBounds().height;t!==0?this.scale.y=e/t:this.scale.y=1,this._height=e}};let rr=Js;rr.defaultSortableChildren=!1,rr.prototype.containerUpdateTransform=rr.prototype.updateTransform,Object.defineProperties(vt,{SORTABLE_CHILDREN:{get(){return rr.defaultSortableChildren},set(e){xt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),rr.defaultSortableChildren=e}}});class si{constructor(t=0,r=0,n=0,i=0){this._x=Number(t),this._y=Number(r),this._width=Number(n),this._height=Number(i),this._hull=[new nt,new nt,new nt,new nt],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(t){this._x=t,this.dirtyID++}get y(){return this._y}set y(t){this._y=t,this.dirtyID++}get width(){return this._width}set width(t){this._width=t,this.dirtyID++}get height(){return this._height}set height(t){this._height=t,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[t,r,n,i]=this._hull;t.set(this._x,this._y),r.set(this._x+this._width,this._y),n.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new si(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}equals(t){return t?t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height:!1}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}}const Wl=new nt;class ai{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof si&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new si(t,r,n,i),this._rotation=s,this._center=new Je(this.updateCenter,this),this._hull=[new nt,new nt,new nt,new nt],this._matrix=new Ot,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(t){this.center.copyFrom(t)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(t){return t?this.innerBounds.equals(t.innerBounds)&&this.rotation===t.rotation:!1}contains(t,r){typeof t=="number"&&(t=Wl.set(t,r));const n=this._matrix.applyInverse(t,Wl);return this.innerBounds.contains(n.x,n.y)}copyFrom(t){return this.innerBounds.copyFrom(t.innerBounds),this.rotation=t.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const t=this.innerBounds,r=this._rotation,n=this._center,[i,s,a,o]=this._hull,l=this._matrix;n._x=t.x+t.width/2,n._y=t.y+t.height/2,l.identity().translate(-n.x,-n.y).rotate(r).translate(n.x,n.y),l.apply(t.topLeft,i),l.apply(t.topRight,s),l.apply(t.bottomRight,a),l.apply(t.bottomLeft,o),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const t=this.center,r=this.innerBounds;r.x=t.x-r.width/2,r.y=t.y-r.height/2}}class Yl{constructor(t,r){this._history=new Array(t),this._decayRatio=r,this._currentIndex=0;for(let n=0;n<t;n++)this._history[n]=0}next(t){const{_history:r,_decayRatio:n}=this,i=r.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,r[this._currentIndex]=t;let s=0,a=0;for(let o=this._currentIndex+1;o<i;o++)s=(s+r[o])*n,a=(a+1)*n;for(let o=0;o<=this._currentIndex;o++)s=(s+r[o])*n,a=(a+1)*n;return this._average=s/a,this._average}absDev(){let t=0;for(let r=0,n=this._history.length;r<n;r++)t+=Math.abs(this._history[r]-this._average);return t/this._history.length}}class oi{constructor(t={}){oi.prototype.__init.call(this),this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=t.reserve||0,this._capacityRatio=t.capacityRatio||1.2,this._decayRatio=t.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new Yl(128,this._decayRatio),this._marginAverageProvider=new Yl(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(t){this._freeList.length=Math.ceil(t)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(t){let r,n;Array.isArray(t)?(r=t,n=t.length):(n=t,r=new Array(n)),this._borrowRate+=n,this._flowRate+=n;let i=0;if(this._freeCount>0){const s=this._freeList,a=Math.min(this._freeCount,n);let o=this._freeCount;for(let l=0;l<a;l++)r[i]=s[o-1],++i,--o;this._freeCount=o}for(;i<n;)r[i]=this.create(),++i;return r}release(t){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=t,++this._freeCount}releaseArray(t){this._returnRate+=t.length,this._flowRate-=t.length,this._freeCount+t.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+t.length));for(let r=0,n=t.length;r<n;r++)this._freeList[this._freeCount]=t[r],++this._freeCount}reserve(t){if(this._reserveCount=t,this._freeCount<t){const r=this._freeCount-t;for(let n=0;n<r;n++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(t){if(this._freeCount>t){this.capacity>t*this._capacityRatio&&(this.capacity=t*this._capacityRatio);const n=Math.min(this._freeCount,this.capacity);for(let i=t;i<n;i++)this._freeList[i]=null}}startGC(t=Zt.shared){t.add(this._gcTick,null,an.UTILITY)}stopGC(t=Zt.shared){t.remove(this._gcTick)}__init(){this._gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const t=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const r=this._freeCount,n=this._freeList.length;if(r<128&&this._borrowRateAverage<128&&n<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+t){const s=i+t;this.capacity=Math.min(this._freeList.length,Math.ceil(s)),this._freeCount=this._freeList.length}}}}var ta;const Kl=new Map;class Zl{static build(t){let r=Kl.get(t);return r||(r=new class extends oi{create(){return new t}},Kl.set(t,r),r)}static buildFunctional(t){return new(ta=class extends oi{constructor(...n){super(...n),ta.prototype.__init.call(this)}__init(){this.create=t}},ta)}}const li={build(e){const t=e.points;let r,n,i,s,a,o;if(e.type===qt.CIRC){const p=e.shape;r=p.x,n=p.y,a=o=p.radius,i=s=0}else if(e.type===qt.ELIP){const p=e.shape;r=p.x,n=p.y,a=p.width,o=p.height,i=s=0}else{const p=e.shape,v=p.width/2,g=p.height/2;r=p.x+v,n=p.y+g,a=o=Math.max(0,Math.min(p.radius,Math.min(v,g))),i=v-a,s=g-o}if(!(a>=0&&o>=0&&i>=0&&s>=0)){t.length=0;return}const l=Math.ceil(2.3*Math.sqrt(a+o)),h=l*8+(i?4:0)+(s?4:0);if(t.length=h,h===0)return;if(l===0){t.length=8,t[0]=t[6]=r+i,t[1]=t[3]=n+s,t[2]=t[4]=r-i,t[5]=t[7]=n-s;return}let c=0,f=l*4+(i?2:0)+2,u=f,d=h;{const p=i+a,v=s,g=r+p,y=r-p,b=n+v;if(t[c++]=g,t[c++]=b,t[--f]=b,t[--f]=y,s){const _=n-v;t[u++]=y,t[u++]=_,t[--d]=_,t[--d]=g}}for(let p=1;p<l;p++){const v=Math.PI/2*(p/l),g=i+Math.cos(v)*a,y=s+Math.sin(v)*o,b=r+g,_=r-g,m=n+y,x=n-y;t[c++]=b,t[c++]=m,t[--f]=m,t[--f]=_,t[u++]=_,t[u++]=x,t[--d]=x,t[--d]=b}{const p=i,v=s+o,g=r+p,y=r-p,b=n+v,_=n-v;t[c++]=g,t[c++]=b,t[--d]=_,t[--d]=g,i&&(t[c++]=y,t[c++]=b,t[--d]=_,t[--d]=y)}},triangulate(e,t){const r=e.points,n=t.points,i=t.indices;if(r.length===0)return;let s=n.length/2;const a=s;let o,l;if(e.type!==qt.RREC){const c=e.shape;o=c.x,l=c.y}else{const c=e.shape;o=c.x+c.width/2,l=c.y+c.height/2}const h=e.matrix;n.push(e.matrix?h.a*o+h.c*l+h.tx:o,e.matrix?h.b*o+h.d*l+h.ty:l),s++,n.push(r[0],r[1]);for(let c=2;c<r.length;c+=2)n.push(r[c],r[c+1]),i.push(s++,a,s);i.push(a+1,a,s)}};function Ql(e,t=!1){const r=e.length;if(r<6)return;let n=0;for(let i=0,s=e[r-2],a=e[r-1];i<r;i+=2){const o=e[i],l=e[i+1];n+=(o-s)*(l+a),s=o,a=l}if(!t&&n>0||t&&n<=0){const i=r/2;for(let s=i+i%2;s<r;s+=2){const a=r-s-2,o=r-s-1,l=s,h=s+1;[e[a],e[l]]=[e[l],e[a]],[e[o],e[h]]=[e[h],e[o]]}}}const Jl={build(e){e.points=e.shape.points.slice()},triangulate(e,t){let r=e.points;const n=e.holes,i=t.points,s=t.indices;if(r.length>=6){Ql(r,!1);const a=[];for(let h=0;h<n.length;h++){const c=n[h];Ql(c.points,!0),a.push(r.length/2),r=r.concat(c.points)}const o=pc(r,a,2);if(!o)return;const l=i.length/2;for(let h=0;h<o.length;h+=3)s.push(o[h]+l),s.push(o[h+1]+l),s.push(o[h+2]+l);for(let h=0;h<r.length;h++)i.push(r[h])}}},iy={build(e){const t=e.shape,r=t.x,n=t.y,i=t.width,s=t.height,a=e.points;a.length=0,i>=0&&s>=0&&a.push(r,n,r+i,n,r+i,n+s,r,n+s)},triangulate(e,t){const r=e.points,n=t.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},sy={build(e){li.build(e)},triangulate(e,t){li.triangulate(e,t)}};var he=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(he||{}),nr=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(nr||{});const Ir={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=20){if(!this.adaptive||!e||isNaN(e))return t;let r=Math.ceil(e/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class tu{static curveTo(t,r,n,i,s,a){const o=a[a.length-2],h=a[a.length-1]-r,c=o-t,f=i-r,u=n-t,d=Math.abs(h*u-c*f);if(d<1e-8||s===0)return(a[a.length-2]!==t||a[a.length-1]!==r)&&a.push(t,r),null;const p=h*h+c*c,v=f*f+u*u,g=h*f+c*u,y=s*Math.sqrt(p)/d,b=s*Math.sqrt(v)/d,_=y*g/p,m=b*g/v,x=y*u+b*c,S=y*f+b*h,w=c*(b+_),T=h*(b+_),N=u*(y+m),A=f*(y+m),E=Math.atan2(T-S,w-x),O=Math.atan2(A-S,N-x);return{cx:x+t,cy:S+r,radius:s,startAngle:E,endAngle:O,anticlockwise:c*f>u*h}}static arc(t,r,n,i,s,a,o,l,h){const c=o-a,f=Ir._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/Gn)*40),u=c/(f*2),d=u*2,p=Math.cos(u),v=Math.sin(u),g=f-1,y=g%1/g;for(let b=0;b<=g;++b){const _=b+y*b,m=u+a+d*_,x=Math.cos(m),S=-Math.sin(m);h.push((p*x+v*S)*s+n,(p*-S+v*x)*s+i)}}}class ay{constructor(){this.reset()}begin(t,r,n){this.reset(),this.style=t,this.start=r,this.attribStart=n}end(t,r){this.attribSize=r-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class ea{static curveLength(t,r,n,i,s,a,o,l){let c=0,f=0,u=0,d=0,p=0,v=0,g=0,y=0,b=0,_=0,m=0,x=t,S=r;for(let w=1;w<=10;++w)f=w/10,u=f*f,d=u*f,p=1-f,v=p*p,g=v*p,y=g*t+3*v*f*n+3*p*u*s+d*o,b=g*r+3*v*f*i+3*p*u*a+d*l,_=x-y,m=S-b,x=y,S=b,c+=Math.sqrt(_*_+m*m);return c}static curveTo(t,r,n,i,s,a,o){const l=o[o.length-2],h=o[o.length-1];o.length-=2;const c=Ir._segmentsCount(ea.curveLength(l,h,t,r,n,i,s,a));let f=0,u=0,d=0,p=0,v=0;o.push(l,h);for(let g=1,y=0;g<=c;++g)y=g/c,f=1-y,u=f*f,d=u*f,p=y*y,v=p*y,o.push(d*l+3*u*y*t+3*f*p*n+v*s,d*h+3*u*y*r+3*f*p*i+v*a)}}function eu(e,t,r,n,i,s,a,o){const l=e-r*i,h=t-n*i,c=e+r*s,f=t+n*s;let u,d;a?(u=n,d=-r):(u=-n,d=r);const p=l+u,v=h+d,g=c+u,y=f+d;return o.push(p,v,g,y),2}function ir(e,t,r,n,i,s,a,o){const l=r-e,h=n-t;let c=Math.atan2(l,h),f=Math.atan2(i-e,s-t);o&&c<f?c+=Math.PI*2:!o&&c>f&&(f+=Math.PI*2);let u=c;const d=f-c,p=Math.abs(d),v=Math.sqrt(l*l+h*h),g=(15*p*Math.sqrt(v)/Math.PI>>0)+1,y=d/g;if(u+=y,o){a.push(e,t,r,n);for(let b=1,_=u;b<g;b++,_+=y)a.push(e,t,e+Math.sin(_)*v,t+Math.cos(_)*v);a.push(e,t,i,s)}else{a.push(r,n,e,t);for(let b=1,_=u;b<g;b++,_+=y)a.push(e+Math.sin(_)*v,t+Math.cos(_)*v,e,t);a.push(i,s,e,t)}return g*2}function oy(e,t){const r=e.shape;let n=e.points||r.points.slice();const i=t.closePointEps;if(n.length===0)return;const s=e.lineStyle,a=new nt(n[0],n[1]),o=new nt(n[n.length-2],n[n.length-1]),l=r.type!==qt.POLY||r.closeStroke,h=Math.abs(a.x-o.x)<i&&Math.abs(a.y-o.y)<i;if(l){n=n.slice(),h&&(n.pop(),n.pop(),o.set(n[n.length-2],n[n.length-1]));const D=(a.x+o.x)*.5,z=(o.y+a.y)*.5;n.unshift(D,z),n.push(D,z)}const c=t.points,f=n.length/2;let u=n.length;const d=c.length/2,p=s.width/2,v=p*p,g=s.miterLimit*s.miterLimit;let y=n[0],b=n[1],_=n[2],m=n[3],x=0,S=0,w=-(b-m),T=y-_,N=0,A=0,E=Math.sqrt(w*w+T*T);w/=E,T/=E,w*=p,T*=p;const O=s.alignment,R=(1-O)*2,C=O*2;l||(s.cap===nr.ROUND?u+=ir(y-w*(R-C)*.5,b-T*(R-C)*.5,y-w*R,b-T*R,y+w*C,b+T*C,c,!0)+2:s.cap===nr.SQUARE&&(u+=eu(y,b,w,T,R,C,!0,c))),c.push(y-w*R,b-T*R,y+w*C,b+T*C);for(let D=1;D<f-1;++D){y=n[(D-1)*2],b=n[(D-1)*2+1],_=n[D*2],m=n[D*2+1],x=n[(D+1)*2],S=n[(D+1)*2+1],w=-(b-m),T=y-_,E=Math.sqrt(w*w+T*T),w/=E,T/=E,w*=p,T*=p,N=-(m-S),A=_-x,E=Math.sqrt(N*N+A*A),N/=E,A/=E,N*=p,A*=p;const z=_-y,j=b-m,k=_-x,I=S-m,P=z*k+j*I,L=j*k-I*z,G=L<0;if(Math.abs(L)<.001*Math.abs(P)){c.push(_-w*R,m-T*R,_+w*C,m+T*C),P>=0&&(s.join===he.ROUND?u+=ir(_,m,_-w*R,m-T*R,_-N*R,m-A*R,c,!1)+4:u+=2,c.push(_-N*C,m-A*C,_+N*R,m+A*R));continue}const $=(-w+y)*(-T+m)-(-w+_)*(-T+b),M=(-N+x)*(-A+m)-(-N+_)*(-A+S),B=(z*M-k*$)/L,q=(I*$-j*M)/L,H=(B-_)*(B-_)+(q-m)*(q-m),X=_+(B-_)*R,K=m+(q-m)*R,et=_-(B-_)*C,it=m-(q-m)*C,ot=Math.min(z*z+j*j,k*k+I*I),ht=G?R:C,Ct=ot+ht*ht*v,It=H<=Ct;let V=s.join;if(V===he.MITER&&H/v>g&&(V=he.BEVEL),It)switch(V){case he.MITER:{c.push(X,K,et,it);break}case he.BEVEL:{G?c.push(X,K,_+w*C,m+T*C,X,K,_+N*C,m+A*C):c.push(_-w*R,m-T*R,et,it,_-N*R,m-A*R,et,it),u+=2;break}case he.ROUND:{G?(c.push(X,K,_+w*C,m+T*C),u+=ir(_,m,_+w*C,m+T*C,_+N*C,m+A*C,c,!0)+4,c.push(X,K,_+N*C,m+A*C)):(c.push(_-w*R,m-T*R,et,it),u+=ir(_,m,_-w*R,m-T*R,_-N*R,m-A*R,c,!1)+4,c.push(_-N*R,m-A*R,et,it));break}}else{switch(c.push(_-w*R,m-T*R,_+w*C,m+T*C),V){case he.MITER:{G?c.push(et,it,et,it):c.push(X,K,X,K),u+=2;break}case he.ROUND:{G?u+=ir(_,m,_+w*C,m+T*C,_+N*C,m+A*C,c,!0)+2:u+=ir(_,m,_-w*R,m-T*R,_-N*R,m-A*R,c,!1)+2;break}}c.push(_-N*R,m-A*R,_+N*C,m+A*C),u+=2}}y=n[(f-2)*2],b=n[(f-2)*2+1],_=n[(f-1)*2],m=n[(f-1)*2+1],w=-(b-m),T=y-_,E=Math.sqrt(w*w+T*T),w/=E,T/=E,w*=p,T*=p,c.push(_-w*R,m-T*R,_+w*C,m+T*C),l||(s.cap===nr.ROUND?u+=ir(_-w*(R-C)*.5,m-T*(R-C)*.5,_-w*R,m-T*R,_+w*C,m+T*C,c,!1)+2:s.cap===nr.SQUARE&&(u+=eu(_,m,w,T,R,C,!1,c)));const F=t.indices,U=Ir.epsilon*Ir.epsilon;for(let D=d;D<u+d-2;++D)y=c[D*2],b=c[D*2+1],_=c[(D+1)*2],m=c[(D+1)*2+1],x=c[(D+2)*2],S=c[(D+2)*2+1],!(Math.abs(y*(m-S)+_*(S-b)+x*(b-m))<U)&&F.push(D,D+1,D+2)}function ly(e,t){let r=0;const n=e.shape,i=e.points||n.points,s=n.type!==qt.POLY||n.closeStroke;if(i.length===0)return;const a=t.points,o=t.indices,l=i.length/2,h=a.length/2;let c=h;for(a.push(i[0],i[1]),r=1;r<l;r++)a.push(i[r*2],i[r*2+1]),o.push(c,c+1),c++;s&&o.push(c,h)}function ru(e,t){e.lineStyle.native?ly(e,t):oy(e,t)}class ra{static curveLength(t,r,n,i,s,a){const o=t-2*n+s,l=r-2*i+a,h=2*n-2*t,c=2*i-2*r,f=4*(o*o+l*l),u=4*(o*h+l*c),d=h*h+c*c,p=2*Math.sqrt(f+u+d),v=Math.sqrt(f),g=2*f*v,y=2*Math.sqrt(d),b=u/v;return(g*p+v*u*(p-y)+(4*d*f-u*u)*Math.log((2*v+b+p)/(b+y)))/(4*g)}static curveTo(t,r,n,i,s){const a=s[s.length-2],o=s[s.length-1],l=Ir._segmentsCount(ra.curveLength(a,o,t,r,n,i));let h=0,c=0;for(let f=1;f<=l;++f){const u=f/l;h=a+(t-a)*u,c=o+(r-o)*u,s.push(h+(t+(n-t)*u-h)*u,c+(r+(i-r)*u-c)*u)}}}const na={[qt.POLY]:Jl,[qt.CIRC]:li,[qt.ELIP]:li,[qt.RECT]:iy,[qt.RREC]:sy},nu=[],ui=[];class hi{constructor(t,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=t.type}clone(){return new hi(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 Nr=new nt,iu=class extends il{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 Qs,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 e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),ui.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t.reset(),nu.push(t)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,r=null,n=null){const i=new hi(e,t,r,n);return this.graphicsData.push(i),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const r=new hi(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].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(e){const t=this.graphicsData;for(let r=0;r<t.length;++r){const n=t[r];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(e,Nr):Nr.copyFrom(e),n.shape.contains(Nr.x,Nr.y))){let i=!1;if(n.holes){for(let s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(Nr.x,Nr.y)){i=!0;break}}if(!i)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const e=this.uvs,t=this.graphicsData;let r=null,n=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],n=r.style);for(let o=this.shapeIndex;o<t.length;o++){this.shapeIndex++;const l=t[o],h=l.fillStyle,c=l.lineStyle;na[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(h.visible||c.visible)&&this.processHoles(l.holes);for(let u=0;u<2;u++){const d=u===0?h:c;if(!d.visible)continue;const p=d.texture.baseTexture,v=this.indices.length,g=this.points.length/2;p.wrapMode=$r.REPEAT,u===0?this.processFill(l):this.processLine(l);const y=this.points.length/2-g;y!==0&&(r&&!this._compareStyles(n,d)&&(r.end(v,g),r=null),r||(r=nu.pop()||new ay,r.begin(d,v,g),this.batches.push(r),n=d),this.addUvs(this.points,e,d.texture,g,y,d.matrix))}}const i=this.indices.length,s=this.points.length/2;if(r&&r.end(i,s),this.batches.length===0){this.batchable=!0;return}const a=s>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(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e<t;e++){const r=this.graphicsData[e],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let t=0,r=e.length;t<r;t++){const n=e[t];for(let i=0;i<n.size;i++){const s=n.start+i;this.indicesUint16[s]=this.indicesUint16[s]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<iu.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++gt._globalBatch;for(let c=0;c<this.drawCalls.length;c++)this.drawCalls[c].texArray.clear(),ui.push(this.drawCalls[c]);this.drawCalls.length=0;const t=this.colors,r=this.textureIds;let n=ui.pop();n||(n=new Ls,n.texArray=new js),n.texArray.count=0,n.start=0,n.size=0,n.type=Pe.TRIANGLES;let i=0,s=null,a=0,o=!1,l=Pe.TRIANGLES,h=0;this.drawCalls.push(n);for(let c=0;c<this.batches.length;c++){const f=this.batches[c],u=8,d=f.style,p=d.texture.baseTexture;o!==!!d.native&&(o=!!d.native,l=o?Pe.LINES:Pe.TRIANGLES,s=null,i=u,e++),s!==p&&(s=p,p._batchEnabled!==e&&(i===u&&(e++,i=0,n.size>0&&(n=ui.pop(),n||(n=new Ls,n.texArray=new js),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=i,p.wrapMode=$r.REPEAT,n.texArray.elements[n.texArray.count++]=p,i++)),n.size+=f.size,h+=f.size,a=p._batchLocation,this.addColors(t,d.color,d.alpha,f.attribSize,f.attribStart),this.addTextureIds(r,a,f.attribSize,f.attribStart)}gt._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(e.length*3*4),s=new Float32Array(i),a=new Uint32Array(i);let o=0;for(let l=0;l<e.length/2;l++)s[o++]=e[l*2],s[o++]=e[l*2+1],s[o++]=t[l*2],s[o++]=t[l*2+1],a[o++]=r[l],s[o++]=n[l];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?Jl.triangulate(e,this):na[e.type].triangulate(e,this)}processLine(e){ru(e,this);for(let t=0;t<e.holes.length;t++)ru(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];na[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,t){for(let r=0;r<e.length/2;r++){const n=e[r*2],i=e[r*2+1];e[r*2]=t.a*n+t.c*i+t.tx,e[r*2+1]=t.b*n+t.d*i+t.ty}}addColors(e,t,r,n,i=0){const s=Wt.shared.setValue(t).toLittleEndianNumber(),a=Wt.shared.setValue(s).toPremultiplied(r);e.length=Math.max(e.length,i+n);for(let o=0;o<n;o++)e[i+o]=a}addTextureIds(e,t,r,n=0){e.length=Math.max(e.length,n+r);for(let i=0;i<r;i++)e[n+i]=t}addUvs(e,t,r,n,i,s=null){let a=0;const o=t.length,l=r.frame;for(;a<i;){let c=e[(n+a)*2],f=e[(n+a)*2+1];if(s){const u=s.a*c+s.c*f+s.tx;f=s.b*c+s.d*f+s.ty,c=u}a++,t.push(c/l.width,f/l.height)}const h=r.baseTexture;(l.width<h.width||l.height<h.height)&&this.adjustUvs(t,r,o,i)}adjustUvs(e,t,r,n){const i=t.baseTexture,s=1e-6,a=r+n*2,o=t.frame,l=o.width/i.width,h=o.height/i.height;let c=o.x/o.width,f=o.y/o.height,u=Math.floor(e[r]+s),d=Math.floor(e[r+1]+s);for(let p=r+2;p<a;p+=2)u=Math.min(u,Math.floor(e[p]+s)),d=Math.min(d,Math.floor(e[p+1]+s));c-=u,f-=d;for(let p=r;p<a;p+=2)e[p]=(e[p]+c)*l,e[p+1]=(e[p+1]+f)*h}};let su=iu;su.BATCHABLE_SIZE=100;class ci{constructor(){this.color=16777215,this.alpha=1,this.texture=bt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new ci;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=bt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ia extends ci{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=nr.BUTT,this.join=he.MITER,this.miterLimit=10}clone(){const t=new ia;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}}const sa={},fi=class extends rr{constructor(e=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 ci,this._lineStyle=new ia,this._matrix=null,this._holeMode=!1,this.state=Un.for2d(),this._geometry=e||new su,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Wt(16777215),this.blendMode=ut.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new fi(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,t=0,r,n=.5,i=!1){return typeof e=="number"&&(e={width:e,color:t,alpha:r,alignment:n,native:i}),this.lineTextureStyle(e)}lineTextureStyle(e){const t={width:0,texture:bt.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:nr.BUTT,join:he.MITER,miterLimit:10};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.width>0&&e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:r},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new tn,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new tn,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(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return(n!==e||i!==t)&&r.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,r,n){this._initCurve();const i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),ra.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),ea.curveTo(e,t,r,n,i,s,this.currentPath.points),this}arcTo(e,t,r,n,i){this._initCurve(e,t);const s=this.currentPath.points,a=tu.curveTo(e,t,r,n,i,s);if(a){const{cx:o,cy:l,radius:h,startAngle:c,endAngle:f,anticlockwise:u}=a;this.arc(o,l,h,c,f,u)}return this}arc(e,t,r,n,i,s=!1){if(n===i)return this;if(!s&&i<=n?i+=Gn:s&&n<=i&&(n+=Gn),i-n===0)return this;const o=e+Math.cos(n)*r,l=t+Math.sin(n)*r,h=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const f=Math.abs(c[c.length-2]-o),u=Math.abs(c[c.length-1]-l);f<h&&u<h||c.push(o,l)}else this.moveTo(o,l),c=this.currentPath.points;return tu.arc(o,l,e,t,r,n,i,s,c),this}beginFill(e=0,t){return this.beginTextureFill({texture:bt.WHITE,color:e,alpha:t})}normalizeColor(e){const t=Wt.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??(e.alpha=t.alpha)}beginTextureFill(e){const t={texture:bt.WHITE,color:16777215,matrix:null};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:r},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,r,n){return this.drawShape(new At(e,t,r,n))}drawRoundedRect(e,t,r,n,i){return this.drawShape(new Bs(e,t,r,n,i))}drawCircle(e,t,r){return this.drawShape(new Fs(e,t,r))}drawEllipse(e,t,r,n){return this.drawShape(new Zd(e,t,r,n))}drawPolygon(...e){let t,r=!0;const n=e[0];n.points?(r=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const i=new tn(t);return i.closeStroke=r,this.drawShape(i),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,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 e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===qt.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,r=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(e.points);for(let n=0;n<r;n++){const i=e.batches[n],s=i.style.color,a=new Float32Array(this.vertexData.buffer,i.attribStart*4*2,i.attribSize*2),o=new Float32Array(e.uvsFloat32.buffer,i.attribStart*4*2,i.attribSize*2),l=new Uint16Array(e.indicesUint16.buffer,i.start*2,i.size),h={vertexData:a,blendMode:t,indices:l,uvs:o,_batchRGB:Wt.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=h}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let t=0,r=this.batches.length;t<r;t++){const n=this.batches[t];n.worldAlpha=this.worldAlpha*n.alpha,e.plugins[this.pluginName].render(n)}}}_renderDirect(e){const t=this._resolveDirectShader(e),r=this._geometry,n=this.worldAlpha,i=t.uniforms,s=r.drawCalls;i.translationMatrix=this.transform.worldTransform,Wt.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),e.shader.bind(t),e.geometry.bind(r,t),e.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(e,r.drawCalls[a])}_renderDrawCallDirect(e,t){const{texArray:r,type:n,size:i,start:s}=t,a=r.count;for(let o=0;o<a;o++)e.texture.bind(r.elements[o],o);e.geometry.draw(n,i,s)}_resolveDirectShader(e){let t=this.shader;const r=this.pluginName;if(!t){if(!sa[r]){const{maxTextures:n}=e.plugins[r],i=new Int32Array(n);for(let o=0;o<n;o++)i[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ot,default:ae.from({uSamplers:i},!0)},a=e.plugins[r]._shader.program;sa[r]=new rn(a,s)}t=sa[r]}return t}_calculateBounds(){this.finishPoly();const e=this._geometry;if(!e.graphicsData.length)return;const{minX:t,minY:r,maxX:n,maxY:i}=e.bounds;this._bounds.addFrame(this.transform,t,r,n,i)}containsPoint(e){return this.worldTransform.applyInverse(e,fi._TEMP_POINT),this._geometry.containsPoint(fi._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t._tintRGB=Wt.shared.setValue(this._tintColor).multiply(t._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;const t=this.transform.worldTransform,r=t.a,n=t.b,i=t.c,s=t.d,a=t.tx,o=t.ty,l=this._geometry.points,h=this.vertexData;let c=0;for(let f=0;f<l.length;f+=2){const u=l[f],d=l[f+1];h[c++]=r*u+i*d+a,h[c++]=s*d+n*u+o}}closePath(){const e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){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(e)}};let Re=fi;Re.curves=Ir,Re._TEMP_POINT=new nt;const au={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},uy=Re;class hy extends uy{constructor(t,r,n={},i,s,a){super(),this.transformer=t;const o=Object.assign({},au,n);this._handle=r,this._style=o,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=a||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new nt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp}get handle(){return this._handle}set handle(t){this._handle=t,this._dirty=!0}get style(){return this._style}set style(t){this._style=Object.assign({},au,t),this._dirty=!0}render(t){this._dirty&&(this.draw(),this._dirty=!1),super.render(t)}draw(){const t=this._handle,r=this._style,n=r.radius;if(this.clear().lineStyle(r.outlineThickness,r.outlineColor).beginFill(r.color),r.shape==="square")this.drawRect(-n/2,-n/2,n,n);else if(r.shape==="tooth")switch(t){case"middleLeft":this.drawPolygon([-n/2,-n/2,-n/2,n/2,n/2,n/2,n*1.1,0,n/2,-n/2]);break;case"topCenter":this.drawPolygon([-n/2,-n/2,n/2,-n/2,n/2,n/2,0,n*1.1,-n/2,n/2]);break;case"middleRight":this.drawPolygon([-n/2,n/2,-n*1.1,0,-n/2,-n/2,n/2,-n/2,n/2,n/2]);break;case"bottomCenter":this.drawPolygon([0,-n*1.1,n/2,-n/2,n/2,n/2,-n/2,n/2,-n/2,-n/2]);break;case"rotator":this.drawCircle(0,0,n/Math.sqrt(2));break;default:this.drawRect(-n/2,-n/2,n,n);break}else this.drawCircle(0,0,n);this.endFill()}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){this._pointerDown&&(this._pointerDragging?this.onDrag(t):this.onDragStart(t),t.stopPropagation())}onPointerUp(t){this._pointerDragging&&this.onDragEnd(t),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(t){this._pointerPosition.copyFrom(t.data.global),this._pointerDragging=!0}onDrag(t){const r=t.data.global;this.onHandleDelta&&this.onHandleDelta(r),this._pointerPosition.copyFrom(r)}onDragEnd(t){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function di(e,t,r,n){const{x:i,y:s}=r,{x:a,y:o}=n;if(Math.abs(a-i)<.01)return Math.abs(e-i);if(Math.abs(o-s)<.01)return Math.abs(t-s);const l=(o-s)/(a-i);return Math.abs((l*e-t+(o-l*a))/Math.sqrt(l*l+1))}const ou=Zl.build(nt),cy=[new nt,new nt,new nt,new nt],fy=new Ot,Cr=new nt,dy=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],py=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],yy=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],vy=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],aa=new Array(12),my=[dy,py,yy,vy],gy=Re;class by extends gy{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new Re),this.addChild(new Re),this.addChild(new Re),this.addChild(new Re)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=ln.topCenter,this.boxScalingHandles[1].cursor=ln.middleRight,this.boxScalingHandles[2].cursor=ln.bottomCenter,this.boxScalingHandles[3].cursor=ln.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:a,boxScalingTolerance:o}=this.transformer,[l,h,c,f]=t.hull,{x:u,y:d}=r.applyInverse(n,Cr);if(a){const p=di(u,d,l,h)*r.d,v=di(u,d,l,f)*r.a,g=di(u,d,h,c)*r.a,y=di(u,d,f,c)*r.d,b=Math.min(p,v,g,y);if(b<o)switch(b){case p:return"topCenter";case v:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!t.contains(u,d)){const p=Math.sqrt((l.x-u)**2+(l.y-d)**2),v=Math.sqrt((h.x-u)**2+(h.y-d)**2),g=Math.sqrt((f.x-u)**2+(f.y-d)**2),y=Math.sqrt((c.x-u)**2+(c.y-d)**2),b=Math.min(p,v,g,y);if(b<s*1.45)switch(b){case p:return"boxRotateTopLeft";case v:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(t){const r=cy;for(let n=0;n<4;n++)this.transformer.projectToLocal(t.hull[n],r[n]);this.drawPolygon(r)}drawBoxScalingTolerance(t,r=this.transformer.boxScalingTolerance){t.innerBounds.pad(-r);const n=ou.allocateArray(4);n.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(2.5*r);const i=ou.allocateArray(4);i.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const a=n[s],o=n[(s+1)%4],l=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(a,l,h,o).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,a=fy.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let o=0;o<4;o++){const l=my[o];let h;switch(o){case 0:h=t;break;case 1:h=r;break;case 2:h=n;break;case 3:h=i;break}for(let c=0;c<l.length;c+=2){const f=l[c],u=l[c+1];Cr.set(f,u),a.apply(Cr,Cr),aa[c]=Cr.x+h.x,aa[c+1]=Cr.y+h.y}this.drawPolygon(aa.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const lu=new Ot;function uu(e){const t=lu.identity();return t.c=Math.tan(e),t}function hu(e){const t=lu.identity();return t.b=Math.tan(e),t}function cu(e,t,r,n=e.pivot){const i=t.a,s=t.b,a=t.c,o=t.d,l=-Math.atan2(-a,o),h=Math.atan2(s,i);return r=r??h,e.pivot.set(n.x,n.y),e.rotation=r,e.skew.x=r+l,e.skew.y=-r+h,e.scale.x=Math.sqrt(i*i+s*s),e.scale.y=Math.sqrt(a*a+o*o),e.position.x=t.tx+(n.x*t.a+n.y*t.c),e.position.y=t.ty+(n.x*t.b+n.y*t.d),e}const pi=new Ot,_y=new Ot;function xy(e,t,r){if(!r){const s=e.parent?e.parent:e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}const n=e.worldTransform,i=e.parent?_y.copyFrom(e.parent.worldTransform):Ot.IDENTITY;pi.copyFrom(n),pi.prepend(t),pi.prepend(i.invert()),cu(e.transform,pi)}const yi=new Hn,wy=[new nt,new nt,new nt,new nt],kr=new Ot,Pr=new nt,oa=new ai,Ey=new At,fu=[new nt,new nt,new nt,new nt],du=new nt,pu=new Ot,vi=Zl.build(nt),ln={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},mi=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],yu={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},Ty=[...mi,"rotator","skewHorizontal","skewVertical"],Ay=4,Sy=16,Oy=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],Ry=Math.PI/90,Iy=[Math.PI/4,-Math.PI/4],Ny=Math.PI/90,vu={color:0,thickness:2},Cy=rr;let ky=class re extends Cy{constructor(t={}){super(),re.prototype.__init.call(this),re.prototype.__init2.call(this),re.prototype.__init3.call(this),re.prototype.__init4.call(this),re.prototype.__init5.call(this),this.interactive=!0,this.cursors=Object.assign({default:"move"},t.cursors),this.cursor=this.cursors.default,this.boundingBoxes=t.boundingBoxes||"all",this.group=t.group||[],this.boxRotationTolerance=t.boxRotationTolerance||Sy,this.boxScalingTolerance=t.boxScalingTolerance||Ay,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new Ot,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||Oy,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:Ry,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||Iy,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:Ny,this.boxRotationEnabled=t.boxRotationEnabled===!0,this.boxScalingEnabled=t.boxScalingEnabled===!0,this._rotateEnabled=t.rotateEnabled!==!1,this._scaleEnabled=t.scaleEnabled!==!1,this._skewEnabled=t.skewEnabled===!0,this.translateEnabled=t.translateEnabled!==!1,this.transientGroupTilt=t.transientGroupTilt!==void 0?t.transientGroupTilt:!0,this.wireframe=this.addChild(new by(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},vu,t.wireframeStyle||{});const r=t.handleConstructor||hy,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,o=>{this.rotateGroup("rotator",o)},this.commitGroup))},s=mi.reduce((o,l)=>{const h=new r(this,l,n,null,this.commitGroup,ln[l]);return h.onHandleDelta=c=>{this.scaleGroup(h.handle,c)},h.visible=this._scaleEnabled,o[l]=h,this.addChild(o[l]),o},{}),a={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,o=>{this.skewGroup("skewHorizontal",o)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,o=>{this.skewGroup("skewVertical",o)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,a),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new nt,boxRotateTopLeft:new nt,boxRotateTopRight:new nt,boxRotateBottomLeft:new nt,boxRotateBottomRight:new nt,topLeft:new nt,topCenter:new nt,topRight:new nt,middleLeft:new nt,middleCenter:new nt,middleRight:new nt,bottomLeft:new nt,bottomCenter:new nt,bottomRight:new nt,skewHorizontal:new nt,skewVertical:new nt},this.groupBounds=new ai,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new nt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerupoutside",this.onPointerUp)}get enabledHandles(){return this._enabledHandles}set enabledHandles(t){!this._enabledHandles&&!t||(this._enabledHandles=t,Ty.forEach(r=>{this.handles[r].visible=!1}),t?t.forEach(r=>{this.handles[r].visible=!0}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,mi.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(t){const r=this.handles;for(const n in r)r[n].style=t;this._handleStyle=t}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(t){if(this._rotateEnabled!==t){if(this._rotateEnabled=t,this._enabledHandles)return;this.handles.rotator.visible=t}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(t){if(this._scaleEnabled!==t){if(this._scaleEnabled=t,this._enabledHandles)return;mi.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=t)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(t){if(this._skewEnabled!==t){if(this._skewEnabled=t,this._enabledHandles)return;this.handles.skewHorizontal.visible=t,this.handles.skewVertical.visible=t}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(t){this._wireframeStyle=Object.assign({},vu,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=kr.identity().translate(t.x,t.y);this.prependTransform(r)}}__init2(){this.rotateGroup=(t,r)=>{this._transformHandle=t,this._transformType="rotate";const n=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[t],Pr);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,du);const s=n.center,a=Math.atan2(i.y-s.y,i.x-s.x);let l=Math.atan2(r.y-s.y,r.x-s.x)-a,h=this.groupBounds.rotation+l;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),l=h-this.groupBounds.rotation;const c=kr.identity().translate(-s.x,-s.y).rotate(l).translate(s.x,s.y);this.prependTransform(c,!0),this.updateGroupBounds(h),this._skewX+=l,this._skewY+=l}}__init3(){this.scaleGroup=(t,r)=>{this._transformHandle=t,this._transformType="scale";const n=yu[t].x,i=yu[t].y,s=this.handles,a=this.groupBounds,o=a.rotation,l=a.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],Pr);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,du);const c=r.x-h.x,f=r.y-h.y,u=(a.topRight.x-a.topLeft.x)/l.width,d=(a.topRight.y-a.topLeft.y)/l.width,p=(a.bottomLeft.x-a.topLeft.x)/l.height,v=(a.bottomLeft.y-a.topLeft.y)/l.height,g=c*u+f*d,y=c*p+f*v;let b=1+g*n/l.width,_=1+y*i/l.height;this.lockAspectRatio&&(t==="topLeft"||t==="topRight"||t==="bottomLeft"||t==="bottomRight")&&(b>_?_=b:b=_);const x=kr.identity();if(n!==0&&b!==0){const S=this.centeredScaling?a.center:n===1?a.topLeft:a.topRight;x.translate(-S.x,-S.y).rotate(-o).scale(b,1).rotate(o).translate(S.x,S.y)}if(i!==0&&_!==0){const S=this.centeredScaling?a.center:i===1?a.topLeft:a.bottomLeft;x.translate(-S.x,-S.y).rotate(-o).scale(1,_).rotate(o).translate(S.x,S.y)}if((_<0||b<0)&&!(_<0&&b<0))switch(t){case"topLeft":case"bottomLeft":this.swapHandles(s.topLeft,s.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(s.topCenter,s.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(s.topRight,s.bottomRight);break}this.prependTransform(x)}}__init4(){this.skewGroup=(t,r)=>{this._transformHandle=t,this._transformType="skew";const n=this.groupBounds,i=Pr.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,a=kr.identity().translate(-s.x,-s.y);let o=this.groupBounds.rotation;if(t==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-s.y,i.x-s.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),a.prepend(hu(-l)),a.prepend(hu(this._skewX))}else{const l=this._skewY,h=Math.atan2(i.y-s.y,i.x-s.x)-Math.PI/2;this._skewY=h,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),a.prepend(uu(l)),a.prepend(uu(-this._skewY)),o-=this._skewY-l}a.translate(s.x,s.y),this.prependTransform(a,!0),this.updateGroupBounds(o)}}__init5(){this.commitGroup=()=>{this._transformHandle=null,this._transformType="none",this.transientGroupTilt!==!1&&this.group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit")}}render(t){this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw(),super.render(t)}draw(){const t=this.group,{color:r,thickness:n}=this._wireframeStyle;this.wireframe.clear(),this.boundingBoxes!=="none"&&this.wireframe.lineStyle(n,r),this.translateEnabled&&this.wireframe.beginFill(16777215,1e-4);for(let s=0,a=t.length;s<a&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(re.calculateOrientedBounds(t[s],oa));const i=t.length!==1?re.calculateGroupOrientedBounds(t,this.groupBounds.rotation,oa,!0):re.calculateOrientedBounds(t[0],oa);this.wireframe.drawBounds(i),this.drawHandles(i),this.groupBounds.copyFrom(i),this.boxRotationEnabled&&(this.wireframe.closePath().beginFill(16777215,1e-4).lineStyle(),this.wireframe.drawBoxRotationTolerance()),this.boxScalingEnabled&&(this.wireframe.closePath().beginFill(16773375,1e-4).lineStyle(),this.wireframe.drawBoxScalingTolerance(i)),this.lazyDirty=!1}drawHandles(t){const r=this.handles,n=this.handleAnchors,{topLeft:i,topRight:s,bottomLeft:a,bottomRight:o,center:l}=t,[h,c,f,u]=fu,d=Pr;if(this.projectToLocal(i,h),this.projectToLocal(s,c),this.projectToLocal(a,f),this.projectToLocal(o,u),this.projectToLocal(l,d),n.topLeft.copyFrom(h),n.topCenter.set((h.x+c.x)/2,(h.y+c.y)/2),n.topRight.copyFrom(c),n.middleLeft.set((h.x+f.x)/2,(h.y+f.y)/2),n.middleCenter.set((h.x+u.x)/2,(h.y+u.y)/2),n.middleRight.set((c.x+u.x)/2,(c.y+u.y)/2),n.bottomLeft.copyFrom(f),n.bottomCenter.set((f.x+u.x)/2,(f.y+u.y)/2),n.bottomRight.copyFrom(u),this.boxRotationEnabled&&(n.boxRotateTopLeft.copyFrom(n.topLeft),n.boxRotateTopRight.copyFrom(n.topRight),n.boxRotateBottomLeft.copyFrom(n.bottomLeft),n.boxRotateBottomRight.copyFrom(n.bottomRight)),this._rotateEnabled){const p=(h.x+c.x)/2,v=(h.y+c.y)/2;let g=-(h.y-c.y),y=h.x-c.x;const b=Math.sqrt(g*g+y*y);g*=32/b,y*=32/b,r.rotator.position.x=p+g,r.rotator.position.y=v+y,this.wireframe.moveTo(p,v).lineTo(r.rotator.position.x,r.rotator.position.y),this.handleAnchors.rotator.copyFrom(r.rotator.position)}if(this._skewEnabled){const p=d.x,v=d.y;this.worldTransform.apply(d,d),n.skewHorizontal.set(d.x+Math.cos(this._skewX)*this.skewRadius,d.y+Math.sin(this._skewX)*this.skewRadius),n.skewVertical.set(d.x+-Math.sin(this._skewY)*this.skewRadius,d.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(n.skewHorizontal,n.skewHorizontal),this.worldTransform.applyInverse(n.skewVertical,n.skewVertical),d.set(p,v),this.wireframe.beginFill(this.wireframeStyle.color).drawCircle(d.x,d.y,this.wireframeStyle.thickness*2).endFill(),this.wireframe.moveTo(d.x,d.y).lineTo(r.skewHorizontal.x,r.skewHorizontal.y).moveTo(d.x,d.y).lineTo(r.skewVertical.x,r.skewVertical.y)}for(const p in r){let v=this.groupBounds.rotation;p==="skewHorizontal"?v=this._skewX:p==="skewVertical"&&(v=this._skewY);const g=r[p];g.rotation=v,g.position.copyFrom(n[p]),g.getBounds(!1,Ey)}}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){const r=this._pointerPosition,n=vi.allocate().copyFrom(t.data.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const s=n.x,a=n.y;if(this._pointerDragging)switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,n);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,n);break;default:if(this.translateEnabled){const[o,l,h]=fu;o.set(0,0),l.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(o,o),this.projectionTransform.applyInverse(l,l),h.set(l.x-o.x,l.y-o.y),this.translateGroup(h)}}else this._transformHandle=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n),this.setCursorFromHoveredHandle(i);this._pointerPosition.x=s,this._pointerPosition.y=a,this._pointerDragging=!0,t.stopPropagation()}vi.release(n)}onPointerUp(t){this._pointerDragging=!1,this._pointerDown=!1,this.commitGroup(),t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}prependTransform(t,r=!1){const n=this.group;for(let i=0,s=n.length;i<s;i++)xy(n[i],t,!1);pu.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",pu)}updateGroupBounds(t=this.groupBounds.rotation){re.calculateGroupOrientedBounds(this.group,t,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(t,r,n){if(t=t%(Math.PI*2),!n||n.length===1||!r)return t;for(let i=0,s=n.length;i<s;i++)if(Math.abs(t-n[i])<=r)return n[i];return t}swapHandles(t,r){const n=t.handle,i=r.handle,s=t.cursor,a=r.cursor,o=t.x,l=r.x,h=t.y,c=r.y;t.handle=i,r.handle=n,t.position.set(l,c),r.position.set(o,h),t.cursor=a,r.cursor=s,this.handles[n]=r,this.handles[i]=t,this._transformHandle===n?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=n)}setCursorFromHoveredHandle(t){if(t&&t.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(t)switch(t){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(t,r){return r||(r=new nt),this.projectionTransform.apply(t,r),this.worldTransform.applyInverse(r,r),r}static calculateTransformedCorners(t,r=t.worldTransform,n,i=0){const s=t.getLocalBounds();return t.getBounds(),n=n||[new nt,new nt,new nt,new nt],n[i].set(s.x,s.y),n[i+1].set(s.x+s.width,s.y),n[i+2].set(s.x+s.width,s.y+s.height),n[i+3].set(s.x,s.y+s.height),r.apply(n[i],n[i]),r.apply(n[i+1],n[i+1]),r.apply(n[i+2],n[i+2]),r.apply(n[i+3],n[i+3]),n}static calculateOrientedBounds(t,r){const n=t.parent?t.parent:t.enableTempParent();t.updateTransform(),t.disableTempParent(n),cu(yi,t.worldTransform),yi.updateLocalTransform();const i=yi.rotation,s=re.calculateTransformedCorners(t,t.worldTransform,wy),a=(s[0].x+s[1].x+s[2].x+s[3].x)/4,o=(s[0].y+s[1].y+s[2].y+s[3].y)/4,l=kr.identity().translate(-a,-o).rotate(-yi.rotation).translate(a,o);return l.apply(s[0],s[0]),l.apply(s[1],s[1]),l.apply(s[2],s[2]),l.apply(s[3],s[3]),r=r||new ai,r.rotation=i,r.innerBounds.x=Math.min(s[0].x,s[1].x,s[2].x,s[3].x),r.innerBounds.y=Math.min(s[0].y,s[1].y,s[2].y,s[3].y),r.innerBounds.width=Math.max(s[0].x,s[1].x,s[2].x,s[3].x)-r.innerBounds.x,r.innerBounds.height=Math.max(s[0].y,s[1].y,s[2].y,s[3].y)-r.innerBounds.y,r}static calculateGroupOrientedBounds(t,r,n,i=!1){const s=t.length,a=vi.allocateArray(s*4);for(let u=0;u<s;u++){const d=t[u];if(!i){const p=d.parent?d.parent:d.enableTempParent();d.updateTransform(),d.disableTempParent(p)}re.calculateTransformedCorners(d,d.worldTransform,a,u*4)}const o=kr.identity().rotate(-r);let l=Number.MAX_VALUE,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let u=0,d=a.length;u<d;u++){const p=a[u];o.apply(p,p);const v=p.x,g=p.y;l=v<l?v:l,h=g<h?g:h,c=v>c?v:c,f=g>f?g:f}return vi.releaseArray(a),n=n||new ai,n.innerBounds.x=l,n.innerBounds.y=h,n.innerBounds.width=c-l,n.innerBounds.height=f-h,n.rotation=r,o.applyInverse(n.center,Pr),n.center.copyFrom(Pr),n}};function Py(e,t,r,n){for(const i in t){const s=r[i],a=n[i],o=t[i];s!==a&&(s&&e.off(o,s),a&&e.on(o,a))}}const gi={},My=Ot.IDENTITY,Ly={transformchange:"transformchange",transformcommit:"transformcommit"},Fy=yt.PixiComponent("Transformer",{create:e=>new ky(e),applyProps(e,t,r){if(yt.applyDefaultProps(e,t,r),Py(e,Ly,t,r),r.cursors&&Object.assign(e.cursors,r.cursors),e.group=r.group||[],e.boundingBoxes=r.boundingBoxes||"all",e.boxScalingEnabled=r.boxScalingEnabled===!0,e.boxScalingTolerance=r.boxScalingTolerance!==void 0?r.boxScalingTolerance:e.boxScalingTolerance,e.boxRotationEnabled=r.boxRotationEnabled===!0,e.boxRotationTolerance=r.boxRotationTolerance!==void 0?r.boxRotationTolerance:e.boxRotationTolerance,e.centeredScaling=r.centeredScaling,e.enabledHandles=r.enabledHandles,e.lockAspectRatio=r.lockAspectRatio,e.projectionTransform.copyFrom(r.projectionTransform||My),e.skewRadius=r.skewRadius||e.skewRadius,e.rotateEnabled=r.rotateEnabled!==!1,e.scaleEnabled=r.scaleEnabled!==!1,e.skewEnabled=r.skewEnabled===!0,e.translateEnabled=r.translateEnabled!==!1,e.transientGroupTilt=r.transientGroupTilt,t.handleConstructor!==r.handleConstructor)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");t.rotationSnaps!==r.rotationSnaps&&(e.rotationSnaps=r.rotationSnaps),t.rotationSnapTolerance!==r.rotationSnapTolerance&&(e.rotationSnapTolerance=r.rotationSnapTolerance),t.skewSnaps!==r.skewSnaps&&(e.skewSnaps=r.skewSnaps),t.skewSnapTolerance!==r.skewSnapTolerance&&(e.skewSnapTolerance=r.skewSnapTolerance);const n=t.handleStyle||gi,i=r.handleStyle||gi;(n.color!==i.color||n.outlineColor!==i.outlineColor||n.outlineThickness!==i.outlineThickness||n.radius!==i.radius||n.shape!==i.shape)&&(e.handleStyle=i);const s=t.wireframeStyle||gi,a=r.wireframeStyle||gi;(s.color!==a.color||s.thickness!==a.thickness)&&(e.wireframeStyle=a)}}),la=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o=""})=>{console.log("transformer props",{pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o});const l=ne.utils.string2hex("#F3C409"),h=ne.utils.string2hex("#F3C409"),c=lt.useRef({isDragging:!1}),f=lt.useCallback(()=>{s&&!c.current.isDragging&&s(!0)},[s]),u=lt.useCallback(()=>{s&&!c.current.isDragging&&s(!1)},[s]),d=lt.useCallback(()=>{c.current.isDragging=!0},[]),p=lt.useCallback(()=>{c.current.isDragging=!1},[]),v=lt.useCallback(y=>{c.current.isDragging=!0,i&&i(y)},[i]),g=lt.useCallback(()=>{if(t.current===null)return;const y=t.current.x,b=t.current.y,_=t.current.width,m=t.current.height,x=t.current.rotation,S=[t.current.scale.x,t.current.scale.y];n&&n({uniqueId:o,transformation:{x:Math.round(y),y:Math.round(b),width:Math.round(Math.max(5,_)),height:Math.round(Math.max(5,m)),rotate:Math.round(x),scale:S}}),c.current.isDragging=!1},[n]);return lt.useEffect(()=>(e.current&&(e.current.on("mouseover",f),e.current.on("mouseout",u),e.current.on("mousedown",d),e.current.on("mouseup",p)),()=>{e.current&&(e.current.off("mouseover",f),e.current.off("mouseout",u),e.current.off("mousedown",d),e.current.off("mouseup",p))}),[]),ft.jsx(Fy,{ref:e,group:r?[t.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:h},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:l,shape:"circle",radius:9},transformchange:v,transformcommit:g})};var bi={};Object.defineProperty(bi,"__esModule",{value:!0});var By=J,ua;function mu(){return ua||(ua=document.createElement("div")),ua}function Dy(e,t,r){var n;return By.useEffect(function(){n=n||mu();var i=function(s){var a=s.detail;t(a)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function Uy(e,t){var r=mu(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function jy(){var e;function t(r){e=r}return t.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});e==null||e.dispatchEvent(i)},t}var gu=bi.emitCustomEvent=Uy;bi.newCustomEventEmitter=jy;var un=bi.useCustomEventListener=Dy;const Mr=lt.createContext({}),je={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},Gy=({children:e})=>{const[t,r]=J.useState(!1),[n,i]=J.useState(!1),s=J.useRef(),a=J.useRef(),o=J.useRef(.001);J.useLayoutEffect(()=>(a.current=ye.context(()=>{s.current&&s.current.progress(0).kill(),s.current=ye.timeline({paused:!0,defaults:{duration:0}})}),()=>a.current.revert()),[]);const l=J.useCallback(()=>{let b=s.current.time();o.current=b},[]);J.useEffect(()=>{const y=s.current;y.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){y.pause(),l()}).eventCallback("onUpdate",function(){l()}).eventCallback("onPause",function(){console.log("onPause",y.progress()),l()}).eventCallback("onResume",function(){console.log("onResume",y.progress()),l()}).eventCallback("onComplete",function(){y.seek(0),y.pause(),l()})},[]);const h=J.useCallback(()=>{s.current.revert()},[]),c=J.useCallback(()=>{s.current.restart(),r(!0)},[]),f=J.useCallback(()=>{const y=s.current;y.repeat(1),y.restart()},[]),u=J.useCallback(y=>{s.current.seek(y)},[]),d=J.useCallback(()=>{s.current.seek(4)},[]),p=J.useCallback(()=>{const y=s.current;return y?y.totalDuration():0},[]),v=()=>{s.current.pause(),gu(je.PAUSE),r(!1)},g=()=>{const y=s.current;r(!0),y.resume(),gu(je.RESUME)};return un(je.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),un(je.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),ft.jsx(Mr.Provider,{value:{gsapCtx:a,tl:s,handlePlay:g,handlePause:v,handleReset:h,handleSeek:u,handleSeekTest:d,handleRestart:c,handleRepeat:f,playerTimeRef:o,isDragging:n,getTimelineDuration:p},children:e})},ha=e=>{let t={};switch(e){case"NONE":case"none":break;case"BOUNCE_IN":t.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":t.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":t.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":t.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":t.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":t.from={ease:"bounce.in",y:2,duration:2};break;case"BOUNCE_OUT_DOWN":break;case"BOUNCE_OUT_LEFT":break;case"BOUNCE_OUT_RIGHT":break;case"BOUNCE_OUT_UP":break;case"FADE_IN":t.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":t.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":t.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":t.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":t.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break}return t};var $y=Object.prototype;function qy(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$y;return e===r}var bu=qy;function Hy(e,t){return function(r){return e(t(r))}}var zy=Hy,Vy=zy,Xy=Vy(Object.keys,Object),Wy=Xy,Yy=bu,Ky=Wy,Zy=Object.prototype,Qy=Zy.hasOwnProperty;function Jy(e){if(!Yy(e))return Ky(e);var t=[];for(var r in Object(e))Qy.call(e,r)&&r!="constructor"&&t.push(r);return t}var _u=Jy,tv=typeof ke=="object"&&ke&&ke.Object===Object&&ke,xu=tv,ev=xu,rv=typeof self=="object"&&self&&self.Object===Object&&self,nv=ev||rv||Function("return this")(),Ie=nv,iv=Ie,sv=iv.Symbol,_i=sv,wu=_i,Eu=Object.prototype,av=Eu.hasOwnProperty,ov=Eu.toString,hn=wu?wu.toStringTag:void 0;function lv(e){var t=av.call(e,hn),r=e[hn];try{e[hn]=void 0;var n=!0}catch{}var i=ov.call(e);return n&&(t?e[hn]=r:delete e[hn]),i}var uv=lv,hv=Object.prototype,cv=hv.toString;function fv(e){return cv.call(e)}var dv=fv,Tu=_i,pv=uv,yv=dv,vv="[object Null]",mv="[object Undefined]",Au=Tu?Tu.toStringTag:void 0;function gv(e){return e==null?e===void 0?mv:vv:Au&&Au in Object(e)?pv(e):yv(e)}var cn=gv;function bv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ca=bv,_v=cn,xv=ca,wv="[object AsyncFunction]",Ev="[object Function]",Tv="[object GeneratorFunction]",Av="[object Proxy]";function Sv(e){if(!xv(e))return!1;var t=_v(e);return t==Ev||t==Tv||t==wv||t==Av}var Su=Sv,Ov=Ie,Rv=Ov["__core-js_shared__"],Iv=Rv,fa=Iv,Ou=function(){var e=/[^.]+$/.exec(fa&&fa.keys&&fa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Nv(e){return!!Ou&&Ou in e}var Cv=Nv,kv=Function.prototype,Pv=kv.toString;function Mv(e){if(e!=null){try{return Pv.call(e)}catch{}try{return e+""}catch{}}return""}var Ru=Mv,Lv=Su,Fv=Cv,Bv=ca,Dv=Ru,Uv=/[\\^$.*+?()[\]{}|]/g,jv=/^\[object .+?Constructor\]$/,Gv=Function.prototype,$v=Object.prototype,qv=Gv.toString,Hv=$v.hasOwnProperty,zv=RegExp("^"+qv.call(Hv).replace(Uv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vv(e){if(!Bv(e)||Fv(e))return!1;var t=Lv(e)?zv:jv;return t.test(Dv(e))}var Xv=Vv;function Wv(e,t){return e==null?void 0:e[t]}var Yv=Wv,Kv=Xv,Zv=Yv;function Qv(e,t){var r=Zv(e,t);return Kv(r)?r:void 0}var Lr=Qv,Jv=Lr,tm=Ie,em=Jv(tm,"DataView"),rm=em,nm=Lr,im=Ie,sm=nm(im,"Map"),da=sm,am=Lr,om=Ie,lm=am(om,"Promise"),um=lm,hm=Lr,cm=Ie,fm=hm(cm,"Set"),dm=fm,pm=Lr,ym=Ie,vm=pm(ym,"WeakMap"),mm=vm,pa=rm,ya=da,va=um,ma=dm,ga=mm,Iu=cn,Fr=Ru,Nu="[object Map]",gm="[object Object]",Cu="[object Promise]",ku="[object Set]",Pu="[object WeakMap]",Mu="[object DataView]",bm=Fr(pa),_m=Fr(ya),xm=Fr(va),wm=Fr(ma),Em=Fr(ga),sr=Iu;(pa&&sr(new pa(new ArrayBuffer(1)))!=Mu||ya&&sr(new ya)!=Nu||va&&sr(va.resolve())!=Cu||ma&&sr(new ma)!=ku||ga&&sr(new ga)!=Pu)&&(sr=function(e){var t=Iu(e),r=t==gm?e.constructor:void 0,n=r?Fr(r):"";if(n)switch(n){case bm:return Mu;case _m:return Nu;case xm:return Cu;case wm:return ku;case Em:return Pu}return t});var Lu=sr;function Tm(e){return e!=null&&typeof e=="object"}var fn=Tm,Am=cn,Sm=fn,Om="[object Arguments]";function Rm(e){return Sm(e)&&Am(e)==Om}var Im=Rm,Fu=Im,Nm=fn,Bu=Object.prototype,Cm=Bu.hasOwnProperty,km=Bu.propertyIsEnumerable,Pm=Fu(function(){return arguments}())?Fu:function(e){return Nm(e)&&Cm.call(e,"callee")&&!km.call(e,"callee")},ba=Pm,Mm=Array.isArray,xe=Mm,Lm=9007199254740991;function Fm(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Lm}var _a=Fm,Bm=Su,Dm=_a;function Um(e){return e!=null&&Dm(e.length)&&!Bm(e)}var xi=Um,wi={exports:{}};function jm(){return!1}var Gm=jm;wi.exports,function(e,t){var r=Ie,n=Gm,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?r.Buffer:void 0,l=o?o.isBuffer:void 0,h=l||n;e.exports=h}(wi,wi.exports);var xa=wi.exports,$m=cn,qm=_a,Hm=fn,zm="[object Arguments]",Vm="[object Array]",Xm="[object Boolean]",Wm="[object Date]",Ym="[object Error]",Km="[object Function]",Zm="[object Map]",Qm="[object Number]",Jm="[object Object]",tg="[object RegExp]",eg="[object Set]",rg="[object String]",ng="[object WeakMap]",ig="[object ArrayBuffer]",sg="[object DataView]",ag="[object Float32Array]",og="[object Float64Array]",lg="[object Int8Array]",ug="[object Int16Array]",hg="[object Int32Array]",cg="[object Uint8Array]",fg="[object Uint8ClampedArray]",dg="[object Uint16Array]",pg="[object Uint32Array]",Rt={};Rt[ag]=Rt[og]=Rt[lg]=Rt[ug]=Rt[hg]=Rt[cg]=Rt[fg]=Rt[dg]=Rt[pg]=!0,Rt[zm]=Rt[Vm]=Rt[ig]=Rt[Xm]=Rt[sg]=Rt[Wm]=Rt[Ym]=Rt[Km]=Rt[Zm]=Rt[Qm]=Rt[Jm]=Rt[tg]=Rt[eg]=Rt[rg]=Rt[ng]=!1;function yg(e){return Hm(e)&&qm(e.length)&&!!Rt[$m(e)]}var vg=yg;function mg(e){return function(t){return e(t)}}var gg=mg,Ei={exports:{}};Ei.exports,function(e,t){var r=xu,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,a=s&&r.process,o=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o}(Ei,Ei.exports);var bg=Ei.exports,_g=vg,xg=gg,Du=bg,Uu=Du&&Du.isTypedArray,wg=Uu?xg(Uu):_g,wa=wg,Eg=_u,Tg=Lu,Ag=ba,Sg=xe,Og=xi,Rg=xa,Ig=bu,Ng=wa,Cg="[object Map]",kg="[object Set]",Pg=Object.prototype,Mg=Pg.hasOwnProperty;function Lg(e){if(e==null)return!0;if(Og(e)&&(Sg(e)||typeof e=="string"||typeof e.splice=="function"||Rg(e)||Ng(e)||Ag(e)))return!e.length;var t=Tg(e);if(t==Cg||t==kg)return!e.size;if(Ig(e))return!Eg(e).length;for(var r in e)if(Mg.call(e,r))return!1;return!0}var Fg=Lg;const ee=or(Fg),Bg=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Ea=e=>{const[t,r]=lt.useState(!1),[,n]=J.useState(!1),[,i]=J.useState(!1),s=J.useRef(null),a=J.useRef(null),o=J.useRef(null),l=J.useRef(null),{tl:h}=J.useContext(Mr),{uniqueId:c,startAt:f,endAt:u,initialAlpha:d,transformation:{x:p,y:v,width:g,height:y,colorCorrection:b,animation:_,effect:m},applyTransformer:x}=e;console.log("all abstract props",e);const{contrast:S=1,saturation:w=1,brightness:T=1,alpha:N=1,blurRadius:A=0}=b||{},E={...T>1&&{brightness:T},...S>1&&{contrast:S},...w>1&&{saturation:w},...N!==0&&{alpha:N}};lt.useEffect(()=>{s.current&&r(!0)},[]),lt.useEffect(()=>{let U=ye.context(()=>{});if(s.current&&h.current){const D={duration:Number(u)-Number(f)},z=ha(_||"None");U=ye.context(()=>{var j,k;ee(z.from)?ee(z.to)?ee(z.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.1},Number(u)-.1):h.current.fromTo(s.current,(j=z.fromTo)==null?void 0:j.from,(k=z.fromTo)==null?void 0:k.to,f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2):h.current.to(s.current,{alpha:1,duration:.2,...z.to},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2):h.current.from(s.current,{...z.from},f).to(o.current,{alpha:1,duration:.2},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2)})}return()=>U.revert()},[_,f,u]);const O=lt.useCallback(()=>{n(!0)},[]),R=lt.useCallback(U=>{console.log("changeEnd",U),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(U))},[]),C=yt.withFilters(yt.Container,{...A>0&&{blur:ne.filters.BlurFilter},...!ee(E)&&{adjust:Zs},matrix:ne.filters.ColorMatrixFilter}),F=(b==null?void 0:b.enabled)||m&&m!==er.Normal;return ft.jsxs(yt.Container,{ref:a,children:[ft.jsxs(yt.Container,{ref:s,alpha:d,position:[p,v],pivot:[p,v],width:g,height:y,children:[F&&ft.jsx(C,{scale:1,blur:{blur:A,quality:4},adjust:E,apply:({matrix:U})=>{m===er.BlackAndWhite?U.desaturate():m===er.Sepia?U.sepia():m===er.RetroVintage||m===er.NightVision?U.negative():m===er.Normal&&U.reset()},matrix:{enabled:!0,matrix:Bg},children:ft.jsx(yt.Container,{ref:o,children:e.children})}),!F&&ft.jsx(yt.Container,{ref:o,children:e.children})]}),x&&ft.jsx(la,{pixiTransformerRef:l,imageRef:s,isMounted:t,transformCommit:R,transformChange:O,mouseoverEvent:i,uniqueId:c})]})},Dg=e=>{const t=J.useRef(null),r=J.useRef(null),{src:n,transformation:{x:i,y:s,width:a,height:o,anchor:l},pointerdown:h,pointerup:c,mousedown:f,mouseup:u,pointerover:d,mouseover:p,mouseout:v}=e;return ft.jsx(Ea,{...e,children:ft.jsx(yt.Container,{ref:r,children:ft.jsx(yt.Sprite,{image:n,width:a,height:o,anchor:l,ref:t,x:i,y:s,interactive:!0,pointerdown:h,pointerup:c,pointerover:d,mousedown:f,mouseup:u,mouseover:p,mouseout:v})})})};var Ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ta={},jg={get exports(){return Ta},set exports(e){Ta=e}};/*!
844
540
  * d-path-parser - v1.0.0
845
541
  * by Massimo Artizzu (MaxArt2501)
846
542
  *
@@ -848,47 +544,47 @@ void main(void)
848
544
  *
849
545
  * Licensed under the MIT License
850
546
  * See LICENSE for details
851
- */(function(e,t){(function(r,n){e.exports=n()})(bC,function(){return function(n){for(var i={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(v){return+m("number",v)},"coordinate pair":function(v){var b=m("number",v);if(b===null&&!v)return null;m("comma");var _=m("number",!0);return{x:+b,y:+_}},"arc definition":function(v){var b=s["coordinate pair"](v);if(!b&&!v)return null;m("comma");var _=+m("number",!0);m("comma",!0);var w=!!+m("flag",!0);m("comma");var S=!!+m("flag",!0);m("comma");var x=s["coordinate pair"](!0);return{radii:b,rotation:_,large:w,clockwise:S,end:x}}},a=0,o=[];a<n.length;){var c=m("command"),h=c.toUpperCase(),d=c!==h,p;switch(h){case"M":p=g("coordinate pair").map(function(v,b){return b===1&&(c=d?"l":"L"),f({end:v})});break;case"L":case"T":p=g("coordinate pair").map(function(v){return f({end:v})});break;case"C":if(p=g("coordinate pair"),p.length%3)throw Error("Expected coordinate pair triplet at position "+a);p=p.reduce(function(v,b,_){var w=_%3;if(!w)v.push(f({cp1:b}));else{var S=v[v.length-1];S[w===1?"cp2":"end"]=b}return v},[]);break;case"Q":case"S":if(p=g("coordinate pair"),p.length&1)throw Error("Expected coordinate pair couple at position "+a);p=p.reduce(function(v,b,_){var w=_&1;if(!w)v.push(f({cp:b}));else{var S=v[v.length-1];S.end=b}return v},[]);break;case"H":case"V":p=g("number").map(function(v){return f({value:v})});break;case"A":p=g("arc definition").map(f);break;case"Z":p=[{code:"Z"}];break}o.push.apply(o,p)}return o;function f(v){return v.code=c,v.relative=d,v}function m(v,b){i[v].lastIndex=a;var _=i[v].exec(n);if(!_||_.index!==a){if(!b)return null;throw Error("Expected "+v+" at position "+a)}return a=i[v].lastIndex,_[1]}function g(v){for(var b=[],_,w=!0;_=s[v](w);)b.push(_),w=!!m("comma");return b}}})})(xC);const wC=/^\s+/,SC=/\s+$/;function kt(e,t){if(e=e||"",t=t||{},e instanceof kt)return e;if(!(this instanceof kt))return new kt(e,t);var r=TC(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}kt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,r,n,i,s,a;return t=e.r/255,r=e.g/255,n=e.b/255,t<=.03928?i=t/12.92:i=Math.pow((t+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*s+.0722*a},setAlpha:function(e){return this._a=gy(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=fy(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=fy(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=hy(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=hy(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return dy(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return OC(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ue(this._r,255)*100)+"%",g:Math.round(ue(this._g,255)*100)+"%",b:Math.round(ue(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ue(this._r,255)*100)+"%, "+Math.round(ue(this._g,255)*100)+"%, "+Math.round(ue(this._b,255)*100)+"%)":"rgba("+Math.round(ue(this._r,255)*100)+"%, "+Math.round(ue(this._g,255)*100)+"%, "+Math.round(ue(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:jC[dy(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+py(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=kt(e);r="#"+py(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return kt(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(RC,arguments)},brighten:function(){return this._applyModification(NC,arguments)},darken:function(){return this._applyModification(MC,arguments)},desaturate:function(){return this._applyModification(PC,arguments)},saturate:function(){return this._applyModification(IC,arguments)},greyscale:function(){return this._applyModification(kC,arguments)},spin:function(){return this._applyModification(LC,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(DC,arguments)},complement:function(){return this._applyCombination(BC,arguments)},monochromatic:function(){return this._applyCombination(UC,arguments)},splitcomplement:function(){return this._applyCombination(FC,arguments)},triad:function(){return this._applyCombination(my,[3])},tetrad:function(){return this._applyCombination(my,[4])}},kt.fromRatio=function(e,t){if(typeof e=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=ga(e[n]));e=r}return kt(e,t)};function TC(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,a=!1,o=!1;return typeof e=="string"&&(e=GC(e)),typeof e=="object"&&(Cn(e.r)&&Cn(e.g)&&Cn(e.b)?(t=EC(e.r,e.g,e.b),a=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Cn(e.h)&&Cn(e.s)&&Cn(e.v)?(n=ga(e.s),i=ga(e.v),t=CC(e.h,n,i),a=!0,o="hsv"):Cn(e.h)&&Cn(e.s)&&Cn(e.l)&&(n=ga(e.s),s=ga(e.l),t=AC(e.h,n,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=gy(r),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function EC(e,t,r){return{r:ue(e,255)*255,g:ue(t,255)*255,b:ue(r,255)*255}}function hy(e,t,r){e=ue(e,255),t=ue(t,255),r=ue(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=(n+i)/2;if(n==i)s=a=0;else{var c=n-i;switch(a=o>.5?c/(2-n-i):c/(n+i),n){case e:s=(t-r)/c+(t<r?6:0);break;case t:s=(r-e)/c+2;break;case r:s=(e-t)/c+4;break}s/=6}return{h:s,s:a,l:o}}function AC(e,t,r){var n,i,s;e=ue(e,360),t=ue(t,100),r=ue(r,100);function a(h,d,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?h+(d-h)*6*p:p<1/2?d:p<2/3?h+(d-h)*(2/3-p)*6:h}if(t===0)n=i=s=r;else{var o=r<.5?r*(1+t):r+t-r*t,c=2*r-o;n=a(c,o,e+1/3),i=a(c,o,e),s=a(c,o,e-1/3)}return{r:n*255,g:i*255,b:s*255}}function fy(e,t,r){e=ue(e,255),t=ue(t,255),r=ue(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=n,c=n-i;if(a=n===0?0:c/n,n==i)s=0;else{switch(n){case e:s=(t-r)/c+(t<r?6:0);break;case t:s=(r-e)/c+2;break;case r:s=(e-t)/c+4;break}s/=6}return{h:s,s:a,v:o}}function CC(e,t,r){e=ue(e,360)*6,t=ue(t,100),r=ue(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),a=r*(1-i*t),o=r*(1-(1-i)*t),c=n%6,h=[r,a,s,s,o,r][c],d=[o,r,r,a,s,s][c],p=[s,s,o,r,r,a][c];return{r:h*255,g:d*255,b:p*255}}function dy(e,t,r,n){var i=[Ur(Math.round(e).toString(16)),Ur(Math.round(t).toString(16)),Ur(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function OC(e,t,r,n,i){var s=[Ur(Math.round(e).toString(16)),Ur(Math.round(t).toString(16)),Ur(Math.round(r).toString(16)),Ur(yy(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function py(e,t,r,n){var i=[Ur(yy(n)),Ur(Math.round(e).toString(16)),Ur(Math.round(t).toString(16)),Ur(Math.round(r).toString(16))];return i.join("")}kt.equals=function(e,t){return!e||!t?!1:kt(e).toRgbString()==kt(t).toRgbString()},kt.random=function(){return kt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function PC(e,t){t=t===0?0:t||10;var r=kt(e).toHsl();return r.s-=t/100,r.s=dl(r.s),kt(r)}function IC(e,t){t=t===0?0:t||10;var r=kt(e).toHsl();return r.s+=t/100,r.s=dl(r.s),kt(r)}function kC(e){return kt(e).desaturate(100)}function RC(e,t){t=t===0?0:t||10;var r=kt(e).toHsl();return r.l+=t/100,r.l=dl(r.l),kt(r)}function NC(e,t){t=t===0?0:t||10;var r=kt(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),kt(r)}function MC(e,t){t=t===0?0:t||10;var r=kt(e).toHsl();return r.l-=t/100,r.l=dl(r.l),kt(r)}function LC(e,t){var r=kt(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,kt(r)}function BC(e){var t=kt(e).toHsl();return t.h=(t.h+180)%360,kt(t)}function my(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=kt(e).toHsl(),n=[kt(e)],i=360/t,s=1;s<t;s++)n.push(kt({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function FC(e){var t=kt(e).toHsl(),r=t.h;return[kt(e),kt({h:(r+72)%360,s:t.s,l:t.l}),kt({h:(r+216)%360,s:t.s,l:t.l})]}function DC(e,t,r){t=t||6,r=r||30;var n=kt(e).toHsl(),i=360/r,s=[kt(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(kt(n));return s}function UC(e,t){t=t||6;for(var r=kt(e).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/t;t--;)a.push(kt({h:n,s:i,v:s})),s=(s+o)%1;return a}kt.mix=function(e,t,r){r=r===0?0:r||50;var n=kt(e).toRgb(),i=kt(t).toRgb(),s=r/100,a={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return kt(a)},kt.readability=function(e,t){var r=kt(e),n=kt(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},kt.isReadable=function(e,t,r){var n=kt.readability(e,t),i,s;switch(s=!1,i=qC(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s},kt.mostReadable=function(e,t,r){var n=null,i=0,s,a,o,c;r=r||{},a=r.includeFallbackColors,o=r.level,c=r.size;for(var h=0;h<t.length;h++)s=kt.readability(e,t[h]),s>i&&(i=s,n=kt(t[h]));return kt.isReadable(e,n,{level:o,size:c})||!a?n:(r.includeFallbackColors=!1,kt.mostReadable(e,["#fff","#000"],r))};var Ch=kt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},jC=kt.hexNames=$C(Ch);function $C(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function gy(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ue(e,t){zC(e)&&(e="100%");var r=HC(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function dl(e){return Math.min(1,Math.max(0,e))}function or(e){return parseInt(e,16)}function zC(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function HC(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Ur(e){return e.length==1?"0"+e:""+e}function ga(e){return e<=1&&(e=e*100+"%"),e}function yy(e){return Math.round(parseFloat(e)*255).toString(16)}function vy(e){return or(e)/255}var jr=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Cn(e){return!!jr.CSS_UNIT.exec(e)}function GC(e){e=e.replace(wC,"").replace(SC,"").toLowerCase();var t=!1;if(Ch[e])e=Ch[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=jr.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=jr.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=jr.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=jr.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=jr.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=jr.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=jr.hex8.exec(e))?{r:or(r[1]),g:or(r[2]),b:or(r[3]),a:vy(r[4]),format:t?"name":"hex8"}:(r=jr.hex6.exec(e))?{r:or(r[1]),g:or(r[2]),b:or(r[3]),format:t?"name":"hex"}:(r=jr.hex4.exec(e))?{r:or(r[1]+""+r[1]),g:or(r[2]+""+r[2]),b:or(r[3]+""+r[3]),a:vy(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=jr.hex3.exec(e))?{r:or(r[1]+""+r[1]),g:or(r[2]+""+r[2]),b:or(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function qC(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var VC=function(){function e(t,r){var n=[],i=!0,s=!1,a=void 0;try{for(var o=t[Symbol.iterator](),c;!(i=(c=o.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(h){s=!0,a=h}finally{try{!i&&o.return&&o.return()}finally{if(s)throw a}}return n}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ya=Math.PI*2,Oh=function(t,r,n,i,s,a,o){var c=t.x,h=t.y;c*=r,h*=n;var d=i*c-s*h,p=s*c+i*h;return{x:d+a,y:p+o}},WC=function(t,r){var n=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),i=Math.cos(t),s=Math.sin(t),a=Math.cos(t+r),o=Math.sin(t+r);return[{x:i-s*n,y:s+i*n},{x:a+o*n,y:o-a*n},{x:a,y:o}]},_y=function(t,r,n,i){var s=t*i-r*n<0?-1:1,a=t*n+r*i;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},XC=function(t,r,n,i,s,a,o,c,h,d,p,f){var m=Math.pow(s,2),g=Math.pow(a,2),v=Math.pow(p,2),b=Math.pow(f,2),_=m*g-m*b-g*v;_<0&&(_=0),_/=m*b+g*v,_=Math.sqrt(_)*(o===c?-1:1);var w=_*s/a*f,S=_*-a/s*p,x=d*w-h*S+(t+n)/2,A=h*w+d*S+(r+i)/2,N=(p-w)/s,O=(f-S)/a,P=(-p-w)/s,B=(-f-S)/a,I=_y(1,0,N,O),C=_y(N,O,P,B);return c===0&&C>0&&(C-=ya),c===1&&C<0&&(C+=ya),[x,A,I,C]},by=function(t){var r=t.px,n=t.py,i=t.cx,s=t.cy,a=t.rx,o=t.ry,c=t.xAxisRotation,h=c===void 0?0:c,d=t.largeArcFlag,p=d===void 0?0:d,f=t.sweepFlag,m=f===void 0?0:f,g=[];if(a===0||o===0)return[];var v=Math.sin(h*ya/360),b=Math.cos(h*ya/360),_=b*(r-i)/2+v*(n-s)/2,w=-v*(r-i)/2+b*(n-s)/2;if(_===0&&w===0)return[];a=Math.abs(a),o=Math.abs(o);var S=Math.pow(_,2)/Math.pow(a,2)+Math.pow(w,2)/Math.pow(o,2);S>1&&(a*=Math.sqrt(S),o*=Math.sqrt(S));var x=XC(r,n,i,s,a,o,p,m,v,b,_,w),A=VC(x,4),N=A[0],O=A[1],P=A[2],B=A[3],I=Math.abs(B)/(ya/4);Math.abs(1-I)<1e-7&&(I=1);var C=Math.max(Math.ceil(I),1);B/=C;for(var k=0;k<C;k++)g.push(WC(P,B)),P+=B;return g.map(function(M){var F=Oh(M[0],a,o,b,v,N,O),$=F.x,V=F.y,q=Oh(M[1],a,o,b,v,N,O),X=q.x,G=q.y,D=Oh(M[2],a,o,b,v,N,O),L=D.x,U=D.y;return{x1:$,y1:V,x2:X,y2:G,x:L,y:U}})};class YC extends mr{constructor(t){super(),this.lineColor=null,t&&this.drawSVG(t)}drawSVG(t){if(typeof t=="string"){const r=document.createElement("div");r.innerHTML=t.trim(),t=r.querySelector("svg")}if(!t)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(t),this._svgChildren(t.children),this}_svgChildren(t,r=!1){for(let n=0;n<t.length;n++){const i=t[n];switch(this._svgFill(i,r),i.nodeName.toLowerCase()){case"path":{this._svgPath(i);break}case"circle":case"ellipse":{this._svgCircle(i);break}case"rect":{this._svgRect(i);break}case"polygon":{this._svgPoly(i,!0);break}case"polyline":{this._svgPoly(i);break}case"g":break;default:{console.info(`[PIXI.SVG] <${i.nodeName}> elements unsupported`);break}}this._svgChildren(i.children,!0)}}_hexToUint(t){if(t[0]==="#")return t=t.substr(1),t.length===3&&(t=t.replace(/([a-f0-9])/ig,"$1$1")),parseInt(t,16);const{r,g:n,b:i}=kt(t).toRgb();return(r<<16)+(n<<8)+i}_svgCircle(t){let r="r",n="r";const i=t.nodeName==="elipse";i&&(r+="x",n+="y");const s=parseFloat(t.getAttribute(n)),a=parseFloat(t.getAttribute(r)),o=t.getAttribute("cx"),c=t.getAttribute("cy");let h=0,d=0;o!==null&&(h=parseFloat(o)),c!==null&&(d=parseFloat(c)),i?this.drawEllipse(h,d,s,a):this.drawCircle(h,d,s)}_svgRect(t){const r=parseFloat(t.getAttribute("x")),n=parseFloat(t.getAttribute("y")),i=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=parseFloat(t.getAttribute("rx"));a?this.drawRoundedRect(r,n,i,s,a):this.drawRect(r,n,i,s)}_convertStyleName(t){return t.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(t){const r=t.getAttribute("style"),n=t.getAttribute("opacity"),i={fill:t.getAttribute("fill"),opacity:n||t.getAttribute("fill-opacity"),stroke:t.getAttribute("stroke"),strokeOpacity:n||t.getAttribute("stroke-opacity"),strokeWidth:t.getAttribute("stroke-width"),cap:t.getAttribute("stroke-linecap"),join:t.getAttribute("stroke-linejoin"),miterLimit:t.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const c=this._convertStyleName(a);i[c]||(i[c]=o.trim())}}),i}_svgPoly(t,r){const n=t.getAttribute("points").split(/[ ,]/g).map(i=>parseInt(i,10));this.drawPolygon(n),r&&this.closePath()}_svgFill(t,r){const{fill:n,opacity:i,stroke:s,strokeOpacity:a,strokeWidth:o,cap:c,join:h,miterLimit:d}=this._svgStyle(t),f=o!==null?parseFloat(o):s!==null?1:0,m=s!==null?this._hexToUint(s):this.lineColor;n?n==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(n),i!==null?parseFloat(i):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:f,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:m,cap:c===null&&r?this.line.cap:c,join:h===null&&r?this.line.join:h,miterLimit:d===null&&r?this.line.miterLimit:parseFloat(d)}),t.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(t){const r=t.getAttribute("d");let n=0,i=0;const s=Ah(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(n+=o.end.x,i+=o.end.y);break}case"M":{this.moveTo(n=o.end.x,i=o.end.y);break}case"H":{this.lineTo(n=o.value,i);break}case"h":{this.lineTo(n+=o.value,i);break}case"V":{this.lineTo(n,i=o.value);break}case"v":{this.lineTo(n,i+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(n=o.end.x,i=o.end.y);break}case"l":{this.lineTo(n+=o.end.x,i+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,n=o.end.x,i=o.end.y);break}case"c":{const c=n,h=i;this.bezierCurveTo(c+o.cp1.x,h+o.cp1.y,c+o.cp2.x,h+o.cp2.y,n+=o.end.x,i+=o.end.y);break}case"s":case"q":{const c=n,h=i;this.quadraticCurveTo(c+o.cp.x,h+o.cp.y,n+=o.end.x,i+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,n=o.end.x,i=o.end.y);break}case"a":{by({px:n,py:i,cx:n+=o.end.x,cy:i+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:c,y1:h,x2:d,y2:p,x:f,y:m})=>this.bezierCurveTo(c,h,d,p,f,m));break}case"A":{by({px:n,py:i,cx:n=o.end.x,cy:i=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:c,y1:h,x2:d,y2:p,x:f,y:m})=>this.bezierCurveTo(c,h,d,p,f,m));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var pl={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},KC=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function ZC(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&KC.indexOf(e)>=0}function QC(e){switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function JC(e){return(e|32)===97}function fs(e){return e>=48&&e<=57}function tO(e){return e>=48&&e<=57||e===43||e===45||e===46}function eO(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function ml(e){for(;e.index<e.max&&ZC(e.path.charCodeAt(e.index));)e.index++}function rO(e){var t=e.path.charCodeAt(e.index);if(t===48){e.param=0,e.index++;return}if(t===49){e.param=1,e.index++;return}e.err="SvgPath: arc flag can be 0 or 1 only (at pos "+e.index+")"}function nO(e){var t=e.index,r=t,n=e.max,i=!1,s=!1,a=!1,o=!1,c;if(r>=n){e.err="SvgPath: missed param (at pos "+r+")";return}if(c=e.path.charCodeAt(r),(c===43||c===45)&&(r++,c=r<n?e.path.charCodeAt(r):0),!fs(c)&&c!==46){e.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(c!==46){if(i=c===48,r++,c=r<n?e.path.charCodeAt(r):0,i&&r<n&&c&&fs(c)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&fs(e.path.charCodeAt(r));)r++,s=!0;c=r<n?e.path.charCodeAt(r):0}if(c===46){for(o=!0,r++;fs(e.path.charCodeAt(r));)r++,a=!0;c=r<n?e.path.charCodeAt(r):0}if(c===101||c===69){if(o&&!s&&!a){e.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,c=r<n?e.path.charCodeAt(r):0,(c===43||c===45)&&r++,r<n&&fs(e.path.charCodeAt(r)))for(;r<n&&fs(e.path.charCodeAt(r));)r++;else{e.err="SvgPath: invalid float exponent (at pos "+r+")";return}}e.index=r,e.param=parseFloat(e.path.slice(t,r))+0}function Ph(e){var t,r;t=e.path[e.segmentStart],r=t.toLowerCase();var n=e.data;if(r==="m"&&n.length>2&&(e.result.push([t,n[0],n[1]]),n=n.slice(2),r="l",t=t==="m"?"l":"L"),r==="r")e.result.push([t].concat(n));else for(;n.length>=pl[r]&&(e.result.push([t].concat(n.splice(0,pl[r]))),!!pl[r]););}function iO(e){var t=e.max,r,n,i,s,a;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=JC(r),!QC(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=pl[e.path[e.index].toLowerCase()],e.index++,ml(e),e.data=[],!s){Ph(e);return}for(i=!1;;){for(a=s;a>0;a--){if(n&&(a===3||a===4)?rO(e):nO(e),e.err.length){Ph(e);return}e.data.push(e.param),ml(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,ml(e),i=!0)}if(!i&&(e.index>=e.max||!tO(e.path.charCodeAt(e.index))))break}Ph(e)}var sO=function(t){var r=new eO(t),n=r.max;for(ml(r);r.index<n&&!r.err.length;)iO(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function aO(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function $r(){if(!(this instanceof $r))return new $r;this.queue=[],this.cache=null}$r.prototype.matrix=function(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0?this:(this.cache=null,this.queue.push(e),this)},$r.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},$r.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},$r.prototype.rotate=function(e,t,r){var n,i,s;return e!==0&&(this.translate(t,r),n=e*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-t,-r)),this},$r.prototype.skewX=function(e){return e!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(e*Math.PI/180),1,0,0])),this},$r.prototype.skewY=function(e){return e!==0&&(this.cache=null,this.queue.push([1,Math.tan(e*Math.PI/180),0,1,0,0])),this},$r.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var e=1;e<this.queue.length;e++)this.cache=aO(this.cache,this.queue[e]);return this.cache},$r.prototype.calc=function(e,t,r){var n;return this.queue.length?(this.cache||(this.cache=this.toArray()),n=this.cache,[e*n[0]+t*n[2]+(r?0:n[4]),e*n[1]+t*n[3]+(r?0:n[5])]):[e,t]};var xy=$r,oO=xy,lO={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},uO=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,cO=/[\s,]+/,hO=function(t){var r=new oO,n,i;return t.split(uO).forEach(function(s){if(s.length){if(typeof lO[s]<"u"){n=s;return}switch(i=s.split(cO).map(function(a){return+a||0}),n){case"matrix":i.length===6&&r.matrix(i);return;case"scale":i.length===1?r.scale(i[0],i[0]):i.length===2&&r.scale(i[0],i[1]);return;case"rotate":i.length===1?r.rotate(i[0],0,0):i.length===3&&r.rotate(i[0],i[1],i[2]);return;case"translate":i.length===1?r.translate(i[0],0):i.length===2&&r.translate(i[0],i[1]);return;case"skewX":i.length===1&&r.skewX(i[0]);return;case"skewY":i.length===1&&r.skewY(i[0]);return}}}),r},va=Math.PI*2;function wy(e,t,r,n){var i=e*n-t*r<0?-1:1,s=e*r+t*n;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)}function fO(e,t,r,n,i,s,a,o,c,h){var d=h*(e-r)/2+c*(t-n)/2,p=-c*(e-r)/2+h*(t-n)/2,f=a*a,m=o*o,g=d*d,v=p*p,b=f*m-f*v-m*g;b<0&&(b=0),b/=f*v+m*g,b=Math.sqrt(b)*(i===s?-1:1);var _=b*a/o*p,w=b*-o/a*d,S=h*_-c*w+(e+r)/2,x=c*_+h*w+(t+n)/2,A=(d-_)/a,N=(p-w)/o,O=(-d-_)/a,P=(-p-w)/o,B=wy(1,0,A,N),I=wy(A,N,O,P);return s===0&&I>0&&(I-=va),s===1&&I<0&&(I+=va),[S,x,B,I]}function dO(e,t){var r=1.3333333333333333*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),s=Math.cos(e+t),a=Math.sin(e+t);return[n,i,n-i*r,i+n*r,s+a*r,a-s*r,s,a]}var pO=function(t,r,n,i,s,a,o,c,h){var d=Math.sin(h*va/360),p=Math.cos(h*va/360),f=p*(t-n)/2+d*(r-i)/2,m=-d*(t-n)/2+p*(r-i)/2;if(f===0&&m===0)return[];if(o===0||c===0)return[];o=Math.abs(o),c=Math.abs(c);var g=f*f/(o*o)+m*m/(c*c);g>1&&(o*=Math.sqrt(g),c*=Math.sqrt(g));var v=fO(t,r,n,i,s,a,o,c,d,p),b=[],_=v[2],w=v[3],S=Math.max(Math.ceil(Math.abs(w)/(va/4)),1);w/=S;for(var x=0;x<S;x++)b.push(dO(_,w)),_+=w;return b.map(function(A){for(var N=0;N<A.length;N+=2){var O=A[N+0],P=A[N+1];O*=o,P*=c;var B=p*O-d*P,I=d*O+p*P;A[N+0]=B+v[0],A[N+1]=I+v[1]}return A})},_a=1e-10,Sy=Math.PI/180;function ba(e,t,r){if(!(this instanceof ba))return new ba(e,t,r);this.rx=e,this.ry=t,this.ax=r}ba.prototype.transform=function(e){var t=Math.cos(this.ax*Sy),r=Math.sin(this.ax*Sy),n=[this.rx*(e[0]*t+e[2]*r),this.rx*(e[1]*t+e[3]*r),this.ry*(-e[0]*r+e[2]*t),this.ry*(-e[1]*r+e[3]*t)],i=n[0]*n[0]+n[2]*n[2],s=n[1]*n[1]+n[3]*n[3],a=((n[0]-n[3])*(n[0]-n[3])+(n[2]+n[1])*(n[2]+n[1]))*((n[0]+n[3])*(n[0]+n[3])+(n[2]-n[1])*(n[2]-n[1])),o=(i+s)/2;if(a<_a*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var c=n[0]*n[1]+n[2]*n[3];a=Math.sqrt(a);var h=o+a/2,d=o-a/2;return this.ax=Math.abs(c)<_a&&Math.abs(h-s)<_a?90:Math.atan(Math.abs(c)>Math.abs(h-s)?(h-i)/c:c/(h-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)):(this.ax+=90,this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)),this},ba.prototype.isDegenerate=function(){return this.rx<_a*this.ry||this.ry<_a*this.rx};var mO=ba,gO=sO,yO=hO,qn=xy,vO=pO,_O=mO;function ge(e){if(!(this instanceof ge))return new ge(e);var t=gO(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}ge.from=function(e){if(typeof e=="string")return new ge(e);if(e instanceof ge){var t=new ge("");return t.err=e.err,t.segments=e.segments.map(function(r){return r.slice()}),t.__stack=e.__stack.map(function(r){return qn().matrix(r.toArray())}),t}throw new Error("SvgPath.from: invalid param type "+e)},ge.prototype.__matrix=function(e){var t=this,r;e.queue.length&&this.iterate(function(n,i,s,a){var o,c,h,d;switch(n[0]){case"v":o=e.calc(0,n[1],!0),c=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=e.calc(s,n[1],!1),c=o[0]===e.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=e.calc(n[1],0,!0),c=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=e.calc(n[1],a,!1),c=o[1]===e.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var p=e.toArray(),f=_O(n[1],n[2],n[3]).transform(p);if(p[0]*p[3]-p[1]*p[2]<0&&(n[5]=n[5]?"0":"1"),o=e.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===s&&n[7]===a||n[0]==="a"&&n[6]===0&&n[7]===0){c=[n[0]==="a"?"l":"L",o[0],o[1]];break}f.isDegenerate()?c=[n[0]==="a"?"l":"L",o[0],o[1]]:c=[n[0],f.rx,f.ry,f.ax,n[4],n[5],o[0],o[1]];break;case"m":d=i>0,o=e.calc(n[1],n[2],d),c=["m",o[0],o[1]];break;default:for(h=n[0],c=[h],d=h.toLowerCase()===h,r=1;r<n.length;r+=2)o=e.calc(n[r],n[r+1],d),c.push(o[0],o[1])}t.segments[i]=c},!0)},ge.prototype.__evaluateStack=function(){var e,t;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(e=qn(),t=this.__stack.length;--t>=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},ge.prototype.toString=function(){var e="",t="",r=!1;this.__evaluateStack();for(var n=0,i=this.segments.length;n<i;n++){var s=this.segments[n],a=s[0];a!==t||a==="m"||a==="M"?(a==="m"&&t==="z"&&(e+=" "),e+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var c=s[o];o===1?r&&c>=0&&(e+=" "):c>=0&&(e+=" "),e+=c}t=a}return e},ge.prototype.translate=function(e,t){return this.__stack.push(qn().translate(e,t||0)),this},ge.prototype.scale=function(e,t){return this.__stack.push(qn().scale(e,!t&&t!==0?e:t)),this},ge.prototype.rotate=function(e,t,r){return this.__stack.push(qn().rotate(e,t||0,r||0)),this},ge.prototype.skewX=function(e){return this.__stack.push(qn().skewX(e)),this},ge.prototype.skewY=function(e){return this.__stack.push(qn().skewY(e)),this},ge.prototype.matrix=function(e){return this.__stack.push(qn().matrix(e)),this},ge.prototype.transform=function(e){return e.trim()?(this.__stack.push(yO(e)),this):this},ge.prototype.round=function(e){var t=0,r=0,n=0,i=0,s;return e=e||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=n),n=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"V":case"v":o&&(a[1]+=i),i=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"Z":case"z":n=t,i=r;return;case"M":case"m":o&&(a[1]+=n,a[2]+=i),n=a[1]-a[1].toFixed(e),i=a[2]-a[2].toFixed(e),t=n,r=i,a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e);return;case"A":case"a":o&&(a[6]+=n,a[7]+=i),n=a[6]-a[6].toFixed(e),i=a[7]-a[7].toFixed(e),a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e),a[3]=+a[3].toFixed(e+2),a[6]=+a[6].toFixed(e),a[7]=+a[7].toFixed(e);return;default:s=a.length,o&&(a[s-2]+=n,a[s-1]+=i),n=a[s-2]-a[s-2].toFixed(e),i=a[s-1]-a[s-1].toFixed(e),a.forEach(function(c,h){h&&(a[h]=+a[h].toFixed(e))});return}}),this},ge.prototype.iterate=function(e,t){var r=this.segments,n={},i=!1,s=0,a=0,o=0,c=0,h,d,p;if(t||this.__evaluateStack(),r.forEach(function(f,m){var g=e(f,m,s,a);Array.isArray(g)&&(n[m]=g,i=!0);var v=f[0]===f[0].toLowerCase();switch(f[0]){case"m":case"M":s=f[1]+(v?s:0),a=f[2]+(v?a:0),o=s,c=a;return;case"h":case"H":s=f[1]+(v?s:0);return;case"v":case"V":a=f[1]+(v?a:0);return;case"z":case"Z":s=o,a=c;return;default:s=f[f.length-2]+(v?s:0),a=f[f.length-1]+(v?a:0)}}),!i)return this;for(p=[],h=0;h<r.length;h++)if(typeof n[h]<"u")for(d=0;d<n[h].length;d++)p.push(n[h][d]);else p.push(r[h]);return this.segments=p,this},ge.prototype.abs=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toUpperCase(),a;if(i!==s)switch(e[0]=s,i){case"v":e[1]+=n;return;case"a":e[6]+=r,e[7]+=n;return;default:for(a=1;a<e.length;a++)e[a]+=a%2?r:n}},!0),this},ge.prototype.rel=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toLowerCase(),a;if(i!==s&&!(t===0&&i==="M"))switch(e[0]=s,i){case"V":e[1]-=n;return;case"A":e[6]-=r,e[7]-=n;return;default:for(a=1;a<e.length;a++)e[a]-=a%2?r:n}},!0),this},ge.prototype.unarc=function(){return this.iterate(function(e,t,r,n){var i,s,a,o=[],c=e[0];return c!=="A"&&c!=="a"?null:(c==="a"?(s=r+e[6],a=n+e[7]):(s=e[6],a=e[7]),i=vO(r,n,s,a,e[4],e[5],e[1],e[2],e[3]),i.length===0?[[e[0]==="a"?"l":"L",e[6],e[7]]]:(i.forEach(function(h){o.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),o))}),this},ge.prototype.unshort=function(){var e=this.segments,t,r,n,i,s;return this.iterate(function(a,o,c,h){var d=a[0],p=d.toUpperCase(),f;o&&(p==="T"?(f=d==="t",n=e[o-1],n[0]==="Q"?(t=n[1]-c,r=n[2]-h):n[0]==="q"?(t=n[1]-n[3],r=n[2]-n[4]):(t=0,r=0),i=-t,s=-r,f||(i+=c,s+=h),e[o]=[f?"q":"Q",i,s,a[1],a[2]]):p==="S"&&(f=d==="s",n=e[o-1],n[0]==="C"?(t=n[3]-c,r=n[4]-h):n[0]==="c"?(t=n[3]-n[5],r=n[4]-n[6]):(t=0,r=0),i=-t,s=-r,f||(i+=c,s+=h),e[o]=[f?"c":"C",i,s,a[1],a[2],a[3],a[4]]))}),this};var bO=ge,xO=bO;const wO=ni(xO),SO=e=>{const[t,r]=Mt.useState(null),n=dt.useRef(null),i=dt.useRef(null),s=dt.useRef(null),{path:a,transformation:{x:o,y:c,width:h,height:d,anchor:p,fill:f,stroke:m="none",strokeWidth:g=0},pointerdown:v,pointerup:b,mousedown:_,mouseup:w,pointerover:S,mouseover:x,mouseout:A}=e,N=qt.useApp();return Mt.useEffect(()=>{const O=wO(a).scale(5).translate(0,0).toString(),P=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${d}">
852
- <path stroke="${m}" stroke-width="${g}" fill="${f}" d="${O}">
547
+ */(function(e,t){(function(r,n){e.exports=n()})(Ug,function(){return function(n){for(var i={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(v){return+d("number",v)},"coordinate pair":function(v){var g=d("number",v);if(g===null&&!v)return null;d("comma");var y=d("number",!0);return{x:+g,y:+y}},"arc definition":function(v){var g=s["coordinate pair"](v);if(!g&&!v)return null;d("comma");var y=+d("number",!0);d("comma",!0);var b=!!+d("flag",!0);d("comma");var _=!!+d("flag",!0);d("comma");var m=s["coordinate pair"](!0);return{radii:g,rotation:y,large:b,clockwise:_,end:m}}},a=0,o=[];a<n.length;){var l=d("command"),h=l.toUpperCase(),c=l!==h,f;switch(h){case"M":f=p("coordinate pair").map(function(v,g){return g===1&&(l=c?"l":"L"),u({end:v})});break;case"L":case"T":f=p("coordinate pair").map(function(v){return u({end:v})});break;case"C":if(f=p("coordinate pair"),f.length%3)throw Error("Expected coordinate pair triplet at position "+a);f=f.reduce(function(v,g,y){var b=y%3;if(!b)v.push(u({cp1:g}));else{var _=v[v.length-1];_[b===1?"cp2":"end"]=g}return v},[]);break;case"Q":case"S":if(f=p("coordinate pair"),f.length&1)throw Error("Expected coordinate pair couple at position "+a);f=f.reduce(function(v,g,y){var b=y&1;if(!b)v.push(u({cp:g}));else{var _=v[v.length-1];_.end=g}return v},[]);break;case"H":case"V":f=p("number").map(function(v){return u({value:v})});break;case"A":f=p("arc definition").map(u);break;case"Z":f=[{code:"Z"}];break}o.push.apply(o,f)}return o;function u(v){return v.code=l,v.relative=c,v}function d(v,g){i[v].lastIndex=a;var y=i[v].exec(n);if(!y||y.index!==a){if(!g)return null;throw Error("Expected "+v+" at position "+a)}return a=i[v].lastIndex,y[1]}function p(v){for(var g=[],y,b=!0;y=s[v](b);)g.push(y),b=!!d("comma");return g}}})})(jg);const Gg=/^\s+/,$g=/\s+$/;function st(e,t){if(e=e||"",t=t||{},e instanceof st)return e;if(!(this instanceof st))return new st(e,t);var r=qg(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}st.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,r,n,i,s,a;return t=e.r/255,r=e.g/255,n=e.b/255,t<=.03928?i=t/12.92:i=Math.pow((t+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*s+.0722*a},setAlpha:function(e){return this._a=zu(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Gu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Gu(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=ju(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=ju(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return $u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Xg(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Nt(this._r,255)*100)+"%",g:Math.round(Nt(this._g,255)*100)+"%",b:Math.round(Nt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Nt(this._r,255)*100)+"%, "+Math.round(Nt(this._g,255)*100)+"%, "+Math.round(Nt(this._b,255)*100)+"%)":"rgba("+Math.round(Nt(this._r,255)*100)+"%, "+Math.round(Nt(this._g,255)*100)+"%, "+Math.round(Nt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:s0[$u(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+qu(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=st(e);r="#"+qu(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return st(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Zg,arguments)},brighten:function(){return this._applyModification(Qg,arguments)},darken:function(){return this._applyModification(Jg,arguments)},desaturate:function(){return this._applyModification(Wg,arguments)},saturate:function(){return this._applyModification(Yg,arguments)},greyscale:function(){return this._applyModification(Kg,arguments)},spin:function(){return this._applyModification(t0,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(n0,arguments)},complement:function(){return this._applyCombination(e0,arguments)},monochromatic:function(){return this._applyCombination(i0,arguments)},splitcomplement:function(){return this._applyCombination(r0,arguments)},triad:function(){return this._applyCombination(Hu,[3])},tetrad:function(){return this._applyCombination(Hu,[4])}},st.fromRatio=function(e,t){if(typeof e=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=dn(e[n]));e=r}return st(e,t)};function qg(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,a=!1,o=!1;return typeof e=="string"&&(e=u0(e)),typeof e=="object"&&(Ne(e.r)&&Ne(e.g)&&Ne(e.b)?(t=Hg(e.r,e.g,e.b),a=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ne(e.h)&&Ne(e.s)&&Ne(e.v)?(n=dn(e.s),i=dn(e.v),t=Vg(e.h,n,i),a=!0,o="hsv"):Ne(e.h)&&Ne(e.s)&&Ne(e.l)&&(n=dn(e.s),s=dn(e.l),t=zg(e.h,n,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=zu(r),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function Hg(e,t,r){return{r:Nt(e,255)*255,g:Nt(t,255)*255,b:Nt(r,255)*255}}function ju(e,t,r){e=Nt(e,255),t=Nt(t,255),r=Nt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=(n+i)/2;if(n==i)s=a=0;else{var l=n-i;switch(a=o>.5?l/(2-n-i):l/(n+i),n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:o}}function zg(e,t,r){var n,i,s;e=Nt(e,360),t=Nt(t,100),r=Nt(r,100);function a(h,c,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?h+(c-h)*6*f:f<1/2?c:f<2/3?h+(c-h)*(2/3-f)*6:h}if(t===0)n=i=s=r;else{var o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;n=a(l,o,e+1/3),i=a(l,o,e),s=a(l,o,e-1/3)}return{r:n*255,g:i*255,b:s*255}}function Gu(e,t,r){e=Nt(e,255),t=Nt(t,255),r=Nt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=n,l=n-i;if(a=n===0?0:l/n,n==i)s=0;else{switch(n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:o}}function Vg(e,t,r){e=Nt(e,360)*6,t=Nt(t,100),r=Nt(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),a=r*(1-i*t),o=r*(1-(1-i)*t),l=n%6,h=[r,a,s,s,o,r][l],c=[o,r,r,a,s,s][l],f=[s,s,o,r,r,a][l];return{r:h*255,g:c*255,b:f*255}}function $u(e,t,r,n){var i=[ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Xg(e,t,r,n,i){var s=[ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(Math.round(r).toString(16)),ce(Vu(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function qu(e,t,r,n){var i=[ce(Vu(n)),ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(Math.round(r).toString(16))];return i.join("")}st.equals=function(e,t){return!e||!t?!1:st(e).toRgbString()==st(t).toRgbString()},st.random=function(){return st.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Wg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s-=t/100,r.s=Ti(r.s),st(r)}function Yg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s+=t/100,r.s=Ti(r.s),st(r)}function Kg(e){return st(e).desaturate(100)}function Zg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l+=t/100,r.l=Ti(r.l),st(r)}function Qg(e,t){t=t===0?0:t||10;var r=st(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),st(r)}function Jg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l-=t/100,r.l=Ti(r.l),st(r)}function t0(e,t){var r=st(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,st(r)}function e0(e){var t=st(e).toHsl();return t.h=(t.h+180)%360,st(t)}function Hu(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=st(e).toHsl(),n=[st(e)],i=360/t,s=1;s<t;s++)n.push(st({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function r0(e){var t=st(e).toHsl(),r=t.h;return[st(e),st({h:(r+72)%360,s:t.s,l:t.l}),st({h:(r+216)%360,s:t.s,l:t.l})]}function n0(e,t,r){t=t||6,r=r||30;var n=st(e).toHsl(),i=360/r,s=[st(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(st(n));return s}function i0(e,t){t=t||6;for(var r=st(e).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/t;t--;)a.push(st({h:n,s:i,v:s})),s=(s+o)%1;return a}st.mix=function(e,t,r){r=r===0?0:r||50;var n=st(e).toRgb(),i=st(t).toRgb(),s=r/100,a={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return st(a)},st.readability=function(e,t){var r=st(e),n=st(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},st.isReadable=function(e,t,r){var n=st.readability(e,t),i,s;switch(s=!1,i=h0(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s},st.mostReadable=function(e,t,r){var n=null,i=0,s,a,o,l;r=r||{},a=r.includeFallbackColors,o=r.level,l=r.size;for(var h=0;h<t.length;h++)s=st.readability(e,t[h]),s>i&&(i=s,n=st(t[h]));return st.isReadable(e,n,{level:o,size:l})||!a?n:(r.includeFallbackColors=!1,st.mostReadable(e,["#fff","#000"],r))};var Aa=st.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},s0=st.hexNames=a0(Aa);function a0(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function zu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Nt(e,t){o0(e)&&(e="100%");var r=l0(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Ti(e){return Math.min(1,Math.max(0,e))}function Qt(e){return parseInt(e,16)}function o0(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function l0(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ce(e){return e.length==1?"0"+e:""+e}function dn(e){return e<=1&&(e=e*100+"%"),e}function Vu(e){return Math.round(parseFloat(e)*255).toString(16)}function Xu(e){return Qt(e)/255}var fe=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ne(e){return!!fe.CSS_UNIT.exec(e)}function u0(e){e=e.replace(Gg,"").replace($g,"").toLowerCase();var t=!1;if(Aa[e])e=Aa[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=fe.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=fe.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=fe.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=fe.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=fe.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=fe.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=fe.hex8.exec(e))?{r:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),a:Xu(r[4]),format:t?"name":"hex8"}:(r=fe.hex6.exec(e))?{r:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),format:t?"name":"hex"}:(r=fe.hex4.exec(e))?{r:Qt(r[1]+""+r[1]),g:Qt(r[2]+""+r[2]),b:Qt(r[3]+""+r[3]),a:Xu(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=fe.hex3.exec(e))?{r:Qt(r[1]+""+r[1]),g:Qt(r[2]+""+r[2]),b:Qt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function h0(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var c0=function(){function e(t,r){var n=[],i=!0,s=!1,a=void 0;try{for(var o=t[Symbol.iterator](),l;!(i=(l=o.next()).done)&&(n.push(l.value),!(r&&n.length===r));i=!0);}catch(h){s=!0,a=h}finally{try{!i&&o.return&&o.return()}finally{if(s)throw a}}return n}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),pn=Math.PI*2,Sa=function(t,r,n,i,s,a,o){var l=t.x,h=t.y;l*=r,h*=n;var c=i*l-s*h,f=s*l+i*h;return{x:c+a,y:f+o}},f0=function(t,r){var n=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),i=Math.cos(t),s=Math.sin(t),a=Math.cos(t+r),o=Math.sin(t+r);return[{x:i-s*n,y:s+i*n},{x:a+o*n,y:o-a*n},{x:a,y:o}]},Wu=function(t,r,n,i){var s=t*i-r*n<0?-1:1,a=t*n+r*i;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},d0=function(t,r,n,i,s,a,o,l,h,c,f,u){var d=Math.pow(s,2),p=Math.pow(a,2),v=Math.pow(f,2),g=Math.pow(u,2),y=d*p-d*g-p*v;y<0&&(y=0),y/=d*g+p*v,y=Math.sqrt(y)*(o===l?-1:1);var b=y*s/a*u,_=y*-a/s*f,m=c*b-h*_+(t+n)/2,x=h*b+c*_+(r+i)/2,S=(f-b)/s,w=(u-_)/a,T=(-f-b)/s,N=(-u-_)/a,A=Wu(1,0,S,w),E=Wu(S,w,T,N);return l===0&&E>0&&(E-=pn),l===1&&E<0&&(E+=pn),[m,x,A,E]},Yu=function(t){var r=t.px,n=t.py,i=t.cx,s=t.cy,a=t.rx,o=t.ry,l=t.xAxisRotation,h=l===void 0?0:l,c=t.largeArcFlag,f=c===void 0?0:c,u=t.sweepFlag,d=u===void 0?0:u,p=[];if(a===0||o===0)return[];var v=Math.sin(h*pn/360),g=Math.cos(h*pn/360),y=g*(r-i)/2+v*(n-s)/2,b=-v*(r-i)/2+g*(n-s)/2;if(y===0&&b===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(y,2)/Math.pow(a,2)+Math.pow(b,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var m=d0(r,n,i,s,a,o,f,d,v,g,y,b),x=c0(m,4),S=x[0],w=x[1],T=x[2],N=x[3],A=Math.abs(N)/(pn/4);Math.abs(1-A)<1e-7&&(A=1);var E=Math.max(Math.ceil(A),1);N/=E;for(var O=0;O<E;O++)p.push(f0(T,N)),T+=N;return p.map(function(R){var C=Sa(R[0],a,o,g,v,S,w),F=C.x,U=C.y,D=Sa(R[1],a,o,g,v,S,w),z=D.x,j=D.y,k=Sa(R[2],a,o,g,v,S,w),I=k.x,P=k.y;return{x1:F,y1:U,x2:z,y2:j,x:I,y:P}})};class p0 extends Re{constructor(t){super(),this.lineColor=null,t&&this.drawSVG(t)}drawSVG(t){if(typeof t=="string"){const r=document.createElement("div");r.innerHTML=t.trim(),t=r.querySelector("svg")}if(!t)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(t),this._svgChildren(t.children),this}_svgChildren(t,r=!1){for(let n=0;n<t.length;n++){const i=t[n];switch(this._svgFill(i,r),i.nodeName.toLowerCase()){case"path":{this._svgPath(i);break}case"circle":case"ellipse":{this._svgCircle(i);break}case"rect":{this._svgRect(i);break}case"polygon":{this._svgPoly(i,!0);break}case"polyline":{this._svgPoly(i);break}case"g":break;default:{console.info(`[PIXI.SVG] <${i.nodeName}> elements unsupported`);break}}this._svgChildren(i.children,!0)}}_hexToUint(t){if(t[0]==="#")return t=t.substr(1),t.length===3&&(t=t.replace(/([a-f0-9])/ig,"$1$1")),parseInt(t,16);const{r,g:n,b:i}=st(t).toRgb();return(r<<16)+(n<<8)+i}_svgCircle(t){let r="r",n="r";const i=t.nodeName==="elipse";i&&(r+="x",n+="y");const s=parseFloat(t.getAttribute(n)),a=parseFloat(t.getAttribute(r)),o=t.getAttribute("cx"),l=t.getAttribute("cy");let h=0,c=0;o!==null&&(h=parseFloat(o)),l!==null&&(c=parseFloat(l)),i?this.drawEllipse(h,c,s,a):this.drawCircle(h,c,s)}_svgRect(t){const r=parseFloat(t.getAttribute("x")),n=parseFloat(t.getAttribute("y")),i=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=parseFloat(t.getAttribute("rx"));a?this.drawRoundedRect(r,n,i,s,a):this.drawRect(r,n,i,s)}_convertStyleName(t){return t.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(t){const r=t.getAttribute("style"),n=t.getAttribute("opacity"),i={fill:t.getAttribute("fill"),opacity:n||t.getAttribute("fill-opacity"),stroke:t.getAttribute("stroke"),strokeOpacity:n||t.getAttribute("stroke-opacity"),strokeWidth:t.getAttribute("stroke-width"),cap:t.getAttribute("stroke-linecap"),join:t.getAttribute("stroke-linejoin"),miterLimit:t.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const l=this._convertStyleName(a);i[l]||(i[l]=o.trim())}}),i}_svgPoly(t,r){const n=t.getAttribute("points").split(/[ ,]/g).map(i=>parseInt(i,10));this.drawPolygon(n),r&&this.closePath()}_svgFill(t,r){const{fill:n,opacity:i,stroke:s,strokeOpacity:a,strokeWidth:o,cap:l,join:h,miterLimit:c}=this._svgStyle(t),u=o!==null?parseFloat(o):s!==null?1:0,d=s!==null?this._hexToUint(s):this.lineColor;n?n==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(n),i!==null?parseFloat(i):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:u,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:d,cap:l===null&&r?this.line.cap:l,join:h===null&&r?this.line.join:h,miterLimit:c===null&&r?this.line.miterLimit:parseFloat(c)}),t.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(t){const r=t.getAttribute("d");let n=0,i=0;const s=Ta(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(n+=o.end.x,i+=o.end.y);break}case"M":{this.moveTo(n=o.end.x,i=o.end.y);break}case"H":{this.lineTo(n=o.value,i);break}case"h":{this.lineTo(n+=o.value,i);break}case"V":{this.lineTo(n,i=o.value);break}case"v":{this.lineTo(n,i+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(n=o.end.x,i=o.end.y);break}case"l":{this.lineTo(n+=o.end.x,i+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,n=o.end.x,i=o.end.y);break}case"c":{const l=n,h=i;this.bezierCurveTo(l+o.cp1.x,h+o.cp1.y,l+o.cp2.x,h+o.cp2.y,n+=o.end.x,i+=o.end.y);break}case"s":case"q":{const l=n,h=i;this.quadraticCurveTo(l+o.cp.x,h+o.cp.y,n+=o.end.x,i+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,n=o.end.x,i=o.end.y);break}case"a":{Yu({px:n,py:i,cx:n+=o.end.x,cy:i+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:l,y1:h,x2:c,y2:f,x:u,y:d})=>this.bezierCurveTo(l,h,c,f,u,d));break}case"A":{Yu({px:n,py:i,cx:n=o.end.x,cy:i=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:l,y1:h,x2:c,y2:f,x:u,y:d})=>this.bezierCurveTo(l,h,c,f,u,d));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var Ai={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},y0=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function v0(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&y0.indexOf(e)>=0}function m0(e){switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function g0(e){return(e|32)===97}function Br(e){return e>=48&&e<=57}function b0(e){return e>=48&&e<=57||e===43||e===45||e===46}function _0(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Si(e){for(;e.index<e.max&&v0(e.path.charCodeAt(e.index));)e.index++}function x0(e){var t=e.path.charCodeAt(e.index);if(t===48){e.param=0,e.index++;return}if(t===49){e.param=1,e.index++;return}e.err="SvgPath: arc flag can be 0 or 1 only (at pos "+e.index+")"}function w0(e){var t=e.index,r=t,n=e.max,i=!1,s=!1,a=!1,o=!1,l;if(r>=n){e.err="SvgPath: missed param (at pos "+r+")";return}if(l=e.path.charCodeAt(r),(l===43||l===45)&&(r++,l=r<n?e.path.charCodeAt(r):0),!Br(l)&&l!==46){e.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(l!==46){if(i=l===48,r++,l=r<n?e.path.charCodeAt(r):0,i&&r<n&&l&&Br(l)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&Br(e.path.charCodeAt(r));)r++,s=!0;l=r<n?e.path.charCodeAt(r):0}if(l===46){for(o=!0,r++;Br(e.path.charCodeAt(r));)r++,a=!0;l=r<n?e.path.charCodeAt(r):0}if(l===101||l===69){if(o&&!s&&!a){e.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,l=r<n?e.path.charCodeAt(r):0,(l===43||l===45)&&r++,r<n&&Br(e.path.charCodeAt(r)))for(;r<n&&Br(e.path.charCodeAt(r));)r++;else{e.err="SvgPath: invalid float exponent (at pos "+r+")";return}}e.index=r,e.param=parseFloat(e.path.slice(t,r))+0}function Oa(e){var t,r;t=e.path[e.segmentStart],r=t.toLowerCase();var n=e.data;if(r==="m"&&n.length>2&&(e.result.push([t,n[0],n[1]]),n=n.slice(2),r="l",t=t==="m"?"l":"L"),r==="r")e.result.push([t].concat(n));else for(;n.length>=Ai[r]&&(e.result.push([t].concat(n.splice(0,Ai[r]))),!!Ai[r]););}function E0(e){var t=e.max,r,n,i,s,a;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=g0(r),!m0(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=Ai[e.path[e.index].toLowerCase()],e.index++,Si(e),e.data=[],!s){Oa(e);return}for(i=!1;;){for(a=s;a>0;a--){if(n&&(a===3||a===4)?x0(e):w0(e),e.err.length){Oa(e);return}e.data.push(e.param),Si(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,Si(e),i=!0)}if(!i&&(e.index>=e.max||!b0(e.path.charCodeAt(e.index))))break}Oa(e)}var T0=function(t){var r=new _0(t),n=r.max;for(Si(r);r.index<n&&!r.err.length;)E0(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function A0(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function de(){if(!(this instanceof de))return new de;this.queue=[],this.cache=null}de.prototype.matrix=function(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0?this:(this.cache=null,this.queue.push(e),this)},de.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},de.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},de.prototype.rotate=function(e,t,r){var n,i,s;return e!==0&&(this.translate(t,r),n=e*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-t,-r)),this},de.prototype.skewX=function(e){return e!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(e*Math.PI/180),1,0,0])),this},de.prototype.skewY=function(e){return e!==0&&(this.cache=null,this.queue.push([1,Math.tan(e*Math.PI/180),0,1,0,0])),this},de.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var e=1;e<this.queue.length;e++)this.cache=A0(this.cache,this.queue[e]);return this.cache},de.prototype.calc=function(e,t,r){var n;return this.queue.length?(this.cache||(this.cache=this.toArray()),n=this.cache,[e*n[0]+t*n[2]+(r?0:n[4]),e*n[1]+t*n[3]+(r?0:n[5])]):[e,t]};var Ku=de,S0=Ku,O0={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},R0=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,I0=/[\s,]+/,N0=function(t){var r=new S0,n,i;return t.split(R0).forEach(function(s){if(s.length){if(typeof O0[s]<"u"){n=s;return}switch(i=s.split(I0).map(function(a){return+a||0}),n){case"matrix":i.length===6&&r.matrix(i);return;case"scale":i.length===1?r.scale(i[0],i[0]):i.length===2&&r.scale(i[0],i[1]);return;case"rotate":i.length===1?r.rotate(i[0],0,0):i.length===3&&r.rotate(i[0],i[1],i[2]);return;case"translate":i.length===1?r.translate(i[0],0):i.length===2&&r.translate(i[0],i[1]);return;case"skewX":i.length===1&&r.skewX(i[0]);return;case"skewY":i.length===1&&r.skewY(i[0]);return}}}),r},yn=Math.PI*2;function Zu(e,t,r,n){var i=e*n-t*r<0?-1:1,s=e*r+t*n;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)}function C0(e,t,r,n,i,s,a,o,l,h){var c=h*(e-r)/2+l*(t-n)/2,f=-l*(e-r)/2+h*(t-n)/2,u=a*a,d=o*o,p=c*c,v=f*f,g=u*d-u*v-d*p;g<0&&(g=0),g/=u*v+d*p,g=Math.sqrt(g)*(i===s?-1:1);var y=g*a/o*f,b=g*-o/a*c,_=h*y-l*b+(e+r)/2,m=l*y+h*b+(t+n)/2,x=(c-y)/a,S=(f-b)/o,w=(-c-y)/a,T=(-f-b)/o,N=Zu(1,0,x,S),A=Zu(x,S,w,T);return s===0&&A>0&&(A-=yn),s===1&&A<0&&(A+=yn),[_,m,N,A]}function k0(e,t){var r=1.3333333333333333*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),s=Math.cos(e+t),a=Math.sin(e+t);return[n,i,n-i*r,i+n*r,s+a*r,a-s*r,s,a]}var P0=function(t,r,n,i,s,a,o,l,h){var c=Math.sin(h*yn/360),f=Math.cos(h*yn/360),u=f*(t-n)/2+c*(r-i)/2,d=-c*(t-n)/2+f*(r-i)/2;if(u===0&&d===0)return[];if(o===0||l===0)return[];o=Math.abs(o),l=Math.abs(l);var p=u*u/(o*o)+d*d/(l*l);p>1&&(o*=Math.sqrt(p),l*=Math.sqrt(p));var v=C0(t,r,n,i,s,a,o,l,c,f),g=[],y=v[2],b=v[3],_=Math.max(Math.ceil(Math.abs(b)/(yn/4)),1);b/=_;for(var m=0;m<_;m++)g.push(k0(y,b)),y+=b;return g.map(function(x){for(var S=0;S<x.length;S+=2){var w=x[S+0],T=x[S+1];w*=o,T*=l;var N=f*w-c*T,A=c*w+f*T;x[S+0]=N+v[0],x[S+1]=A+v[1]}return x})},vn=1e-10,Qu=Math.PI/180;function mn(e,t,r){if(!(this instanceof mn))return new mn(e,t,r);this.rx=e,this.ry=t,this.ax=r}mn.prototype.transform=function(e){var t=Math.cos(this.ax*Qu),r=Math.sin(this.ax*Qu),n=[this.rx*(e[0]*t+e[2]*r),this.rx*(e[1]*t+e[3]*r),this.ry*(-e[0]*r+e[2]*t),this.ry*(-e[1]*r+e[3]*t)],i=n[0]*n[0]+n[2]*n[2],s=n[1]*n[1]+n[3]*n[3],a=((n[0]-n[3])*(n[0]-n[3])+(n[2]+n[1])*(n[2]+n[1]))*((n[0]+n[3])*(n[0]+n[3])+(n[2]-n[1])*(n[2]-n[1])),o=(i+s)/2;if(a<vn*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var l=n[0]*n[1]+n[2]*n[3];a=Math.sqrt(a);var h=o+a/2,c=o-a/2;return this.ax=Math.abs(l)<vn&&Math.abs(h-s)<vn?90:Math.atan(Math.abs(l)>Math.abs(h-s)?(h-i)/l:l/(h-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(h)),this},mn.prototype.isDegenerate=function(){return this.rx<vn*this.ry||this.ry<vn*this.rx};var M0=mn,L0=T0,F0=N0,Ge=Ku,B0=P0,D0=M0;function Mt(e){if(!(this instanceof Mt))return new Mt(e);var t=L0(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}Mt.from=function(e){if(typeof e=="string")return new Mt(e);if(e instanceof Mt){var t=new Mt("");return t.err=e.err,t.segments=e.segments.map(function(r){return r.slice()}),t.__stack=e.__stack.map(function(r){return Ge().matrix(r.toArray())}),t}throw new Error("SvgPath.from: invalid param type "+e)},Mt.prototype.__matrix=function(e){var t=this,r;e.queue.length&&this.iterate(function(n,i,s,a){var o,l,h,c;switch(n[0]){case"v":o=e.calc(0,n[1],!0),l=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=e.calc(s,n[1],!1),l=o[0]===e.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=e.calc(n[1],0,!0),l=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=e.calc(n[1],a,!1),l=o[1]===e.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var f=e.toArray(),u=D0(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),o=e.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===s&&n[7]===a||n[0]==="a"&&n[6]===0&&n[7]===0){l=[n[0]==="a"?"l":"L",o[0],o[1]];break}u.isDegenerate()?l=[n[0]==="a"?"l":"L",o[0],o[1]]:l=[n[0],u.rx,u.ry,u.ax,n[4],n[5],o[0],o[1]];break;case"m":c=i>0,o=e.calc(n[1],n[2],c),l=["m",o[0],o[1]];break;default:for(h=n[0],l=[h],c=h.toLowerCase()===h,r=1;r<n.length;r+=2)o=e.calc(n[r],n[r+1],c),l.push(o[0],o[1])}t.segments[i]=l},!0)},Mt.prototype.__evaluateStack=function(){var e,t;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(e=Ge(),t=this.__stack.length;--t>=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},Mt.prototype.toString=function(){var e="",t="",r=!1;this.__evaluateStack();for(var n=0,i=this.segments.length;n<i;n++){var s=this.segments[n],a=s[0];a!==t||a==="m"||a==="M"?(a==="m"&&t==="z"&&(e+=" "),e+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var l=s[o];o===1?r&&l>=0&&(e+=" "):l>=0&&(e+=" "),e+=l}t=a}return e},Mt.prototype.translate=function(e,t){return this.__stack.push(Ge().translate(e,t||0)),this},Mt.prototype.scale=function(e,t){return this.__stack.push(Ge().scale(e,!t&&t!==0?e:t)),this},Mt.prototype.rotate=function(e,t,r){return this.__stack.push(Ge().rotate(e,t||0,r||0)),this},Mt.prototype.skewX=function(e){return this.__stack.push(Ge().skewX(e)),this},Mt.prototype.skewY=function(e){return this.__stack.push(Ge().skewY(e)),this},Mt.prototype.matrix=function(e){return this.__stack.push(Ge().matrix(e)),this},Mt.prototype.transform=function(e){return e.trim()?(this.__stack.push(F0(e)),this):this},Mt.prototype.round=function(e){var t=0,r=0,n=0,i=0,s;return e=e||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=n),n=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"V":case"v":o&&(a[1]+=i),i=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"Z":case"z":n=t,i=r;return;case"M":case"m":o&&(a[1]+=n,a[2]+=i),n=a[1]-a[1].toFixed(e),i=a[2]-a[2].toFixed(e),t=n,r=i,a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e);return;case"A":case"a":o&&(a[6]+=n,a[7]+=i),n=a[6]-a[6].toFixed(e),i=a[7]-a[7].toFixed(e),a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e),a[3]=+a[3].toFixed(e+2),a[6]=+a[6].toFixed(e),a[7]=+a[7].toFixed(e);return;default:s=a.length,o&&(a[s-2]+=n,a[s-1]+=i),n=a[s-2]-a[s-2].toFixed(e),i=a[s-1]-a[s-1].toFixed(e),a.forEach(function(l,h){h&&(a[h]=+a[h].toFixed(e))});return}}),this},Mt.prototype.iterate=function(e,t){var r=this.segments,n={},i=!1,s=0,a=0,o=0,l=0,h,c,f;if(t||this.__evaluateStack(),r.forEach(function(u,d){var p=e(u,d,s,a);Array.isArray(p)&&(n[d]=p,i=!0);var v=u[0]===u[0].toLowerCase();switch(u[0]){case"m":case"M":s=u[1]+(v?s:0),a=u[2]+(v?a:0),o=s,l=a;return;case"h":case"H":s=u[1]+(v?s:0);return;case"v":case"V":a=u[1]+(v?a:0);return;case"z":case"Z":s=o,a=l;return;default:s=u[u.length-2]+(v?s:0),a=u[u.length-1]+(v?a:0)}}),!i)return this;for(f=[],h=0;h<r.length;h++)if(typeof n[h]<"u")for(c=0;c<n[h].length;c++)f.push(n[h][c]);else f.push(r[h]);return this.segments=f,this},Mt.prototype.abs=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toUpperCase(),a;if(i!==s)switch(e[0]=s,i){case"v":e[1]+=n;return;case"a":e[6]+=r,e[7]+=n;return;default:for(a=1;a<e.length;a++)e[a]+=a%2?r:n}},!0),this},Mt.prototype.rel=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toLowerCase(),a;if(i!==s&&!(t===0&&i==="M"))switch(e[0]=s,i){case"V":e[1]-=n;return;case"A":e[6]-=r,e[7]-=n;return;default:for(a=1;a<e.length;a++)e[a]-=a%2?r:n}},!0),this},Mt.prototype.unarc=function(){return this.iterate(function(e,t,r,n){var i,s,a,o=[],l=e[0];return l!=="A"&&l!=="a"?null:(l==="a"?(s=r+e[6],a=n+e[7]):(s=e[6],a=e[7]),i=B0(r,n,s,a,e[4],e[5],e[1],e[2],e[3]),i.length===0?[[e[0]==="a"?"l":"L",e[6],e[7]]]:(i.forEach(function(h){o.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),o))}),this},Mt.prototype.unshort=function(){var e=this.segments,t,r,n,i,s;return this.iterate(function(a,o,l,h){var c=a[0],f=c.toUpperCase(),u;o&&(f==="T"?(u=c==="t",n=e[o-1],n[0]==="Q"?(t=n[1]-l,r=n[2]-h):n[0]==="q"?(t=n[1]-n[3],r=n[2]-n[4]):(t=0,r=0),i=-t,s=-r,u||(i+=l,s+=h),e[o]=[u?"q":"Q",i,s,a[1],a[2]]):f==="S"&&(u=c==="s",n=e[o-1],n[0]==="C"?(t=n[3]-l,r=n[4]-h):n[0]==="c"?(t=n[3]-n[5],r=n[4]-n[6]):(t=0,r=0),i=-t,s=-r,u||(i+=l,s+=h),e[o]=[u?"c":"C",i,s,a[1],a[2],a[3],a[4]]))}),this};var U0=Mt,j0=U0;const G0=or(j0),$0=e=>{const[t,r]=lt.useState(null),n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),{path:a,transformation:{x:o,y:l,width:h,height:c,anchor:f,fill:u,stroke:d="none",strokeWidth:p=0},pointerdown:v,pointerup:g,mousedown:y,mouseup:b,pointerover:_,mouseover:m,mouseout:x}=e,S=yt.useApp();return lt.useEffect(()=>{const w=G0(a).scale(5).translate(0,0).toString(),T=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${c}">
548
+ <path stroke="${d}" stroke-width="${p}" fill="${u}" d="${w}">
853
549
  </path>
854
- </svg>`,B=new YC(P),I=N.renderer.generateTexture(B);return r(I),()=>{}},[N,a,m,g,f]),$t.jsx(Eh,{...e,children:$t.jsx(qt.Container,{ref:i,children:$t.jsx(qt.Container,{ref:s,children:t&&$t.jsx(qt.Sprite,{texture:t,width:h,height:d,anchor:p,ref:n,x:o,y:c,interactive:!0,pointerdown:v,pointerup:b,pointerover:S,mousedown:_,mouseup:w,mouseover:x,mouseout:A})})})})};let Ty;function TO(e){return Ty=e,e}function xa(){return Ty}let EO=0;const Ih=class extends _n{constructor(e){super(),this.id=EO++,this.init(e)}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case"speed":this.speed=t;break;case"volume":this.volume=t;break;case"paused":this.paused=t;break;case"loop":this.loop=t;break;case"muted":this.muted=t;break}return this}get progress(){const{currentTime:e}=this._source;return e/this._duration}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused()}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(e){this._playing=!1,this._duration=e.source.duration;const t=this._source=e.source.cloneNode(!1);t.src=e.parent.url,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),e.context.on("refresh",this.refresh,this),e.context.on("refreshPaused",this.refreshPaused,this),this._media=e}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._internalStop(),this._source&&this.emit("stop")}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh()}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh()}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh()}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh()}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters")}refresh(){const e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;const r=e.volume*(e.muted?0:1),n=t.volume*(t.muted?0:1),i=this._volume*(this._muted?0:1);this._source.volume=i*r*n,this._source.playbackRate=this._speed*e.speed*t.speed}refreshPaused(){const e=this._media.context,t=this._media.parent,r=this._paused||t.paused||e.paused;r!==this._pausedReal&&(this._pausedReal=r,r?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",r))}play(e){const{start:t,end:r,speed:n,loop:i,volume:s,muted:a}=e;r&&console.assert(r>t,"End time is before start time"),this._speed=n,this._volume=s,this._loop=!!i,this._muted=a,this.refresh(),this.loop&&r!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=t,this._end=r||this._duration,this._start=Math.max(0,this._start-Ih.PADDING),this._end=Math.min(this._end+Ih.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t,this._duration),me.shared.add(this._onUpdate,this))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete()}_onComplete(){me.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)}destroy(){me.shared.remove(this._onUpdate,this),this.removeAllListeners();const e=this._source;e&&(e.onended=null,e.onplay=null,e.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)}toString(){return`[HTMLAudioInstance id=${this.id}]`}};let Ey=Ih;Ey.PADDING=.1;class AO extends _n{init(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)}create(){return new Ey(this)}get isPlayable(){return!!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(t){console.warn("HTML Audio does not support filters")}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)}get source(){return this._source}load(t){const r=this._source,n=this.parent;if(r.readyState===4){n.isLoaded=!0;const c=n.autoPlayStart();t&&setTimeout(()=>{t(null,n,c)},0);return}if(!n.url){t(new Error("sound.url or sound.source must be set"));return}r.src=n.url;const i=()=>{o(),n.isLoaded=!0;const c=n.autoPlayStart();t&&t(null,n,c)},s=()=>{o(),t&&t(new Error("Sound loading has been aborted"))},a=()=>{o();const c=`Failed to load audio element (code: ${r.error.code})`;t?t(new Error(c)):console.error(c)},o=()=>{r.removeEventListener("canplaythrough",i),r.removeEventListener("load",i),r.removeEventListener("abort",s),r.removeEventListener("error",a)};r.addEventListener("canplaythrough",i,!1),r.addEventListener("load",i,!1),r.addEventListener("abort",s,!1),r.addEventListener("error",a,!1),r.load()}}class CO{constructor(t,r){this.parent=t,Object.assign(this,r),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time")}play(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null}}const gl=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],OO=["audio/mpeg","audio/ogg"],kh={};function PO(e){const t={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...e||{}},r=document.createElement("audio"),n={},i=/^no$/;gl.forEach(s=>{const a=r.canPlayType(`audio/${s}`).replace(i,""),o=t[s]?r.canPlayType(t[s]).replace(i,""):"";n[s]=!!a||!!o}),Object.assign(kh,n)}PO();class Rh{static setParamValue(t,r){if(t.setValueAtTime){const n=xa().context;t.setValueAtTime(r,n.audioContext.currentTime)}else t.value=r;return r}}let IO=0;class kO extends _n{constructor(t){super(),this.id=IO++,this._media=null,this._paused=!1,this._muted=!1,this._elapsed=0,this.init(t)}set(t,r){if(this[t]===void 0)throw new Error(`Property with name ${t} does not exist.`);switch(t){case"speed":this.speed=r;break;case"volume":this.volume=r;break;case"muted":this.muted=r;break;case"loop":this.loop=r;break;case"paused":this.paused=r;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"))}get speed(){return this._speed}set speed(t){this._speed=t,this.refresh(),this._update(!0)}get volume(){return this._volume}set volume(t){this._volume=t,this.refresh()}get muted(){return this._muted}set muted(t){this._muted=t,this.refresh()}get loop(){return this._loop}set loop(t){this._loop=t,this.refresh()}get filters(){return this._filters}set filters(t){var r;this._filters&&((r=this._filters)==null||r.filter(n=>n).forEach(n=>n.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=t!=null&&t.length?t.slice(0):null,this.refresh()}refresh(){if(!this._source)return;const t=this._media.context,r=this._media.parent;this._source.loop=this._loop||r.loop;const n=t.volume*(t.muted?0:1),i=r.volume*(r.muted?0:1),s=this._volume*(this._muted?0:1);Rh.setParamValue(this._gain.gain,s*i*n),Rh.setParamValue(this._source.playbackRate,this._speed*r.speed*t.speed),this.applyFilters()}applyFilters(){var t;if((t=this._filters)!=null&&t.length){this._source.disconnect();let r=this._source;this._filters.forEach(n=>{r.connect(n.destination),r=n}),r.connect(this._gain)}}refreshPaused(){const t=this._media.context,r=this._media.parent,n=this._paused||r.paused||t.paused;n!==this._pausedReal&&(this._pausedReal=n,n?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",n))}play(t){const{start:r,end:n,speed:i,loop:s,volume:a,muted:o,filters:c}=t;n&&console.assert(n>r,"End time is before start time"),this._paused=!1;const{source:h,gain:d}=this._media.nodes.cloneBufferSource();this._source=h,this._gain=d,this._speed=i,this._volume=a,this._loop=!!s,this._muted=o,this._filters=c,this.refresh();const p=this._source.buffer.duration;this._duration=p,this._end=n,this._lastUpdate=this._now(),this._elapsed=r,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=n,this._source.loopStart=r,this._source.start(0,r)):n?this._source.start(0,r,n-r):this._source.start(0,r),this.emit("start"),this._update(!0),this.enableTicker(!0)}enableTicker(t){me.shared.remove(this._updateListener,this),t&&me.shared.add(this._updateListener,this)}get progress(){return this._progress}get paused(){return this._paused}set paused(t){this._paused=t,this.refreshPaused()}destroy(){var t;this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),(t=this._filters)==null||t.forEach(r=>r.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}toString(){return`[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update()}_update(t=!1){if(this._source){const r=this._now(),n=r-this._lastUpdate;if(n>0||t){const i=this._source.playbackRate.value;this._elapsed+=n*i,this._lastUpdate=r;const s=this._duration;let a;if(this._source.loopStart){const o=this._source.loopEnd-this._source.loopStart;a=(this._source.loopStart+this._elapsed%o)/s}else a=this._elapsed%s/s;this._progress=a,this.emit("progress",this._progress,s)}}}init(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)}_internalStop(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}this._source=null}}_onComplete(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)}}class Ay{constructor(t,r){this._output=r,this._input=t}get destination(){return this._input}get filters(){return this._filters}set filters(t){if(this._filters&&(this._filters.forEach(r=>{r&&r.disconnect()}),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();let r=null;t.forEach(n=>{r===null?this._input.connect(n.destination):r.connect(n.destination),r=n}),r.connect(this._output)}}destroy(){this.filters=null,this._input=null,this._output=null}}const Cy=class extends Ay{constructor(e){const t=e.audioContext,r=t.createBufferSource(),n=t.createGain(),i=t.createAnalyser();r.connect(i),i.connect(n),n.connect(e.destination),super(i,n),this.context=e,this.bufferSource=r,this.gain=n,this.analyser=i}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(Cy.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null}cloneBufferSource(){const e=this.bufferSource,t=this.context.audioContext.createBufferSource();t.buffer=e.buffer,Rh.setParamValue(t.playbackRate,e.playbackRate.value),t.loop=e.loop;const r=this.context.audioContext.createGain();return t.connect(r),r.connect(this.destination),{source:t,gain:r}}get bufferSize(){return this.script.bufferSize}};let Oy=Cy;Oy.BUFFER_SIZE=0;class RO{init(t){this.parent=t,this._nodes=new Oy(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}this._source=null,this.source=null}create(){return new kO(this)}get context(){return this.parent.context}get isPlayable(){return!!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(t){this._nodes.filters=t}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(t){this._source.buffer=t}get nodes(){return this._nodes}load(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t?t(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set")}async _loadUrl(t){const r=this.parent.url,n=await Pt.ADAPTER.fetch(r);this._decode(await n.arrayBuffer(),t)}_decode(t,r){const n=(i,s)=>{if(i)r&&r(i);else{this.parent.isLoaded=!0,this.buffer=s;const a=this.parent.autoPlayStart();r&&r(null,this.parent,a)}};t instanceof AudioBuffer?n(null,t):this.parent.context.decode(t,n)}}const ds=class{static from(e){let t={};typeof e=="string"?t.url=e:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?t.source=e:Array.isArray(e)?t.url=e:t=e,t={autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1,...t},Object.freeze(t);const r=xa().useLegacy?new AO:new RO;return new ds(r,t)}constructor(e,t){this.media=e,this.options=t,this._instances=[],this._sprites={},this.media.init(this);const r=t.complete;this._autoPlayOptions=r?{complete:r}:null,this.isLoaded=!1,this._preloadQueue=null,this.isPlaying=!1,this.autoPlay=t.autoPlay,this.singleInstance=t.singleInstance,this.preload=t.preload||this.autoPlay,this.url=Array.isArray(t.url)?this.preferUrl(t.url):t.url,this.speed=t.speed,this.volume=t.volume,this.loop=t.loop,t.sprites&&this.addSprites(t.sprites),this.preload&&this._preload(t.loaded)}preferUrl(e){const[{url:t}]=e.map(r=>({url:r,ext:Ye.extname(r).slice(1)})).sort((r,n)=>gl.indexOf(r.ext)-gl.indexOf(n.ext));return t}get context(){return xa().context}pause(){return this.isPlaying=!1,this.paused=!0,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=!1,this}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused()}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh()}get filters(){return this.media.filters}set filters(e){this.media.filters=e}addSprites(e,t){if(typeof e=="object"){const n={};for(const i in e)n[i]=this.addSprites(i,e[i]);return n}console.assert(!this._sprites[e],`Alias ${e} is already taken`);const r=new CO(this,t);return this._sprites[e]=r,r}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null}removeSprites(e){if(e){const t=this._sprites[e];t!==void 0&&(t.destroy(),delete this._sprites[e])}else for(const t in this._sprites)this.removeSprites(t);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(let e=this._instances.length-1;e>=0;e--)this._instances[e].stop();return this}play(e,t){let r;if(typeof e=="string"?r={sprite:e,loop:this.loop,complete:t}:typeof e=="function"?(r={},r.complete=e):r=e,r={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1,...r||{}},r.sprite){const i=r.sprite;console.assert(!!this._sprites[i],`Alias ${i} is not available`);const s=this._sprites[i];r.start=s.start+(r.start||0),r.end=s.end,r.speed=s.speed||1,r.loop=s.loop||r.loop,delete r.sprite}if(r.offset&&(r.start=r.offset),!this.isLoaded)return this._preloadQueue?new Promise(i=>{this._preloadQueue.push(()=>{i(this.play(r))})}):(this._preloadQueue=[],this.autoPlay=!0,this._autoPlayOptions=r,new Promise((i,s)=>{this._preload((a,o,c)=>{this._preloadQueue.forEach(h=>h()),this._preloadQueue=null,a?s(a):(r.loaded&&r.loaded(a,o,c),i(c))})}));(this.singleInstance||r.singleInstance)&&this._removeInstances();const n=this._createInstance();return this._instances.push(n),this.isPlaying=!0,n.once("end",()=>{r.complete&&r.complete(this),this._onComplete(n)}),n.once("stop",()=>{this._onComplete(n)}),n.play(r),n}refresh(){const e=this._instances.length;for(let t=0;t<e;t++)this._instances[t].refresh()}refreshPaused(){const e=this._instances.length;for(let t=0;t<e;t++)this._instances[t].refreshPaused()}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh()}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh()}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh()}_preload(e){this.media.load(e)}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let e;return this.autoPlay&&(e=this.play(this._autoPlayOptions)),e}_removeInstances(){for(let e=this._instances.length-1;e>=0;e--)this._poolInstance(this._instances[e]);this._instances.length=0}_onComplete(e){if(this._instances){const t=this._instances.indexOf(e);t>-1&&this._instances.splice(t,1),this.isPlaying=this._instances.length>0}this._poolInstance(e)}_createInstance(){if(ds._pool.length>0){const e=ds._pool.pop();return e.init(this.media),e}return this.media.create()}_poolInstance(e){e.destroy(),ds._pool.indexOf(e)<0&&ds._pool.push(e)}};let wa=ds;wa._pool=[];class NO extends _n{constructor(){super(...arguments),this.speed=1,this.muted=!1,this.volume=1,this.paused=!1}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(t){console.warn("HTML Audio does not support filters")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners()}}class Sa extends Ay{constructor(){const t=window,r=new Sa.AudioContext,n=r.createDynamicsCompressor(),i=r.createAnalyser();i.connect(n),n.connect(r.destination),super(i,n),this.autoPause=!0,this._ctx=r,this._offlineCtx=new Sa.OfflineAudioContext(1,2,t.OfflineAudioContext?Math.max(8e3,Math.min(96e3,r.sampleRate)):44100),this.compressor=n,this.analyser=i,this.events=new _n,this.volume=1,this.speed=1,this.muted=!1,this.paused=!1,this._locked=r.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur)}onFocus(){if(!this.autoPause)return;const t=this._ctx.state;(t==="suspended"||t==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))}playEmptySound(){const t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),t.context.state==="suspended"&&t.context.resume()}static get AudioContext(){const t=window;return t.AudioContext||t.webkitAudioContext||null}static get OfflineAudioContext(){const t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null}destroy(){super.destroy();const t=this._ctx;typeof t.close<"u"&&t.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(t){t&&this._ctx.state==="running"?this._ctx.suspend():!t&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=t}get paused(){return this._paused}refresh(){this.events.emit("refresh")}refreshPaused(){this.events.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(t,r){const n=s=>{r(new Error((s==null?void 0:s.message)||"Unable to decode file"))},i=this._offlineCtx.decodeAudioData(t,s=>{r(null,s)},n);i&&i.catch(n)}}class MO{constructor(){this.init()}init(){return this.supported&&(this._webAudioContext=new Sa),this._htmlAudioContext=new NO,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(t){this.useLegacy||(this._context.filters=t)}get supported(){return Sa.AudioContext!==null}add(t,r){if(typeof t=="object"){const s={};for(const a in t){const o=this._getOptions(t[a],r);s[a]=this.add(a,o)}return s}if(console.assert(!this._sounds[t],`Sound with alias ${t} already exists.`),r instanceof wa)return this._sounds[t]=r,r;const n=this._getOptions(r),i=wa.from(n);return this._sounds[t]=i,i}_getOptions(t,r){let n;return typeof t=="string"?n={url:t}:Array.isArray(t)?n={url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?n={source:t}:n=t,n={...n,...r||{}},n}get useLegacy(){return this._useLegacy}set useLegacy(t){this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext}get disableAutoPause(){return!this._webAudioContext.autoPause}set disableAutoPause(t){this._webAudioContext.autoPause=!t}remove(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this}get volumeAll(){return this._context.volume}set volumeAll(t){this._context.volume=t,this._context.refresh()}get speedAll(){return this._context.speed}set speedAll(t){this._context.speed=t,this._context.refresh()}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=!0,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=!1,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=!0,this._context.refresh(),this}unmuteAll(){return this._context.muted=!1,this._context.refresh(),this}removeAll(){for(const t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this}stopAll(){for(const t in this._sounds)this._sounds[t].stop();return this}exists(t,r=!1){const n=!!this._sounds[t];return r&&console.assert(n,`No sound matching alias '${t}'.`),n}isPlaying(){for(const t in this._sounds)if(this._sounds[t].isPlaying)return!0;return!1}find(t){return this.exists(t,!0),this._sounds[t]}play(t,r){return this.find(t).play(r)}stop(t){return this.find(t).stop()}pause(t){return this.find(t).pause()}resume(t){return this.find(t).resume()}volume(t,r){const n=this.find(t);return r!==void 0&&(n.volume=r),n.volume}speed(t,r){const n=this.find(t);return r!==void 0&&(n.speed=r),n.speed}duration(t){return this.find(t).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}}const Py=e=>{var r;const t=e.src;return((r=e==null?void 0:e.alias)==null?void 0:r[0])??Ye.basename(t,Ye.extname(t))},LO={extension:Et.Asset,detection:{test:async()=>!0,add:async e=>[...e,...gl.filter(t=>kh[t])],remove:async e=>e.filter(t=>e.includes(t))},loader:{extension:{type:[Et.LoadParser],priority:$n.High},test(e){const t=Ye.extname(e).slice(1);return!!kh[t]||OO.some(r=>e.startsWith(`data:${r}`))},async load(e,t){const r=await new Promise((n,i)=>wa.from({...t.data,url:e,preload:!0,loaded(s,a){var o,c;s?i(s):n(a),(c=(o=t.data)==null?void 0:o.loaded)==null||c.call(o,s,a)}}));return xa().add(Py(t),r),r},async unload(e,t){xa().remove(Py(t))}}};Bt.add(LO),TO(new MO);const BO=e=>{const t={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=Mt.useState(!1),n=dt.useRef(t);console.log("allProps",e);const i=dt.useRef(null),s=dt.useRef(null),{tl:a,playerTimeRef:o}=dt.useContext(us),{uniqueId:c,src:h,startAt:d,endAt:p,mute:f,speed:m}=e,g=Mt.useRef(null);fa(Gn.PAUSE,()=>{var x;console.log("pause event"),i.current&&((x=g.current)==null||x.pause(),n.current.isPlaying=!1)});const v=x=>{var A;i.current&&(console.log("audio gsapOnStart",x),o.current>=x&&o.current<=p&&((A=g.current)==null||A.play({volume:f?0:1,start:x,end:p,speed:m||1}),n.current.isPlaying=!0,n.current.completed=!1))},b=()=>{var x;i.current&&(console.log("audio gsapOnStart",d),(x=g.current)==null||x.stop(),n.current.isPlaying=!1,n.current.completed=!0)},_=x=>{var A,N,O;i.current&&!n.current.isPlaying&&!n.current.completed&&(console.log("audio gsapOnUpdate",x),(A=g.current)==null||A.refresh(),(N=g.current)==null||N.refreshPaused(),(O=g.current)==null||O.resume(),n.current.isPlaying=!0)},w=()=>{};dt.useEffect(()=>{let x=Wr.context(()=>{});if(i.current&&a.current){const A={duration:Number(p)-Number(d),onStart:v,onComplete:b,onStartParams:[d],onCompleteParams:[],onInterrupt:w,onUpdate:_,onUpdateParams:[]};x=Wr.context(()=>{a.current.to(i.current,{alpha:1,duration:.01},d).from(s.current,{...A},d).to(i.current,{alpha:0,duration:.1},Number(p)-.1)})}return()=>x.revert()},[d,p]),Mt.useEffect(()=>{i.current&&r(!0)},[]),Mt.useEffect(()=>{i.current&&g.current&&(console.log("soundref",g.current),n.current.mute=f,n.current.speed=m,console.log("containerAudio",g.current.volume),g.current.volume=f?0:1)},[f,m]);const S=Mt.useCallback((x,A)=>{g.current=A,n.current.loaded=!0},[]);return Mt.useEffect(()=>(gr(h)||(g.current=wa.from({url:h,preload:!0,singleInstance:!0,loaded:S})),()=>{}),[c,h,S]),$t.jsx(qt.Container,{ref:i})};function FO(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Iy=FO;function DO(){this.__data__=[],this.size=0}var UO=DO;function jO(e,t){return e===t||e!==e&&t!==t}var ky=jO,$O=ky;function zO(e,t){for(var r=e.length;r--;)if($O(e[r][0],t))return r;return-1}var yl=zO,HO=yl,GO=Array.prototype,qO=GO.splice;function VO(e){var t=this.__data__,r=HO(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():qO.call(t,r,1),--this.size,!0}var WO=VO,XO=yl;function YO(e){var t=this.__data__,r=XO(t,e);return r<0?void 0:t[r][1]}var KO=YO,ZO=yl;function QO(e){return ZO(this.__data__,e)>-1}var JO=QO,tP=yl;function eP(e,t){var r=this.__data__,n=tP(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var rP=eP,nP=UO,iP=WO,sP=KO,aP=JO,oP=rP;function ps(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ps.prototype.clear=nP,ps.prototype.delete=iP,ps.prototype.get=sP,ps.prototype.has=aP,ps.prototype.set=oP;var vl=ps,lP=vl;function uP(){this.__data__=new lP,this.size=0}var cP=uP;function hP(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var fP=hP;function dP(e){return this.__data__.get(e)}var pP=dP;function mP(e){return this.__data__.has(e)}var gP=mP,yP=cs,vP=yP(Object,"create"),_l=vP,Ry=_l;function _P(){this.__data__=Ry?Ry(null):{},this.size=0}var bP=_P;function xP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var wP=xP,SP=_l,TP="__lodash_hash_undefined__",EP=Object.prototype,AP=EP.hasOwnProperty;function CP(e){var t=this.__data__;if(SP){var r=t[e];return r===TP?void 0:r}return AP.call(t,e)?t[e]:void 0}var OP=CP,PP=_l,IP=Object.prototype,kP=IP.hasOwnProperty;function RP(e){var t=this.__data__;return PP?t[e]!==void 0:kP.call(t,e)}var NP=RP,MP=_l,LP="__lodash_hash_undefined__";function BP(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=MP&&t===void 0?LP:t,this}var FP=BP,DP=bP,UP=wP,jP=OP,$P=NP,zP=FP;function ms(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ms.prototype.clear=DP,ms.prototype.delete=UP,ms.prototype.get=jP,ms.prototype.has=$P,ms.prototype.set=zP;var HP=ms,Ny=HP,GP=vl,qP=mh;function VP(){this.size=0,this.__data__={hash:new Ny,map:new(qP||GP),string:new Ny}}var WP=VP;function XP(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var YP=XP,KP=YP;function ZP(e,t){var r=e.__data__;return KP(t)?r[typeof t=="string"?"string":"hash"]:r.map}var bl=ZP,QP=bl;function JP(e){var t=QP(this,e).delete(e);return this.size-=t?1:0,t}var tI=JP,eI=bl;function rI(e){return eI(this,e).get(e)}var nI=rI,iI=bl;function sI(e){return iI(this,e).has(e)}var aI=sI,oI=bl;function lI(e,t){var r=oI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var uI=lI,cI=WP,hI=tI,fI=nI,dI=aI,pI=uI;function gs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gs.prototype.clear=cI,gs.prototype.delete=hI,gs.prototype.get=fI,gs.prototype.has=dI,gs.prototype.set=pI;var Nh=gs,mI=vl,gI=mh,yI=Nh,vI=200;function _I(e,t){var r=this.__data__;if(r instanceof mI){var n=r.__data__;if(!gI||n.length<vI-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new yI(n)}return r.set(e,t),this.size=r.size,this}var bI=_I,xI=vl,wI=cP,SI=fP,TI=pP,EI=gP,AI=bI;function ys(e){var t=this.__data__=new xI(e);this.size=t.size}ys.prototype.clear=wI,ys.prototype.delete=SI,ys.prototype.get=TI,ys.prototype.has=EI,ys.prototype.set=AI;var My=ys,CI="__lodash_hash_undefined__";function OI(e){return this.__data__.set(e,CI),this}var PI=OI;function II(e){return this.__data__.has(e)}var kI=II,RI=Nh,NI=PI,MI=kI;function xl(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new RI;++t<r;)this.add(e[t])}xl.prototype.add=xl.prototype.push=NI,xl.prototype.has=MI;var LI=xl;function BI(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var FI=BI;function DI(e,t){return e.has(t)}var UI=DI,jI=LI,$I=FI,zI=UI,HI=1,GI=2;function qI(e,t,r,n,i,s){var a=r&HI,o=e.length,c=t.length;if(o!=c&&!(a&&c>o))return!1;var h=s.get(e),d=s.get(t);if(h&&d)return h==t&&d==e;var p=-1,f=!0,m=r&GI?new jI:void 0;for(s.set(e,t),s.set(t,e);++p<o;){var g=e[p],v=t[p];if(n)var b=a?n(v,g,p,t,e,s):n(g,v,p,e,t,s);if(b!==void 0){if(b)continue;f=!1;break}if(m){if(!$I(t,function(_,w){if(!zI(m,w)&&(g===_||i(g,_,r,n,s)))return m.push(w)})){f=!1;break}}else if(!(g===v||i(g,v,r,n,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var Ly=qI,VI=An,WI=VI.Uint8Array,XI=WI;function YI(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var KI=YI;function ZI(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var QI=ZI,By=ul,Fy=XI,JI=ky,tk=Ly,ek=KI,rk=QI,nk=1,ik=2,sk="[object Boolean]",ak="[object Date]",ok="[object Error]",lk="[object Map]",uk="[object Number]",ck="[object RegExp]",hk="[object Set]",fk="[object String]",dk="[object Symbol]",pk="[object ArrayBuffer]",mk="[object DataView]",Dy=By?By.prototype:void 0,Mh=Dy?Dy.valueOf:void 0;function gk(e,t,r,n,i,s,a){switch(r){case mk:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case pk:return!(e.byteLength!=t.byteLength||!s(new Fy(e),new Fy(t)));case sk:case ak:case uk:return JI(+e,+t);case ok:return e.name==t.name&&e.message==t.message;case ck:case fk:return e==t+"";case lk:var o=ek;case hk:var c=n&nk;if(o||(o=rk),e.size!=t.size&&!c)return!1;var h=a.get(e);if(h)return h==t;n|=ik,a.set(e,t);var d=tk(o(e),o(t),n,i,s,a);return a.delete(e),d;case dk:if(Mh)return Mh.call(e)==Mh.call(t)}return!1}var yk=gk;function vk(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var _k=vk,bk=_k,xk=nn;function wk(e,t,r){var n=t(e);return xk(e)?n:bk(n,r(e))}var Sk=wk;function Tk(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}var Ek=Tk;function Ak(){return[]}var Ck=Ak,Ok=Ek,Pk=Ck,Ik=Object.prototype,kk=Ik.propertyIsEnumerable,Uy=Object.getOwnPropertySymbols,Rk=Uy?function(e){return e==null?[]:(e=Object(e),Ok(Uy(e),function(t){return kk.call(e,t)}))}:Pk,Nk=Rk;function Mk(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Lk=Mk,Bk=9007199254740991,Fk=/^(?:0|[1-9]\d*)$/;function Dk(e,t){var r=typeof e;return t=t??Bk,!!t&&(r=="number"||r!="symbol"&&Fk.test(e))&&e>-1&&e%1==0&&e<t}var jy=Dk,Uk=Lk,jk=xh,$k=nn,zk=Sh,Hk=jy,Gk=Th,qk=Object.prototype,Vk=qk.hasOwnProperty;function Wk(e,t){var r=$k(e),n=!r&&jk(e),i=!r&&!n&&zk(e),s=!r&&!n&&!i&&Gk(e),a=r||n||i||s,o=a?Uk(e.length,String):[],c=o.length;for(var h in e)(t||Vk.call(e,h))&&!(a&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Hk(h,c)))&&o.push(h);return o}var Xk=Wk,Yk=Xk,Kk=qg,Zk=cl;function Qk(e){return Zk(e)?Yk(e):Kk(e)}var Lh=Qk,Jk=Sk,tR=Nk,eR=Lh;function rR(e){return Jk(e,eR,tR)}var nR=rR,$y=nR,iR=1,sR=Object.prototype,aR=sR.hasOwnProperty;function oR(e,t,r,n,i,s){var a=r&iR,o=$y(e),c=o.length,h=$y(t),d=h.length;if(c!=d&&!a)return!1;for(var p=c;p--;){var f=o[p];if(!(a?f in t:aR.call(t,f)))return!1}var m=s.get(e),g=s.get(t);if(m&&g)return m==t&&g==e;var v=!0;s.set(e,t),s.set(t,e);for(var b=a;++p<c;){f=o[p];var _=e[f],w=t[f];if(n)var S=a?n(w,_,f,t,e,s):n(_,w,f,e,t,s);if(!(S===void 0?_===w||i(_,w,r,n,s):S)){v=!1;break}b||(b=f=="constructor")}if(v&&!b){var x=e.constructor,A=t.constructor;x!=A&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof A=="function"&&A instanceof A)&&(v=!1)}return s.delete(e),s.delete(t),v}var lR=oR,Bh=My,uR=Ly,cR=yk,hR=lR,zy=ay,Hy=nn,Gy=Sh,fR=Th,dR=1,qy="[object Arguments]",Vy="[object Array]",wl="[object Object]",pR=Object.prototype,Wy=pR.hasOwnProperty;function mR(e,t,r,n,i,s){var a=Hy(e),o=Hy(t),c=a?Vy:zy(e),h=o?Vy:zy(t);c=c==qy?wl:c,h=h==qy?wl:h;var d=c==wl,p=h==wl,f=c==h;if(f&&Gy(e)){if(!Gy(t))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new Bh),a||fR(e)?uR(e,t,r,n,i,s):cR(e,t,c,r,n,i,s);if(!(r&dR)){var m=d&&Wy.call(e,"__wrapped__"),g=p&&Wy.call(t,"__wrapped__");if(m||g){var v=m?e.value():e,b=g?t.value():t;return s||(s=new Bh),i(v,b,r,n,s)}}return f?(s||(s=new Bh),hR(e,t,r,n,i,s)):!1}var gR=mR,yR=gR,Xy=ma;function Yy(e,t,r,n,i){return e===t?!0:e==null||t==null||!Xy(e)&&!Xy(t)?e!==e&&t!==t:yR(e,t,r,n,Yy,i)}var Ky=Yy,vR=My,_R=Ky,bR=1,xR=2;function wR(e,t,r,n){var i=r.length,s=i,a=!n;if(e==null)return!s;for(e=Object(e);i--;){var o=r[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=r[i];var c=o[0],h=e[c],d=o[1];if(a&&o[2]){if(h===void 0&&!(c in e))return!1}else{var p=new vR;if(n)var f=n(h,d,c,e,t,p);if(!(f===void 0?_R(d,h,bR|xR,n,p):f))return!1}}return!0}var SR=wR,TR=dh;function ER(e){return e===e&&!TR(e)}var Zy=ER,AR=Zy,CR=Lh;function OR(e){for(var t=CR(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,AR(i)]}return t}var PR=OR;function IR(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Qy=IR,kR=SR,RR=PR,NR=Qy;function MR(e){var t=RR(e);return t.length==1&&t[0][2]?NR(t[0][0],t[0][1]):function(r){return r===e||kR(r,e,t)}}var LR=MR,BR=pa,FR=ma,DR="[object Symbol]";function UR(e){return typeof e=="symbol"||FR(e)&&BR(e)==DR}var Fh=UR,jR=nn,$R=Fh,zR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,HR=/^\w*$/;function GR(e,t){if(jR(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$R(e)?!0:HR.test(e)||!zR.test(e)||t!=null&&e in Object(t)}var Dh=GR,Jy=Nh,qR="Expected a function";function Uh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(qR);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Uh.Cache||Jy),r}Uh.Cache=Jy;var VR=Uh,WR=VR,XR=500;function YR(e){var t=WR(e,function(n){return r.size===XR&&r.clear(),n}),r=t.cache;return t}var KR=YR,ZR=KR,QR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,JR=/\\(\\)?/g,tN=ZR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(QR,function(r,n,i,s){t.push(i?s.replace(JR,"$1"):n||r)}),t}),eN=tN,tv=ul,rN=Iy,nN=nn,iN=Fh,sN=1/0,ev=tv?tv.prototype:void 0,rv=ev?ev.toString:void 0;function nv(e){if(typeof e=="string")return e;if(nN(e))return rN(e,nv)+"";if(iN(e))return rv?rv.call(e):"";var t=e+"";return t=="0"&&1/e==-sN?"-0":t}var aN=nv,oN=aN;function lN(e){return e==null?"":oN(e)}var uN=lN,cN=nn,hN=Dh,fN=eN,dN=uN;function pN(e,t){return cN(e)?e:hN(e,t)?[e]:fN(dN(e))}var iv=pN,mN=Fh,gN=1/0;function yN(e){if(typeof e=="string"||mN(e))return e;var t=e+"";return t=="0"&&1/e==-gN?"-0":t}var Sl=yN,vN=iv,_N=Sl;function bN(e,t){t=vN(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[_N(t[r++])];return r&&r==n?e:void 0}var sv=bN,xN=sv;function wN(e,t,r){var n=e==null?void 0:xN(e,t);return n===void 0?r:n}var SN=wN;function TN(e,t){return e!=null&&t in Object(e)}var EN=TN,AN=iv,CN=xh,ON=nn,PN=jy,IN=wh,kN=Sl;function RN(e,t,r){t=AN(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=kN(t[n]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&IN(i)&&PN(a,i)&&(ON(e)||CN(e)))}var NN=RN,MN=EN,LN=NN;function BN(e,t){return e!=null&&LN(e,t,MN)}var FN=BN,DN=Ky,UN=SN,jN=FN,$N=Dh,zN=Zy,HN=Qy,GN=Sl,qN=1,VN=2;function WN(e,t){return $N(e)&&zN(t)?HN(GN(e),t):function(r){var n=UN(r,e);return n===void 0&&n===t?jN(r,e):DN(t,n,qN|VN)}}var XN=WN;function YN(e){return e}var KN=YN;function ZN(e){return function(t){return t==null?void 0:t[e]}}var QN=ZN,JN=sv;function tM(e){return function(t){return JN(t,e)}}var eM=tM,rM=QN,nM=eM,iM=Dh,sM=Sl;function aM(e){return iM(e)?rM(sM(e)):nM(e)}var oM=aM,lM=LR,uM=XN,cM=KN,hM=nn,fM=oM;function dM(e){return typeof e=="function"?e:e==null?cM:typeof e=="object"?hM(e)?uM(e[0],e[1]):lM(e):fM(e)}var pM=dM;function mM(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var c=a[e?o:++i];if(r(s[c],c,s)===!1)break}return t}}var gM=mM,yM=gM,vM=yM(),_M=vM,bM=_M,xM=Lh;function wM(e,t){return e&&bM(e,t,xM)}var SM=wM,TM=cl;function EM(e,t){return function(r,n){if(r==null)return r;if(!TM(r))return e(r,n);for(var i=r.length,s=t?i:-1,a=Object(r);(t?s--:++s<i)&&n(a[s],s,a)!==!1;);return r}}var AM=EM,CM=SM,OM=AM,PM=OM(CM),IM=PM,kM=IM,RM=cl;function NM(e,t){var r=-1,n=RM(e)?Array(e.length):[];return kM(e,function(i,s,a){n[++r]=t(i,s,a)}),n}var MM=NM,LM=Iy,BM=pM,FM=MM,DM=nn;function UM(e,t){var r=DM(e)?LM:FM;return r(e,BM(t))}var jM=UM;const $M=ni(jM);var Si={},av={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.loop=On.conditional=On.parse=void 0;var zM=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(r))r.forEach(function(a){return e(t,a,n,i)});else if(typeof r=="function")r(t,n,i,e);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(i[s]={},e(t,r[s],n,i[s])):i[s]=r[s](t,n,i,e)}return n};On.parse=zM;var HM=function(t,r){return function(n,i,s,a){r(n,i,s)&&a(n,t,i,s)}};On.conditional=HM;var GM=function(t,r){return function(n,i,s,a){for(var o=[],c=n.pos;r(n,i,s);){var h={};if(a(n,t,i,h),n.pos===c)break;c=n.pos,o.push(h)}return o}};On.loop=GM;var we={};Object.defineProperty(we,"__esModule",{value:!0}),we.readBits=we.readArray=we.readUnsigned=we.readString=we.peekBytes=we.readBytes=we.peekByte=we.readByte=we.buildStream=void 0;var qM=function(t){return{data:t,pos:0}};we.buildStream=qM;var ov=function(){return function(t){return t.data[t.pos++]}};we.readByte=ov;var VM=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};we.peekByte=VM;var Tl=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};we.readBytes=Tl;var WM=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};we.peekBytes=WM;var XM=function(t){return function(r){return Array.from(Tl(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};we.readString=XM;var YM=function(t){return function(r){var n=Tl(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};we.readUnsigned=YM;var KM=function(t,r){return function(n,i,s){for(var a=typeof r=="function"?r(n,i,s):r,o=Tl(t),c=new Array(a),h=0;h<a;h++)c[h]=o(n);return c}};we.readArray=KM;var ZM=function(t,r,n){for(var i=0,s=0;s<n;s++)i+=t[r+s]&&Math.pow(2,n-s-1);return i},QM=function(t){return function(r){for(var n=ov()(r),i=new Array(8),s=0;s<8;s++)i[7-s]=!!(n&1<<s);return Object.keys(t).reduce(function(a,o){var c=t[o];return c.length?a[o]=ZM(i,c.index,c.length):a[o]=i[c.index],a},{})}};we.readBits=QM,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=On,r=we,n={blocks:function(f){for(var m=0,g=[],v=f.data.length,b=0,_=(0,r.readByte)()(f);_!==m&&_;_=(0,r.readByte)()(f)){if(f.pos+_>=v){var w=v-f.pos;g.push((0,r.readBytes)(w)(f)),b+=w;break}g.push((0,r.readBytes)(_)(f)),b+=_}for(var S=new Uint8Array(b),x=0,A=0;A<g.length;A++)S.set(g[A],x),x+=g[A].length;return S}},i=(0,t.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(p){var f=(0,r.peekBytes)(2)(p);return f[0]===33&&f[1]===249}),s=(0,t.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,r.readArray)(3,function(p,f,m){return Math.pow(2,m.descriptor.lct.size+1)})},function(p,f,m){return m.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(p){return(0,r.peekByte)()(p)===44}),a=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(f,m,g){return(0,r.readBytes)(g.text.blockSize)(f)}},n]},function(p){var f=(0,r.peekBytes)(2)(p);return f[0]===33&&f[1]===1}),o=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(f,m,g){return(0,r.readString)(g.blockSize)(f)}},n]},function(p){var f=(0,r.peekBytes)(2)(p);return f[0]===33&&f[1]===255}),c=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(p){var f=(0,r.peekBytes)(2)(p);return f[0]===33&&f[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,t.conditional)({gct:(0,r.readArray)(3,function(p,f){return Math.pow(2,f.lsd.gct.size+1)})},function(p,f){return f.lsd.gct.exists}),{frames:(0,t.loop)([i,o,c,s,a],function(p){var f=(0,r.peekByte)()(p);return f===33||f===44})}],d=h;e.default=d}(av);var El={};Object.defineProperty(El,"__esModule",{value:!0}),El.deinterlace=void 0;var JM=function(t,r){for(var n=new Array(t.length),i=t.length/r,s=function(f,m){var g=t.slice(m*r,(m+1)*r);n.splice.apply(n,[f*r,r].concat(g))},a=[0,4,2,1],o=[8,8,4,2],c=0,h=0;h<4;h++)for(var d=a[h];d<i;d+=o[h])s(d,c),c++;return n};El.deinterlace=JM;var Al={};Object.defineProperty(Al,"__esModule",{value:!0}),Al.lzw=void 0;var tL=function(t,r,n){var i=4096,s=-1,a=n,o,c,h,d,p,f,m,N,g,v,A,b,O,P,I,B,_=new Array(n),w=new Array(i),S=new Array(i),x=new Array(i+1);for(b=t,c=1<<b,p=c+1,o=c+2,m=s,d=b+1,h=(1<<d)-1,g=0;g<c;g++)w[g]=0,S[g]=g;var A,N,O,P,B,I;for(A=N=O=P=B=I=0,v=0;v<a;){if(P===0){if(N<d){A+=r[I]<<N,N+=8,I++;continue}if(g=A&h,A>>=d,N-=d,g>o||g==p)break;if(g==c){d=b+1,h=(1<<d)-1,o=c+2,m=s;continue}if(m==s){x[P++]=S[g],m=g,O=g;continue}for(f=g,g==o&&(x[P++]=O,g=m);g>c;)x[P++]=S[g],g=w[g];O=S[g]&255,x[P++]=O,o<i&&(w[o]=m,S[o]=O,o++,!(o&h)&&o<i&&(d++,h+=o)),m=f}P--,_[B++]=x[P],v++}for(v=B;v<a;v++)_[v]=0;return _};Al.lzw=tL,Object.defineProperty(Si,"__esModule",{value:!0}),Si.decompressFrames=Si.decompressFrame=Si.parseGIF=void 0;var eL=aL(av),rL=On,nL=we,iL=El,sL=Al;function aL(e){return e&&e.__esModule?e:{default:e}}var oL=function(t){var r=new Uint8Array(t);return(0,rL.parse)((0,nL.buildStream)(r),eL.default)};Si.parseGIF=oL;var lL=function(t){for(var r=t.pixels.length,n=new Uint8ClampedArray(r*4),i=0;i<r;i++){var s=i*4,a=t.pixels[i],o=t.colorTable[a]||[0,0,0];n[s]=o[0],n[s+1]=o[1],n[s+2]=o[2],n[s+3]=a!==t.transparentIndex?255:0}return n},lv=function(t,r,n){if(!t.image){console.warn("gif frame does not have associated image.");return}var i=t.image,s=i.descriptor.width*i.descriptor.height,a=(0,sL.lzw)(i.data.minCodeSize,i.data.blocks,s);i.descriptor.lct.interlaced&&(a=(0,iL.deinterlace)(a,i.descriptor.width));var o={pixels:a,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return i.descriptor.lct&&i.descriptor.lct.exists?o.colorTable=i.lct:o.colorTable=r,t.gce&&(o.delay=(t.gce.delay||10)*10,o.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(o.transparentIndex=t.gce.transparentColorIndex)),n&&(o.patch=lL(o)),o};Si.decompressFrame=lv;var uL=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return lv(n,t.gct,r)})};Si.decompressFrames=uL;const uv=(e,t={})=>{typeof t=="function"&&(t=t(e));const r=t.loaded&&e.loaded!==t.loaded,{playing:n,...i}=t,s={...e,...i};return r&&Object.assign(s,{playing:s.autoPlay&&s.loaded}),(t.delays!=null||t.frames!=null)&&Object.assign(s,{length:s.frames.length}),(t.index!=null||t.frames!=null)&&Object.assign(s,{index:s.length===0?0:(s.length+s.index)%s.length}),t.playing!=null&&Object.assign(s,s.loaded?{playing:n}:{autoPlay:n}),s},cL=e=>uv({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),hL=e=>dt.useReducer(uv,e,cL);var fL='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function dL(e){const t=new Blob([fL],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const pL=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),mL=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),dt.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(t&&t(r.instance),delete r.instance,delete r.timeout)})}),[r,t]),r.instance)},gL=e=>{const t=dt.useRef(e);return dt.useEffect(()=>{t.current=e},[e]),t},yL=e=>{const t=gL(e);return dt.useCallback(r=>t.current&&t.current(r),[])},vL=mL(()=>new dL,e=>e.terminate()),_L=(e,t)=>{const r=yL(t),n=vL();dt.useEffect(()=>{if(typeof e=="string"){const i=s=>{const a=s.data||s;if(a.src===e){const o=a.error?a:pL(a);r(o)}};return n.addEventListener("message",i),n.postMessage({src:e,type:"parse"}),()=>{n.postMessage({src:e,type:"cancel"}),n.removeEventListener("message",i)}}},[n,e])},bL=({isPlaying:e,forwardRef:t,...r})=>{const n=Mt.useRef(null);return Mt.useImperativeHandle(t,()=>n.current,[n]),Mt.useEffect(()=>{if(n.current===null)return;const i=n.current;i[e?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[e]),$t.jsx(qt.AnimatedSprite,{ref:n,...r,isPlaying:e})},cv=Mt.memo(bL),xL=qt.withFilters(qt.Container,{blur:Ar.filters.BlurFilter,adjust:ah,matrix:Ar.filters.ColorMatrixFilter}),wL=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],SL={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},TL=e=>{const[t,r]=Mt.useState([]),[,n]=Mt.useState(0),[i,s]=Mt.useState([]),[,a]=dt.useState(0),[,o]=dt.useState(!1),[c,h]=dt.useState(!1),[,d]=dt.useState(!1),[p,f]=hL({autoPlay:!1}),m=Mt.useRef(null),g=dt.useRef(null),v=dt.useRef(null),b=dt.useRef(null),_=dt.useRef(null),w=dt.useRef(null),S=dt.useRef(SL),{tl:x}=dt.useContext(us),{frames:A,delays:N,loaded:O}=p,{uniqueId:P,src:B,startAt:I,endAt:C,initialAlpha:k,locked:M,loop:F,transformation:{width:$=0,height:V=0,x:q,y:X,rotation:G=0,scale:D,animation:L,colorCorrection:U,effect:H},pointerdown:Y,pointerup:K,mousedown:j,mouseup:W,pointerover:Q,mouseover:tt,mouseout:rt,pointerout:ct,applyTransformer:_t,onAnchorTransformationEnd:yt}=e,{contrast:Nt=1,saturation:Ft=1,exposure:ie=1,blurRadius:ne=0,alpha:nt=1}=U||{},at={brightness:ie,contrast:Nt,saturation:Ft,alpha:nt},gt=qt.useApp();_L(B,f),fa(Gn.PAUSE,Zt=>{console.log("pause event",Zt),g.current&&(g.current.stop(),S.current.isPlaying=!1)});const bt=Mt.useCallback(Zt=>{console.log("changeEnd",Zt),yt&&yt(Zt)},[]);Mt.useEffect(()=>{if(!gr(A)){const Zt=$M(A,lr=>{const{data:Ie,width:Cl,height:jh}=lr,$h=new Uint8Array(Ie);return Ar.Texture.fromBuffer($h,Cl,jh)}),Qt=Zt.map((lr,Ie)=>({texture:lr,time:N[Ie]}));r(Zt),s(Qt);let ye=0;N.forEach(lr=>{ye+=lr*10}),n(ye)}},[A,N]);const ht=Zt=>{g.current&&(g.current.gotoAndPlay(Zt||0),S.current.isPlaying=!0)},Dt=()=>{g.current&&(g.current.stop(),S.current.isPlaying=!1)},mt=()=>{g.current&&(g.current.stop(),S.current.isPlaying=!1)},It=()=>{g.current&&!S.current.isPlaying&&(g.current.play(),S.current.isPlaying=!0)},re=()=>{o(!0)};dt.useEffect(()=>{let Zt=Wr.context(()=>{});if(v.current&&x.current){const Qt={duration:Number(C)-Number(I),onStart:ht,onComplete:Dt,onStartParams:[I],onCompleteParams:[],onInterrupt:mt,onUpdate:It,onUpdateParams:[]},ye=fh(L||"None");Zt=Wr.context(()=>{var lr,Ie;gr(ye.from)?gr(ye.to)?gr(ye.fromTo)?x.current.to(v.current,{alpha:1,duration:.01},I).from(_.current,{...Qt},I).to(v.current,{alpha:0,duration:.1},Number(C)-.1):x.current.fromTo(v.current,(lr=ye.fromTo)==null?void 0:lr.from,(Ie=ye.fromTo)==null?void 0:Ie.to,I).from(_.current,{...Qt},I).to(v.current,{alpha:0,duration:.2},C-.2):x.current.to(v.current,{alpha:1,duration:.2,...ye.to},I).from(_.current,{...Qt},I).to(v.current,{alpha:0,duration:.2},C-.2):x.current.from(v.current,{...ye.from},I).to(_.current,{alpha:1,duration:.2},I).from(_.current,{...Qt},I).to(v.current,{alpha:0,duration:.2},C-.2)})}return()=>Zt.revert()},[L,I,C]);const Pe=Mt.useCallback(()=>{h(!0)},[]);gt.ticker.add(Zt=>{m.current&&(m.current.rotation+=.01*Zt,m.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const Wt=Mt.useCallback(Zt=>{Zt.clear()},[]);return $t.jsxs(qt.Container,{ref:b,children:[$t.jsx(qt.Container,{ref:v,alpha:k,position:[q,X],pivot:[q,X],width:$,height:V,children:$t.jsxs(qt.Container,{ref:_,children:[!O&&$t.jsx(qt.Container,{anchor:.5,position:[$/2,V/2],children:$t.jsx(qt.Graphics,{x:q,y:X,ref:m,draw:Wt})}),t&&t.length>0&&$t.jsx(xL,{scale:1,blur:{blur:ne,quality:4},adjust:at,apply:({matrix:Zt})=>{H==="BlackAndWhite"?Zt.desaturate():H==="Sepia"?Zt.sepia():H==="RetroVintage"||H==="NightVision"?Zt.negative():H==="Normal"&&Zt.reset()},matrix:{enabled:!0,matrix:wL},children:$t.jsx(cv,{x:q,y:X,width:$,height:V,rotation:G,animationSpeed:1,loop:F,textures:i,onComplete:re,onFrameChange:Zt=>a(Zt),anchor:.5,...!M&&!c&&{interactive:!0,buttonMode:!0,pointerdown:Y,pointerover:Q,pointerout:ct,pointerup:K,mousedown:j,mouseup:W,mouseover:tt,mouseout:rt},forwardRef:g,scale:D})})]})}),_t&&$t.jsx(ch,{pixiTransformerRef:w,imageRef:v,isMounted:O,transformCommit:bt,transformChange:Pe,mouseoverEvent:d,uniqueId:P})]})};var hv={exports:{}};/*!
550
+ </svg>`,N=new p0(T),A=S.renderer.generateTexture(N);return r(A),()=>{}},[S,a,d,p,u]),ft.jsx(Ea,{...e,children:ft.jsx(yt.Container,{ref:i,children:ft.jsx(yt.Container,{ref:s,children:t&&ft.jsx(yt.Sprite,{texture:t,width:h,height:c,anchor:f,ref:n,x:o,y:l,interactive:!0,pointerdown:v,pointerup:g,pointerover:_,mousedown:y,mouseup:b,mouseover:m,mouseout:x})})})})},q0=e=>{const t={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=lt.useState(!1),n=J.useRef(t);console.log("allProps",e);const i=J.useRef(null),s=J.useRef(null),{tl:a,playerTimeRef:o}=J.useContext(Mr),{uniqueId:l,src:h,startAt:c,endAt:f,mute:u,speed:d}=e,p=lt.useRef(null);un(je.PAUSE,()=>{var m;console.log("pause event"),i.current&&((m=p.current)==null||m.pause(),n.current.isPlaying=!1)});const v=m=>{var x;i.current&&(console.log("audio gsapOnStart",m),o.current>=m&&o.current<=f&&((x=p.current)==null||x.play({volume:u?0:1,start:m,end:f,speed:d||1}),n.current.isPlaying=!0,n.current.completed=!1))},g=()=>{var m;i.current&&(console.log("audio gsapOnStart",c),(m=p.current)==null||m.stop(),n.current.isPlaying=!1,n.current.completed=!0)},y=m=>{var x,S,w;i.current&&!n.current.isPlaying&&!n.current.completed&&(console.log("audio gsapOnUpdate",m),(x=p.current)==null||x.refresh(),(S=p.current)==null||S.refreshPaused(),(w=p.current)==null||w.resume(),n.current.isPlaying=!0)},b=()=>{};J.useEffect(()=>{let m=ye.context(()=>{});if(i.current&&a.current){const x={duration:Number(f)-Number(c),onStart:v,onComplete:g,onStartParams:[c],onCompleteParams:[],onInterrupt:b,onUpdate:y,onUpdateParams:[]};m=ye.context(()=>{a.current.to(i.current,{alpha:1,duration:.01},c).from(s.current,{...x},c).to(i.current,{alpha:0,duration:.1},Number(f)-.1)})}return()=>m.revert()},[c,f]),lt.useEffect(()=>{i.current&&r(!0)},[]),lt.useEffect(()=>{i.current&&p.current&&(console.log("soundref",p.current),n.current.mute=u,n.current.speed=d,console.log("containerAudio",p.current.volume),p.current.volume=u?0:1)},[u,d]);const _=lt.useCallback((m,x)=>{p.current=x,n.current.loaded=!0},[]);return lt.useEffect(()=>(ee(h)||(p.current=$h.Sound.from({url:h,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[l,h,_]),ft.jsx(yt.Container,{ref:i})};function H0(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Ju=H0;function z0(){this.__data__=[],this.size=0}var V0=z0;function X0(e,t){return e===t||e!==e&&t!==t}var th=X0,W0=th;function Y0(e,t){for(var r=e.length;r--;)if(W0(e[r][0],t))return r;return-1}var Oi=Y0,K0=Oi,Z0=Array.prototype,Q0=Z0.splice;function J0(e){var t=this.__data__,r=K0(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Q0.call(t,r,1),--this.size,!0}var tb=J0,eb=Oi;function rb(e){var t=this.__data__,r=eb(t,e);return r<0?void 0:t[r][1]}var nb=rb,ib=Oi;function sb(e){return ib(this.__data__,e)>-1}var ab=sb,ob=Oi;function lb(e,t){var r=this.__data__,n=ob(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var ub=lb,hb=V0,cb=tb,fb=nb,db=ab,pb=ub;function Dr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Dr.prototype.clear=hb,Dr.prototype.delete=cb,Dr.prototype.get=fb,Dr.prototype.has=db,Dr.prototype.set=pb;var Ri=Dr,yb=Ri;function vb(){this.__data__=new yb,this.size=0}var mb=vb;function gb(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var bb=gb;function _b(e){return this.__data__.get(e)}var xb=_b;function wb(e){return this.__data__.has(e)}var Eb=wb,Tb=Lr,Ab=Tb(Object,"create"),Ii=Ab,eh=Ii;function Sb(){this.__data__=eh?eh(null):{},this.size=0}var Ob=Sb;function Rb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ib=Rb,Nb=Ii,Cb="__lodash_hash_undefined__",kb=Object.prototype,Pb=kb.hasOwnProperty;function Mb(e){var t=this.__data__;if(Nb){var r=t[e];return r===Cb?void 0:r}return Pb.call(t,e)?t[e]:void 0}var Lb=Mb,Fb=Ii,Bb=Object.prototype,Db=Bb.hasOwnProperty;function Ub(e){var t=this.__data__;return Fb?t[e]!==void 0:Db.call(t,e)}var jb=Ub,Gb=Ii,$b="__lodash_hash_undefined__";function qb(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Gb&&t===void 0?$b:t,this}var Hb=qb,zb=Ob,Vb=Ib,Xb=Lb,Wb=jb,Yb=Hb;function Ur(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ur.prototype.clear=zb,Ur.prototype.delete=Vb,Ur.prototype.get=Xb,Ur.prototype.has=Wb,Ur.prototype.set=Yb;var Kb=Ur,rh=Kb,Zb=Ri,Qb=da;function Jb(){this.size=0,this.__data__={hash:new rh,map:new(Qb||Zb),string:new rh}}var t_=Jb;function e_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var r_=e_,n_=r_;function i_(e,t){var r=e.__data__;return n_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Ni=i_,s_=Ni;function a_(e){var t=s_(this,e).delete(e);return this.size-=t?1:0,t}var o_=a_,l_=Ni;function u_(e){return l_(this,e).get(e)}var h_=u_,c_=Ni;function f_(e){return c_(this,e).has(e)}var d_=f_,p_=Ni;function y_(e,t){var r=p_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var v_=y_,m_=t_,g_=o_,b_=h_,__=d_,x_=v_;function jr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}jr.prototype.clear=m_,jr.prototype.delete=g_,jr.prototype.get=b_,jr.prototype.has=__,jr.prototype.set=x_;var Ra=jr,w_=Ri,E_=da,T_=Ra,A_=200;function S_(e,t){var r=this.__data__;if(r instanceof w_){var n=r.__data__;if(!E_||n.length<A_-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new T_(n)}return r.set(e,t),this.size=r.size,this}var O_=S_,R_=Ri,I_=mb,N_=bb,C_=xb,k_=Eb,P_=O_;function Gr(e){var t=this.__data__=new R_(e);this.size=t.size}Gr.prototype.clear=I_,Gr.prototype.delete=N_,Gr.prototype.get=C_,Gr.prototype.has=k_,Gr.prototype.set=P_;var nh=Gr,M_="__lodash_hash_undefined__";function L_(e){return this.__data__.set(e,M_),this}var F_=L_;function B_(e){return this.__data__.has(e)}var D_=B_,U_=Ra,j_=F_,G_=D_;function Ci(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new U_;++t<r;)this.add(e[t])}Ci.prototype.add=Ci.prototype.push=j_,Ci.prototype.has=G_;var $_=Ci;function q_(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var H_=q_;function z_(e,t){return e.has(t)}var V_=z_,X_=$_,W_=H_,Y_=V_,K_=1,Z_=2;function Q_(e,t,r,n,i,s){var a=r&K_,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var h=s.get(e),c=s.get(t);if(h&&c)return h==t&&c==e;var f=-1,u=!0,d=r&Z_?new X_:void 0;for(s.set(e,t),s.set(t,e);++f<o;){var p=e[f],v=t[f];if(n)var g=a?n(v,p,f,t,e,s):n(p,v,f,e,t,s);if(g!==void 0){if(g)continue;u=!1;break}if(d){if(!W_(t,function(y,b){if(!Y_(d,b)&&(p===y||i(p,y,r,n,s)))return d.push(b)})){u=!1;break}}else if(!(p===v||i(p,v,r,n,s))){u=!1;break}}return s.delete(e),s.delete(t),u}var ih=Q_,J_=Ie,t1=J_.Uint8Array,e1=t1;function r1(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var n1=r1;function i1(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var s1=i1,sh=_i,ah=e1,a1=th,o1=ih,l1=n1,u1=s1,h1=1,c1=2,f1="[object Boolean]",d1="[object Date]",p1="[object Error]",y1="[object Map]",v1="[object Number]",m1="[object RegExp]",g1="[object Set]",b1="[object String]",_1="[object Symbol]",x1="[object ArrayBuffer]",w1="[object DataView]",oh=sh?sh.prototype:void 0,Ia=oh?oh.valueOf:void 0;function E1(e,t,r,n,i,s,a){switch(r){case w1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x1:return!(e.byteLength!=t.byteLength||!s(new ah(e),new ah(t)));case f1:case d1:case v1:return a1(+e,+t);case p1:return e.name==t.name&&e.message==t.message;case m1:case b1:return e==t+"";case y1:var o=l1;case g1:var l=n&h1;if(o||(o=u1),e.size!=t.size&&!l)return!1;var h=a.get(e);if(h)return h==t;n|=c1,a.set(e,t);var c=o1(o(e),o(t),n,i,s,a);return a.delete(e),c;case _1:if(Ia)return Ia.call(e)==Ia.call(t)}return!1}var T1=E1;function A1(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var S1=A1,O1=S1,R1=xe;function I1(e,t,r){var n=t(e);return R1(e)?n:O1(n,r(e))}var N1=I1;function C1(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}var k1=C1;function P1(){return[]}var M1=P1,L1=k1,F1=M1,B1=Object.prototype,D1=B1.propertyIsEnumerable,lh=Object.getOwnPropertySymbols,U1=lh?function(e){return e==null?[]:(e=Object(e),L1(lh(e),function(t){return D1.call(e,t)}))}:F1,j1=U1;function G1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var $1=G1,q1=9007199254740991,H1=/^(?:0|[1-9]\d*)$/;function z1(e,t){var r=typeof e;return t=t??q1,!!t&&(r=="number"||r!="symbol"&&H1.test(e))&&e>-1&&e%1==0&&e<t}var uh=z1,V1=$1,X1=ba,W1=xe,Y1=xa,K1=uh,Z1=wa,Q1=Object.prototype,J1=Q1.hasOwnProperty;function tx(e,t){var r=W1(e),n=!r&&X1(e),i=!r&&!n&&Y1(e),s=!r&&!n&&!i&&Z1(e),a=r||n||i||s,o=a?V1(e.length,String):[],l=o.length;for(var h in e)(t||J1.call(e,h))&&!(a&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||K1(h,l)))&&o.push(h);return o}var ex=tx,rx=ex,nx=_u,ix=xi;function sx(e){return ix(e)?rx(e):nx(e)}var Na=sx,ax=N1,ox=j1,lx=Na;function ux(e){return ax(e,lx,ox)}var hx=ux,hh=hx,cx=1,fx=Object.prototype,dx=fx.hasOwnProperty;function px(e,t,r,n,i,s){var a=r&cx,o=hh(e),l=o.length,h=hh(t),c=h.length;if(l!=c&&!a)return!1;for(var f=l;f--;){var u=o[f];if(!(a?u in t:dx.call(t,u)))return!1}var d=s.get(e),p=s.get(t);if(d&&p)return d==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=a;++f<l;){u=o[f];var y=e[u],b=t[u];if(n)var _=a?n(b,y,u,t,e,s):n(y,b,u,e,t,s);if(!(_===void 0?y===b||i(y,b,r,n,s):_)){v=!1;break}g||(g=u=="constructor")}if(v&&!g){var m=e.constructor,x=t.constructor;m!=x&&"constructor"in e&&"constructor"in t&&!(typeof m=="function"&&m instanceof m&&typeof x=="function"&&x instanceof x)&&(v=!1)}return s.delete(e),s.delete(t),v}var yx=px,Ca=nh,vx=ih,mx=T1,gx=yx,ch=Lu,fh=xe,dh=xa,bx=wa,_x=1,ph="[object Arguments]",yh="[object Array]",ki="[object Object]",xx=Object.prototype,vh=xx.hasOwnProperty;function wx(e,t,r,n,i,s){var a=fh(e),o=fh(t),l=a?yh:ch(e),h=o?yh:ch(t);l=l==ph?ki:l,h=h==ph?ki:h;var c=l==ki,f=h==ki,u=l==h;if(u&&dh(e)){if(!dh(t))return!1;a=!0,c=!1}if(u&&!c)return s||(s=new Ca),a||bx(e)?vx(e,t,r,n,i,s):mx(e,t,l,r,n,i,s);if(!(r&_x)){var d=c&&vh.call(e,"__wrapped__"),p=f&&vh.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,g=p?t.value():t;return s||(s=new Ca),i(v,g,r,n,s)}}return u?(s||(s=new Ca),gx(e,t,r,n,i,s)):!1}var Ex=wx,Tx=Ex,mh=fn;function gh(e,t,r,n,i){return e===t?!0:e==null||t==null||!mh(e)&&!mh(t)?e!==e&&t!==t:Tx(e,t,r,n,gh,i)}var bh=gh,Ax=nh,Sx=bh,Ox=1,Rx=2;function Ix(e,t,r,n){var i=r.length,s=i,a=!n;if(e==null)return!s;for(e=Object(e);i--;){var o=r[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=r[i];var l=o[0],h=e[l],c=o[1];if(a&&o[2]){if(h===void 0&&!(l in e))return!1}else{var f=new Ax;if(n)var u=n(h,c,l,e,t,f);if(!(u===void 0?Sx(c,h,Ox|Rx,n,f):u))return!1}}return!0}var Nx=Ix,Cx=ca;function kx(e){return e===e&&!Cx(e)}var _h=kx,Px=_h,Mx=Na;function Lx(e){for(var t=Mx(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Px(i)]}return t}var Fx=Lx;function Bx(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var xh=Bx,Dx=Nx,Ux=Fx,jx=xh;function Gx(e){var t=Ux(e);return t.length==1&&t[0][2]?jx(t[0][0],t[0][1]):function(r){return r===e||Dx(r,e,t)}}var $x=Gx,qx=cn,Hx=fn,zx="[object Symbol]";function Vx(e){return typeof e=="symbol"||Hx(e)&&qx(e)==zx}var ka=Vx,Xx=xe,Wx=ka,Yx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kx=/^\w*$/;function Zx(e,t){if(Xx(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Wx(e)?!0:Kx.test(e)||!Yx.test(e)||t!=null&&e in Object(t)}var Pa=Zx,wh=Ra,Qx="Expected a function";function Ma(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Qx);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Ma.Cache||wh),r}Ma.Cache=wh;var Jx=Ma,tw=Jx,ew=500;function rw(e){var t=tw(e,function(n){return r.size===ew&&r.clear(),n}),r=t.cache;return t}var nw=rw,iw=nw,sw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aw=/\\(\\)?/g,ow=iw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sw,function(r,n,i,s){t.push(i?s.replace(aw,"$1"):n||r)}),t}),lw=ow,Eh=_i,uw=Ju,hw=xe,cw=ka,fw=1/0,Th=Eh?Eh.prototype:void 0,Ah=Th?Th.toString:void 0;function Sh(e){if(typeof e=="string")return e;if(hw(e))return uw(e,Sh)+"";if(cw(e))return Ah?Ah.call(e):"";var t=e+"";return t=="0"&&1/e==-fw?"-0":t}var dw=Sh,pw=dw;function yw(e){return e==null?"":pw(e)}var vw=yw,mw=xe,gw=Pa,bw=lw,_w=vw;function xw(e,t){return mw(e)?e:gw(e,t)?[e]:bw(_w(e))}var Oh=xw,ww=ka,Ew=1/0;function Tw(e){if(typeof e=="string"||ww(e))return e;var t=e+"";return t=="0"&&1/e==-Ew?"-0":t}var Pi=Tw,Aw=Oh,Sw=Pi;function Ow(e,t){t=Aw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Sw(t[r++])];return r&&r==n?e:void 0}var Rh=Ow,Rw=Rh;function Iw(e,t,r){var n=e==null?void 0:Rw(e,t);return n===void 0?r:n}var Nw=Iw;function Cw(e,t){return e!=null&&t in Object(e)}var kw=Cw,Pw=Oh,Mw=ba,Lw=xe,Fw=uh,Bw=_a,Dw=Pi;function Uw(e,t,r){t=Pw(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=Dw(t[n]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&Bw(i)&&Fw(a,i)&&(Lw(e)||Mw(e)))}var jw=Uw,Gw=kw,$w=jw;function qw(e,t){return e!=null&&$w(e,t,Gw)}var Hw=qw,zw=bh,Vw=Nw,Xw=Hw,Ww=Pa,Yw=_h,Kw=xh,Zw=Pi,Qw=1,Jw=2;function tE(e,t){return Ww(e)&&Yw(t)?Kw(Zw(e),t):function(r){var n=Vw(r,e);return n===void 0&&n===t?Xw(r,e):zw(t,n,Qw|Jw)}}var eE=tE;function rE(e){return e}var nE=rE;function iE(e){return function(t){return t==null?void 0:t[e]}}var sE=iE,aE=Rh;function oE(e){return function(t){return aE(t,e)}}var lE=oE,uE=sE,hE=lE,cE=Pa,fE=Pi;function dE(e){return cE(e)?uE(fE(e)):hE(e)}var pE=dE,yE=$x,vE=eE,mE=nE,gE=xe,bE=pE;function _E(e){return typeof e=="function"?e:e==null?mE:typeof e=="object"?gE(e)?vE(e[0],e[1]):yE(e):bE(e)}var xE=_E;function wE(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var l=a[e?o:++i];if(r(s[l],l,s)===!1)break}return t}}var EE=wE,TE=EE,AE=TE(),SE=AE,OE=SE,RE=Na;function IE(e,t){return e&&OE(e,t,RE)}var NE=IE,CE=xi;function kE(e,t){return function(r,n){if(r==null)return r;if(!CE(r))return e(r,n);for(var i=r.length,s=t?i:-1,a=Object(r);(t?s--:++s<i)&&n(a[s],s,a)!==!1;);return r}}var PE=kE,ME=NE,LE=PE,FE=LE(ME),BE=FE,DE=BE,UE=xi;function jE(e,t){var r=-1,n=UE(e)?Array(e.length):[];return DE(e,function(i,s,a){n[++r]=t(i,s,a)}),n}var GE=jE,$E=Ju,qE=xE,HE=GE,zE=xe;function VE(e,t){var r=zE(e)?$E:HE;return r(e,qE(t))}var XE=VE;const WE=or(XE);var ar={},Ih={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.loop=Ce.conditional=Ce.parse=void 0;var YE=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(r))r.forEach(function(a){return e(t,a,n,i)});else if(typeof r=="function")r(t,n,i,e);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(i[s]={},e(t,r[s],n,i[s])):i[s]=r[s](t,n,i,e)}return n};Ce.parse=YE;var KE=function(t,r){return function(n,i,s,a){r(n,i,s)&&a(n,t,i,s)}};Ce.conditional=KE;var ZE=function(t,r){return function(n,i,s,a){for(var o=[],l=n.pos;r(n,i,s);){var h={};if(a(n,t,i,h),n.pos===l)break;l=n.pos,o.push(h)}return o}};Ce.loop=ZE;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.readBits=Ft.readArray=Ft.readUnsigned=Ft.readString=Ft.peekBytes=Ft.readBytes=Ft.peekByte=Ft.readByte=Ft.buildStream=void 0;var QE=function(t){return{data:t,pos:0}};Ft.buildStream=QE;var Nh=function(){return function(t){return t.data[t.pos++]}};Ft.readByte=Nh;var JE=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};Ft.peekByte=JE;var Mi=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};Ft.readBytes=Mi;var tT=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};Ft.peekBytes=tT;var eT=function(t){return function(r){return Array.from(Mi(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};Ft.readString=eT;var rT=function(t){return function(r){var n=Mi(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};Ft.readUnsigned=rT;var nT=function(t,r){return function(n,i,s){for(var a=typeof r=="function"?r(n,i,s):r,o=Mi(t),l=new Array(a),h=0;h<a;h++)l[h]=o(n);return l}};Ft.readArray=nT;var iT=function(t,r,n){for(var i=0,s=0;s<n;s++)i+=t[r+s]&&Math.pow(2,n-s-1);return i},sT=function(t){return function(r){for(var n=Nh()(r),i=new Array(8),s=0;s<8;s++)i[7-s]=!!(n&1<<s);return Object.keys(t).reduce(function(a,o){var l=t[o];return l.length?a[o]=iT(i,l.index,l.length):a[o]=i[l.index],a},{})}};Ft.readBits=sT,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Ce,r=Ft,n={blocks:function(u){for(var d=0,p=[],v=u.data.length,g=0,y=(0,r.readByte)()(u);y!==d&&y;y=(0,r.readByte)()(u)){if(u.pos+y>=v){var b=v-u.pos;p.push((0,r.readBytes)(b)(u)),g+=b;break}p.push((0,r.readBytes)(y)(u)),g+=y}for(var _=new Uint8Array(g),m=0,x=0;x<p.length;x++)_.set(p[x],m),m+=p[x].length;return _}},i=(0,t.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===249}),s=(0,t.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,r.readArray)(3,function(f,u,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(f,u,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(f){return(0,r.peekByte)()(f)===44}),a=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(u,d,p){return(0,r.readBytes)(p.text.blockSize)(u)}},n]},function(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===1}),o=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(u,d,p){return(0,r.readString)(p.blockSize)(u)}},n]},function(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===255}),l=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,t.conditional)({gct:(0,r.readArray)(3,function(f,u){return Math.pow(2,u.lsd.gct.size+1)})},function(f,u){return u.lsd.gct.exists}),{frames:(0,t.loop)([i,o,l,s,a],function(f){var u=(0,r.peekByte)()(f);return u===33||u===44})}],c=h;e.default=c}(Ih);var Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.deinterlace=void 0;var aT=function(t,r){for(var n=new Array(t.length),i=t.length/r,s=function(u,d){var p=t.slice(d*r,(d+1)*r);n.splice.apply(n,[u*r,r].concat(p))},a=[0,4,2,1],o=[8,8,4,2],l=0,h=0;h<4;h++)for(var c=a[h];c<i;c+=o[h])s(c,l),l++;return n};Li.deinterlace=aT;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.lzw=void 0;var oT=function(t,r,n){var i=4096,s=-1,a=n,o,l,h,c,f,u,d,S,p,v,x,g,w,T,A,N,y=new Array(n),b=new Array(i),_=new Array(i),m=new Array(i+1);for(g=t,l=1<<g,f=l+1,o=l+2,d=s,c=g+1,h=(1<<c)-1,p=0;p<l;p++)b[p]=0,_[p]=p;var x,S,w,T,N,A;for(x=S=w=T=N=A=0,v=0;v<a;){if(T===0){if(S<c){x+=r[A]<<S,S+=8,A++;continue}if(p=x&h,x>>=c,S-=c,p>o||p==f)break;if(p==l){c=g+1,h=(1<<c)-1,o=l+2,d=s;continue}if(d==s){m[T++]=_[p],d=p,w=p;continue}for(u=p,p==o&&(m[T++]=w,p=d);p>l;)m[T++]=_[p],p=b[p];w=_[p]&255,m[T++]=w,o<i&&(b[o]=d,_[o]=w,o++,!(o&h)&&o<i&&(c++,h+=o)),d=u}T--,y[N++]=m[T],v++}for(v=N;v<a;v++)y[v]=0;return y};Fi.lzw=oT,Object.defineProperty(ar,"__esModule",{value:!0}),ar.decompressFrames=ar.decompressFrame=ar.parseGIF=void 0;var lT=dT(Ih),uT=Ce,hT=Ft,cT=Li,fT=Fi;function dT(e){return e&&e.__esModule?e:{default:e}}var pT=function(t){var r=new Uint8Array(t);return(0,uT.parse)((0,hT.buildStream)(r),lT.default)};ar.parseGIF=pT;var yT=function(t){for(var r=t.pixels.length,n=new Uint8ClampedArray(r*4),i=0;i<r;i++){var s=i*4,a=t.pixels[i],o=t.colorTable[a]||[0,0,0];n[s]=o[0],n[s+1]=o[1],n[s+2]=o[2],n[s+3]=a!==t.transparentIndex?255:0}return n},Ch=function(t,r,n){if(!t.image){console.warn("gif frame does not have associated image.");return}var i=t.image,s=i.descriptor.width*i.descriptor.height,a=(0,fT.lzw)(i.data.minCodeSize,i.data.blocks,s);i.descriptor.lct.interlaced&&(a=(0,cT.deinterlace)(a,i.descriptor.width));var o={pixels:a,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return i.descriptor.lct&&i.descriptor.lct.exists?o.colorTable=i.lct:o.colorTable=r,t.gce&&(o.delay=(t.gce.delay||10)*10,o.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(o.transparentIndex=t.gce.transparentColorIndex)),n&&(o.patch=yT(o)),o};ar.decompressFrame=Ch;var vT=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return Ch(n,t.gct,r)})};ar.decompressFrames=vT;const kh=(e,t={})=>{typeof t=="function"&&(t=t(e));const r=t.loaded&&e.loaded!==t.loaded,{playing:n,...i}=t,s={...e,...i};return r&&Object.assign(s,{playing:s.autoPlay&&s.loaded}),(t.delays!=null||t.frames!=null)&&Object.assign(s,{length:s.frames.length}),(t.index!=null||t.frames!=null)&&Object.assign(s,{index:s.length===0?0:(s.length+s.index)%s.length}),t.playing!=null&&Object.assign(s,s.loaded?{playing:n}:{autoPlay:n}),s},mT=e=>kh({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),gT=e=>J.useReducer(kh,e,mT);var bT='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function _T(e){const t=new Blob([bT],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const xT=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),wT=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),J.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(t&&t(r.instance),delete r.instance,delete r.timeout)})}),[r,t]),r.instance)},ET=e=>{const t=J.useRef(e);return J.useEffect(()=>{t.current=e},[e]),t},TT=e=>{const t=ET(e);return J.useCallback(r=>t.current&&t.current(r),[])},AT=wT(()=>new _T,e=>e.terminate()),ST=(e,t)=>{const r=TT(t),n=AT();J.useEffect(()=>{if(typeof e=="string"){const i=s=>{const a=s.data||s;if(a.src===e){const o=a.error?a:xT(a);r(o)}};return n.addEventListener("message",i),n.postMessage({src:e,type:"parse"}),()=>{n.postMessage({src:e,type:"cancel"}),n.removeEventListener("message",i)}}},[n,e])},OT=({isPlaying:e,forwardRef:t,...r})=>{const n=lt.useRef(null);return lt.useImperativeHandle(t,()=>n.current,[n]),lt.useEffect(()=>{if(n.current===null)return;const i=n.current;i[e?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[e]),ft.jsx(yt.AnimatedSprite,{ref:n,...r,isPlaying:e})},Ph=lt.memo(OT),RT=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:Zs,matrix:ne.filters.ColorMatrixFilter}),IT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],NT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},CT=e=>{const[t,r]=lt.useState([]),[,n]=lt.useState(0),[i,s]=lt.useState([]),[,a]=J.useState(0),[,o]=J.useState(!1),[l,h]=J.useState(!1),[,c]=J.useState(!1),[f,u]=gT({autoPlay:!1}),d=lt.useRef(null),p=J.useRef(null),v=J.useRef(null),g=J.useRef(null),y=J.useRef(null),b=J.useRef(null),_=J.useRef(NT),{tl:m}=J.useContext(Mr),{frames:x,delays:S,loaded:w}=f,{uniqueId:T,src:N,startAt:A,endAt:E,initialAlpha:O,locked:R,loop:C,transformation:{width:F=0,height:U=0,x:D,y:z,rotation:j=0,scale:k,animation:I,colorCorrection:P,effect:L},pointerdown:G,pointerup:$,mousedown:M,mouseup:B,pointerover:q,mouseover:H,mouseout:X,pointerout:K,applyTransformer:et,onAnchorTransformationEnd:it}=e,{contrast:ot=1,saturation:ht=1,exposure:Ct=1,blurRadius:It=0,alpha:V=1}=P||{},W={brightness:Ct,contrast:ot,saturation:ht,alpha:V},Q=yt.useApp();ST(N,u),un(je.PAUSE,Et=>{console.log("pause event",Et),p.current&&(p.current.stop(),_.current.isPlaying=!1)});const tt=lt.useCallback(Et=>{console.log("changeEnd",Et),it&&it(Et)},[]);lt.useEffect(()=>{if(!ee(x)){const Et=WE(x,pe=>{const{data:zt,width:Bh,height:UT}=pe,jT=new Uint8Array(zt);return ne.Texture.fromBuffer(jT,Bh,UT)}),Tt=Et.map((pe,zt)=>({texture:pe,time:S[zt]}));r(Et),s(Tt);let Bt=0;S.forEach(pe=>{Bt+=pe*10}),n(Bt)}},[x,S]);const Y=Et=>{p.current&&(p.current.gotoAndPlay(Et||0),_.current.isPlaying=!0)},ct=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},Z=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},at=()=>{p.current&&!_.current.isPlaying&&(p.current.play(),_.current.isPlaying=!0)},St=()=>{o(!0)};J.useEffect(()=>{let Et=ye.context(()=>{});if(v.current&&m.current){const Tt={duration:Number(E)-Number(A),onStart:Y,onComplete:ct,onStartParams:[A],onCompleteParams:[],onInterrupt:Z,onUpdate:at,onUpdateParams:[]},Bt=ha(I||"None");Et=ye.context(()=>{var pe,zt;ee(Bt.from)?ee(Bt.to)?ee(Bt.fromTo)?m.current.to(v.current,{alpha:1,duration:.01},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.1},Number(E)-.1):m.current.fromTo(v.current,(pe=Bt.fromTo)==null?void 0:pe.from,(zt=Bt.fromTo)==null?void 0:zt.to,A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},E-.2):m.current.to(v.current,{alpha:1,duration:.2,...Bt.to},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},E-.2):m.current.from(v.current,{...Bt.from},A).to(y.current,{alpha:1,duration:.2},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},E-.2)})}return()=>Et.revert()},[I,A,E]);const Ht=lt.useCallback(()=>{h(!0)},[]);Q.ticker.add(Et=>{d.current&&(d.current.rotation+=.01*Et,d.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const _t=lt.useCallback(Et=>{Et.clear()},[]);return ft.jsxs(yt.Container,{ref:g,children:[ft.jsx(yt.Container,{ref:v,alpha:O,position:[D,z],pivot:[D,z],width:F,height:U,children:ft.jsxs(yt.Container,{ref:y,children:[!w&&ft.jsx(yt.Container,{anchor:.5,position:[F/2,U/2],children:ft.jsx(yt.Graphics,{x:D,y:z,ref:d,draw:_t})}),t&&t.length>0&&ft.jsx(RT,{scale:1,blur:{blur:It,quality:4},adjust:W,apply:({matrix:Et})=>{L==="BlackAndWhite"?Et.desaturate():L==="Sepia"?Et.sepia():L==="RetroVintage"||L==="NightVision"?Et.negative():L==="Normal"&&Et.reset()},matrix:{enabled:!0,matrix:IT},children:ft.jsx(Ph,{x:D,y:z,width:F,height:U,rotation:j,animationSpeed:1,loop:C,textures:i,onComplete:St,onFrameChange:Et=>a(Et),anchor:.5,...!R&&!l&&{interactive:!0,buttonMode:!0,pointerdown:G,pointerover:q,pointerout:K,pointerup:$,mousedown:M,mouseup:B,mouseover:H,mouseout:X},forwardRef:p,scale:k})})]})}),et&&ft.jsx(la,{pixiTransformerRef:b,imageRef:v,isMounted:w,transformCommit:tt,transformChange:Ht,mouseoverEvent:c,uniqueId:T})]})};var Mh={exports:{}};/*!
855
551
  * Quill Editor v1.3.7
856
552
  * https://quilljs.com/
857
553
  * Copyright (c) 2014, Jason Chen
858
554
  * Copyright (c) 2013, salesforce.com
859
- */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Nn,function(){return function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(17),a=i(18),o=i(19),c=i(45),h=i(46),d=i(47),p=i(48),f=i(49),m=i(12),g=i(32),v=i(33),b=i(31),_=i(1),w={Scope:_.Scope,create:_.create,find:_.find,query:_.query,register:_.register,Container:s.default,Format:a.default,Leaf:o.default,Embed:p.default,Scroll:c.default,Block:d.default,Inline:h.default,Text:f.default,Attributor:{Attribute:m.default,Class:g.default,Style:v.default,Store:b.default}};n.default=w},function(r,n,i){var s=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,w){_.__proto__=w}||function(_,w){for(var S in w)w.hasOwnProperty(S)&&(_[S]=w[S])};return function(_,w){b(_,w);function S(){this.constructor=_}_.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(b){s(_,b);function _(w){var S=this;return w="[Parchment] "+w,S=b.call(this,w)||this,S.message=w,S.name=S.constructor.name,S}return _}(Error);n.ParchmentError=a;var o={},c={},h={},d={};n.DATA_KEY="__blot";var p;(function(b){b[b.TYPE=3]="TYPE",b[b.LEVEL=12]="LEVEL",b[b.ATTRIBUTE=13]="ATTRIBUTE",b[b.BLOT=14]="BLOT",b[b.INLINE=7]="INLINE",b[b.BLOCK=11]="BLOCK",b[b.BLOCK_BLOT=10]="BLOCK_BLOT",b[b.INLINE_BLOT=6]="INLINE_BLOT",b[b.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",b[b.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",b[b.ANY=15]="ANY"})(p=n.Scope||(n.Scope={}));function f(b,_){var w=g(b);if(w==null)throw new a("Unable to create "+b+" blot");var S=w,x=b instanceof Node||b.nodeType===Node.TEXT_NODE?b:S.create(_);return new S(x,_)}n.create=f;function m(b,_){return _===void 0&&(_=!1),b==null?null:b[n.DATA_KEY]!=null?b[n.DATA_KEY].blot:_?m(b.parentNode,_):null}n.find=m;function g(b,_){_===void 0&&(_=p.ANY);var w;if(typeof b=="string")w=d[b]||o[b];else if(b instanceof Text||b.nodeType===Node.TEXT_NODE)w=d.text;else if(typeof b=="number")b&p.LEVEL&p.BLOCK?w=d.block:b&p.LEVEL&p.INLINE&&(w=d.inline);else if(b instanceof HTMLElement){var S=(b.getAttribute("class")||"").split(/\s+/);for(var x in S)if(w=c[S[x]],w)break;w=w||h[b.tagName]}return w==null?null:_&p.LEVEL&w.scope&&_&p.TYPE&w.scope?w:null}n.query=g;function v(){for(var b=[],_=0;_<arguments.length;_++)b[_]=arguments[_];if(b.length>1)return b.map(function(x){return v(x)});var w=b[0];if(typeof w.blotName!="string"&&typeof w.attrName!="string")throw new a("Invalid definition");if(w.blotName==="abstract")throw new a("Cannot register abstract class");if(d[w.blotName||w.attrName]=w,typeof w.keyName=="string")o[w.keyName]=w;else if(w.className!=null&&(c[w.className]=w),w.tagName!=null){Array.isArray(w.tagName)?w.tagName=w.tagName.map(function(x){return x.toUpperCase()}):w.tagName=w.tagName.toUpperCase();var S=Array.isArray(w.tagName)?w.tagName:[w.tagName];S.forEach(function(x){(h[x]==null||w.className==null)&&(h[x]=w)})}return w}n.register=v},function(r,n,i){var s=i(51),a=i(11),o=i(3),c=i(20),h=String.fromCharCode(0),d=function(p){Array.isArray(p)?this.ops=p:p!=null&&Array.isArray(p.ops)?this.ops=p.ops:this.ops=[]};d.prototype.insert=function(p,f){var m={};return p.length===0?this:(m.insert=p,f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(m.attributes=f),this.push(m))},d.prototype.delete=function(p){return p<=0?this:this.push({delete:p})},d.prototype.retain=function(p,f){if(p<=0)return this;var m={retain:p};return f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(m.attributes=f),this.push(m)},d.prototype.push=function(p){var f=this.ops.length,m=this.ops[f-1];if(p=o(!0,{},p),typeof m=="object"){if(typeof p.delete=="number"&&typeof m.delete=="number")return this.ops[f-1]={delete:m.delete+p.delete},this;if(typeof m.delete=="number"&&p.insert!=null&&(f-=1,m=this.ops[f-1],typeof m!="object"))return this.ops.unshift(p),this;if(a(p.attributes,m.attributes)){if(typeof p.insert=="string"&&typeof m.insert=="string")return this.ops[f-1]={insert:m.insert+p.insert},typeof p.attributes=="object"&&(this.ops[f-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof m.retain=="number")return this.ops[f-1]={retain:m.retain+p.retain},typeof p.attributes=="object"&&(this.ops[f-1].attributes=p.attributes),this}}return f===this.ops.length?this.ops.push(p):this.ops.splice(f,0,p),this},d.prototype.chop=function(){var p=this.ops[this.ops.length-1];return p&&p.retain&&!p.attributes&&this.ops.pop(),this},d.prototype.filter=function(p){return this.ops.filter(p)},d.prototype.forEach=function(p){this.ops.forEach(p)},d.prototype.map=function(p){return this.ops.map(p)},d.prototype.partition=function(p){var f=[],m=[];return this.forEach(function(g){var v=p(g)?f:m;v.push(g)}),[f,m]},d.prototype.reduce=function(p,f){return this.ops.reduce(p,f)},d.prototype.changeLength=function(){return this.reduce(function(p,f){return f.insert?p+c.length(f):f.delete?p-f.delete:p},0)},d.prototype.length=function(){return this.reduce(function(p,f){return p+c.length(f)},0)},d.prototype.slice=function(p,f){p=p||0,typeof f!="number"&&(f=1/0);for(var m=[],g=c.iterator(this.ops),v=0;v<f&&g.hasNext();){var b;v<p?b=g.next(p-v):(b=g.next(f-v),m.push(b)),v+=c.length(b)}return new d(m)},d.prototype.compose=function(p){var f=c.iterator(this.ops),m=c.iterator(p.ops),g=[],v=m.peek();if(v!=null&&typeof v.retain=="number"&&v.attributes==null){for(var b=v.retain;f.peekType()==="insert"&&f.peekLength()<=b;)b-=f.peekLength(),g.push(f.next());v.retain-b>0&&m.next(v.retain-b)}for(var _=new d(g);f.hasNext()||m.hasNext();)if(m.peekType()==="insert")_.push(m.next());else if(f.peekType()==="delete")_.push(f.next());else{var w=Math.min(f.peekLength(),m.peekLength()),S=f.next(w),x=m.next(w);if(typeof x.retain=="number"){var A={};typeof S.retain=="number"?A.retain=w:A.insert=S.insert;var N=c.attributes.compose(S.attributes,x.attributes,typeof S.retain=="number");if(N&&(A.attributes=N),_.push(A),!m.hasNext()&&a(_.ops[_.ops.length-1],A)){var O=new d(f.rest());return _.concat(O).chop()}}else typeof x.delete=="number"&&typeof S.retain=="number"&&_.push(x)}return _.chop()},d.prototype.concat=function(p){var f=new d(this.ops.slice());return p.ops.length>0&&(f.push(p.ops[0]),f.ops=f.ops.concat(p.ops.slice(1))),f},d.prototype.diff=function(p,f){if(this.ops===p.ops)return new d;var m=[this,p].map(function(w){return w.map(function(S){if(S.insert!=null)return typeof S.insert=="string"?S.insert:h;var x=w===p?"on":"with";throw new Error("diff() called "+x+" non-document")}).join("")}),g=new d,v=s(m[0],m[1],f),b=c.iterator(this.ops),_=c.iterator(p.ops);return v.forEach(function(w){for(var S=w[1].length;S>0;){var x=0;switch(w[0]){case s.INSERT:x=Math.min(_.peekLength(),S),g.push(_.next(x));break;case s.DELETE:x=Math.min(S,b.peekLength()),b.next(x),g.delete(x);break;case s.EQUAL:x=Math.min(b.peekLength(),_.peekLength(),S);var A=b.next(x),N=_.next(x);a(A.insert,N.insert)?g.retain(x,c.attributes.diff(A.attributes,N.attributes)):g.push(N).delete(x);break}S-=x}}),g.chop()},d.prototype.eachLine=function(p,f){f=f||`
860
- `;for(var m=c.iterator(this.ops),g=new d,v=0;m.hasNext();){if(m.peekType()!=="insert")return;var b=m.peek(),_=c.length(b)-m.peekLength(),w=typeof b.insert=="string"?b.insert.indexOf(f,_)-_:-1;if(w<0)g.push(m.next());else if(w>0)g.push(m.next(w));else{if(p(g,m.next(1).attributes||{},v)===!1)return;v+=1,g=new d}}g.length()>0&&p(g,{},v)},d.prototype.transform=function(p,f){if(f=!!f,typeof p=="number")return this.transformPosition(p,f);for(var m=c.iterator(this.ops),g=c.iterator(p.ops),v=new d;m.hasNext()||g.hasNext();)if(m.peekType()==="insert"&&(f||g.peekType()!=="insert"))v.retain(c.length(m.next()));else if(g.peekType()==="insert")v.push(g.next());else{var b=Math.min(m.peekLength(),g.peekLength()),_=m.next(b),w=g.next(b);if(_.delete)continue;w.delete?v.push(w):v.retain(b,c.attributes.transform(_.attributes,w.attributes,f))}return v.chop()},d.prototype.transformPosition=function(p,f){f=!!f;for(var m=c.iterator(this.ops),g=0;m.hasNext()&&g<=p;){var v=m.peekLength(),b=m.peekType();if(m.next(),b==="delete"){p-=Math.min(v,p-g);continue}else b==="insert"&&(g<p||!f)&&(p+=v);g+=v}return p},r.exports=d},function(r,n){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,c=function(m){return typeof Array.isArray=="function"?Array.isArray(m):s.call(m)==="[object Array]"},h=function(m){if(!m||s.call(m)!=="[object Object]")return!1;var g=i.call(m,"constructor"),v=m.constructor&&m.constructor.prototype&&i.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!v)return!1;var b;for(b in m);return typeof b>"u"||i.call(m,b)},d=function(m,g){a&&g.name==="__proto__"?a(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},p=function(m,g){if(g==="__proto__")if(i.call(m,g)){if(o)return o(m,g).value}else return;return m[g]};r.exports=function f(){var m,g,v,b,_,w,S=arguments[0],x=1,A=arguments.length,N=!1;for(typeof S=="boolean"&&(N=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});x<A;++x)if(m=arguments[x],m!=null)for(g in m)v=p(S,g),b=p(m,g),S!==b&&(N&&b&&(h(b)||(_=c(b)))?(_?(_=!1,w=v&&c(v)?v:[]):w=v&&h(v)?v:{},d(S,{name:g,newValue:f(N,w,b)})):typeof b<"u"&&d(S,{name:g,newValue:b}));return S}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var s=function(){function C(k,M){for(var F=0;F<M.length;F++){var $=M[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(k,$.key,$)}}return function(k,M,F){return M&&C(k.prototype,M),F&&C(k,F),k}}(),a=function C(k,M,F){k===null&&(k=Function.prototype);var $=Object.getOwnPropertyDescriptor(k,M);if($===void 0){var V=Object.getPrototypeOf(k);return V===null?void 0:C(V,M,F)}else{if("value"in $)return $.value;var q=$.get;return q===void 0?void 0:q.call(F)}},o=i(3),c=S(o),h=i(2),d=S(h),p=i(0),f=S(p),m=i(16),g=S(m),v=i(6),b=S(v),_=i(7),w=S(_);function S(C){return C&&C.__esModule?C:{default:C}}function x(C,k){if(!(C instanceof k))throw new TypeError("Cannot call a class as a function")}function A(C,k){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:C}function N(C,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);C.prototype=Object.create(k&&k.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(C,k):C.__proto__=k)}var O=1,P=function(C){N(k,C);function k(){return x(this,k),A(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}return s(k,[{key:"attach",value:function(){a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"attach",this).call(this),this.attributes=new f.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,c.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(F,$){var V=f.default.query(F,f.default.Scope.BLOCK_ATTRIBUTE);V!=null&&this.attributes.attribute(V,$)}},{key:"formatAt",value:function(F,$,V,q){this.format(V,q)}},{key:"insertAt",value:function(F,$,V){if(typeof $=="string"&&$.endsWith(`
861
- `)){var q=f.default.create(B.blotName);this.parent.insertBefore(q,F===0?this:this.next),q.insertAt(0,$.slice(0,-1))}else a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,F,$,V)}}]),k}(f.default.Embed);P.scope=f.default.Scope.BLOCK_BLOT;var B=function(C){N(k,C);function k(M){x(this,k);var F=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M));return F.cache={},F}return s(k,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(f.default.Leaf).reduce(function(F,$){return $.length()===0?F:F.insert($.value(),I($))},new d.default).insert(`
862
- `,I(this))),this.cache.delta}},{key:"deleteAt",value:function(F,$){a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,F,$),this.cache={}}},{key:"formatAt",value:function(F,$,V,q){$<=0||(f.default.query(V,f.default.Scope.BLOCK)?F+$===this.length()&&this.format(V,q):a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,F,Math.min($,this.length()-F-1),V,q),this.cache={})}},{key:"insertAt",value:function(F,$,V){if(V!=null)return a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,F,$,V);if($.length!==0){var q=$.split(`
863
- `),X=q.shift();X.length>0&&(F<this.length()-1||this.children.tail==null?a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,Math.min(F,this.length()-1),X):this.children.tail.insertAt(this.children.tail.length(),X),this.cache={});var G=this;q.reduce(function(D,L){return G=G.split(D,!0),G.insertAt(0,L),L.length},F+X.length)}}},{key:"insertBefore",value:function(F,$){var V=this.children.head;a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,F,$),V instanceof g.default&&V.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(F,$){a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"moveChildren",this).call(this,F,$),this.cache={}}},{key:"optimize",value:function(F){a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,F),this.cache={}}},{key:"path",value:function(F){return a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,F,!0)}},{key:"removeChild",value:function(F){a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"removeChild",this).call(this,F),this.cache={}}},{key:"split",value:function(F){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if($&&(F===0||F>=this.length()-O)){var V=this.clone();return F===0?(this.parent.insertBefore(V,this),this):(this.parent.insertBefore(V,this.next),V)}else{var q=a(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"split",this).call(this,F,$);return this.cache={},q}}}]),k}(f.default.Block);B.blotName="block",B.tagName="P",B.defaultChild="break",B.allowedChildren=[b.default,f.default.Embed,w.default];function I(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(k=(0,c.default)(k,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?k:I(C.parent,k)}n.bubbleFormats=I,n.BlockEmbed=P,n.default=B},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},a=function(){function G(D,L){var U=[],H=!0,Y=!1,K=void 0;try{for(var j=D[Symbol.iterator](),W;!(H=(W=j.next()).done)&&(U.push(W.value),!(L&&U.length===L));H=!0);}catch(Q){Y=!0,K=Q}finally{try{!H&&j.return&&j.return()}finally{if(Y)throw K}}return U}return function(D,L){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return G(D,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function G(D,L){for(var U=0;U<L.length;U++){var H=L[U];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(D,H.key,H)}}return function(D,L,U){return L&&G(D.prototype,L),U&&G(D,U),D}}();i(50);var c=i(2),h=I(c),d=i(14),p=I(d),f=i(8),m=I(f),g=i(9),v=I(g),b=i(0),_=I(b),w=i(15),S=I(w),x=i(3),A=I(x),N=i(10),O=I(N),P=i(34),B=I(P);function I(G){return G&&G.__esModule?G:{default:G}}function C(G,D,L){return D in G?Object.defineProperty(G,D,{value:L,enumerable:!0,configurable:!0,writable:!0}):G[D]=L,G}function k(G,D){if(!(G instanceof D))throw new TypeError("Cannot call a class as a function")}var M=(0,O.default)("quill"),F=function(){o(G,null,[{key:"debug",value:function(L){L===!0&&(L="log"),O.default.level(L)}},{key:"find",value:function(L){return L.__quill||_.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&M.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,U){var H=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var K=L.attrName||L.blotName;typeof K=="string"?this.register("formats/"+K,L,U):Object.keys(L).forEach(function(j){H.register(j,L[j],U)})}else this.imports[L]!=null&&!Y&&M.warn("Overwriting "+L+" with",U),this.imports[L]=U,(L.startsWith("blots/")||L.startsWith("formats/"))&&U.blotName!=="abstract"?_.default.register(U):L.startsWith("modules")&&typeof U.register=="function"&&U.register()}}]);function G(D){var L=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(k(this,G),this.options=$(D,U),this.container=this.options.container,this.container==null)return M.error("Invalid Quill container",D);this.options.debug&&G.debug(this.options.debug);var H=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new m.default,this.scroll=_.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new p.default(this.scroll),this.selection=new S.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(m.default.events.EDITOR_CHANGE,function(K){K===m.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(m.default.events.SCROLL_UPDATE,function(K,j){var W=L.selection.lastRange,Q=W&&W.length===0?W.index:void 0;V.call(L,function(){return L.editor.update(null,j,Q)},K)});var Y=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+H+"<p><br></p></div>");this.setContents(Y),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(G,[{key:"addContainer",value:function(L){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var H=L;L=document.createElement("div"),L.classList.add(H)}return this.container.insertBefore(L,U),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,U,H){var Y=this,K=q(L,U,H),j=a(K,4);return L=j[0],U=j[1],H=j[3],V.call(this,function(){return Y.editor.deleteText(L,U)},H,L,-1*U)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,U){var H=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;return V.call(this,function(){var K=H.getSelection(!0),j=new h.default;if(K==null)return j;if(_.default.query(L,_.default.Scope.BLOCK))j=H.editor.formatLine(K.index,K.length,C({},L,U));else{if(K.length===0)return H.selection.format(L,U),j;j=H.editor.formatText(K.index,K.length,C({},L,U))}return H.setSelection(K,m.default.sources.SILENT),j},Y)}},{key:"formatLine",value:function(L,U,H,Y,K){var j=this,W=void 0,Q=q(L,U,H,Y,K),tt=a(Q,4);return L=tt[0],U=tt[1],W=tt[2],K=tt[3],V.call(this,function(){return j.editor.formatLine(L,U,W)},K,L,0)}},{key:"formatText",value:function(L,U,H,Y,K){var j=this,W=void 0,Q=q(L,U,H,Y,K),tt=a(Q,4);return L=tt[0],U=tt[1],W=tt[2],K=tt[3],V.call(this,function(){return j.editor.formatText(L,U,W)},K,L,0)}},{key:"getBounds",value:function(L){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,H=void 0;typeof L=="number"?H=this.selection.getBounds(L,U):H=this.selection.getBounds(L.index,L.length);var Y=this.container.getBoundingClientRect();return{bottom:H.bottom-Y.top,height:H.height,left:H.left-Y.left,right:H.right-Y.left,top:H.top-Y.top,width:H.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,H=q(L,U),Y=a(H,2);return L=Y[0],U=Y[1],this.editor.getContents(L,U)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,U):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,U)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,H=q(L,U),Y=a(H,2);return L=Y[0],U=Y[1],this.editor.getText(L,U)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,U,H){var Y=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:G.sources.API;return V.call(this,function(){return Y.editor.insertEmbed(L,U,H)},K,L)}},{key:"insertText",value:function(L,U,H,Y,K){var j=this,W=void 0,Q=q(L,0,H,Y,K),tt=a(Q,4);return L=tt[0],W=tt[2],K=tt[3],V.call(this,function(){return j.editor.insertText(L,U,W)},K,L,U.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(L,U,H){this.clipboard.dangerouslyPasteHTML(L,U,H)}},{key:"removeFormat",value:function(L,U,H){var Y=this,K=q(L,U,H),j=a(K,4);return L=j[0],U=j[1],H=j[3],V.call(this,function(){return Y.editor.removeFormat(L,U)},H,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var U=this,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return V.call(this,function(){L=new h.default(L);var Y=U.getLength(),K=U.editor.deleteText(0,Y),j=U.editor.applyDelta(L),W=j.ops[j.ops.length-1];W!=null&&typeof W.insert=="string"&&W.insert[W.insert.length-1]===`
864
- `&&(U.editor.deleteText(U.getLength()-1,1),j.delete(1));var Q=K.compose(j);return Q},H)}},{key:"setSelection",value:function(L,U,H){if(L==null)this.selection.setRange(null,U||G.sources.API);else{var Y=q(L,U,H),K=a(Y,4);L=K[0],U=K[1],H=K[3],this.selection.setRange(new w.Range(L,U),H),H!==m.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API,H=new h.default().insert(L);return this.setContents(H,U)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m.default.sources.USER,U=this.scroll.update(L);return this.selection.update(L),U}},{key:"updateContents",value:function(L){var U=this,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return V.call(this,function(){return L=new h.default(L),U.editor.applyDelta(L,H)},H,!0)}}]),G}();F.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},F.events=m.default.events,F.sources=m.default.sources,F.version="1.3.7",F.imports={delta:h.default,parchment:_.default,"core/module":v.default,"core/theme":B.default};function $(G,D){if(D=(0,A.default)(!0,{container:G,modules:{clipboard:!0,keyboard:!0,history:!0}},D),!D.theme||D.theme===F.DEFAULTS.theme)D.theme=B.default;else if(D.theme=F.import("themes/"+D.theme),D.theme==null)throw new Error("Invalid theme "+D.theme+". Did you register it?");var L=(0,A.default)(!0,{},D.theme.DEFAULTS);[L,D].forEach(function(Y){Y.modules=Y.modules||{},Object.keys(Y.modules).forEach(function(K){Y.modules[K]===!0&&(Y.modules[K]={})})});var U=Object.keys(L.modules).concat(Object.keys(D.modules)),H=U.reduce(function(Y,K){var j=F.import("modules/"+K);return j==null?M.error("Cannot load "+K+" module. Are you sure you registered it?"):Y[K]=j.DEFAULTS||{},Y},{});return D.modules!=null&&D.modules.toolbar&&D.modules.toolbar.constructor!==Object&&(D.modules.toolbar={container:D.modules.toolbar}),D=(0,A.default)(!0,{},F.DEFAULTS,{modules:H},L,D),["bounds","container","scrollingContainer"].forEach(function(Y){typeof D[Y]=="string"&&(D[Y]=document.querySelector(D[Y]))}),D.modules=Object.keys(D.modules).reduce(function(Y,K){return D.modules[K]&&(Y[K]=D.modules[K]),Y},{}),D}function V(G,D,L,U){if(this.options.strict&&!this.isEnabled()&&D===m.default.sources.USER)return new h.default;var H=L==null?null:this.getSelection(),Y=this.editor.delta,K=G();if(H!=null&&(L===!0&&(L=H.index),U==null?H=X(H,K,D):U!==0&&(H=X(H,L,U,D)),this.setSelection(H,m.default.sources.SILENT)),K.length()>0){var j,W=[m.default.events.TEXT_CHANGE,K,Y,D];if((j=this.emitter).emit.apply(j,[m.default.events.EDITOR_CHANGE].concat(W)),D!==m.default.sources.SILENT){var Q;(Q=this.emitter).emit.apply(Q,W)}}return K}function q(G,D,L,U,H){var Y={};return typeof G.index=="number"&&typeof G.length=="number"?typeof D!="number"?(H=U,U=L,L=D,D=G.length,G=G.index):(D=G.length,G=G.index):typeof D!="number"&&(H=U,U=L,L=D,D=0),(typeof L>"u"?"undefined":s(L))==="object"?(Y=L,H=U):typeof L=="string"&&(U!=null?Y[L]=U:H=L),H=H||m.default.sources.API,[G,D,Y,H]}function X(G,D,L,U){if(G==null)return null;var H=void 0,Y=void 0;if(D instanceof h.default){var K=[G.index,G.index+G.length].map(function(tt){return D.transformPosition(tt,U!==m.default.sources.USER)}),j=a(K,2);H=j[0],Y=j[1]}else{var W=[G.index,G.index+G.length].map(function(tt){return tt<D||tt===D&&U===m.default.sources.USER?tt:L>=0?tt+L:Math.max(D,tt+L)}),Q=a(W,2);H=Q[0],Y=Q[1]}return new w.Range(H,Y-H)}n.expandConfig=$,n.overload=q,n.default=F},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,w){for(var S=0;S<w.length;S++){var x=w[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,w,S){return w&&b(_.prototype,w),S&&b(_,S),_}}(),a=function b(_,w,S){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,w);if(x===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:b(A,w,S)}else{if("value"in x)return x.value;var N=x.get;return N===void 0?void 0:N.call(S)}},o=i(7),c=p(o),h=i(0),d=p(h);function p(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function m(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function g(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var v=function(b){g(_,b);function _(){return f(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"formatAt",value:function(S,x,A,N){if(_.compare(this.statics.blotName,A)<0&&d.default.query(A,d.default.Scope.BLOT)){var O=this.isolate(S,x);N&&O.wrap(A,N)}else a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"formatAt",this).call(this,S,x,A,N)}},{key:"optimize",value:function(S){if(a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,S),this.parent instanceof _&&_.compare(this.statics.blotName,this.parent.statics.blotName)>0){var x=this.parent.isolate(this.offset(),this.length());this.moveChildren(x),x.wrap(this)}}}],[{key:"compare",value:function(S,x){var A=_.order.indexOf(S),N=_.order.indexOf(x);return A>=0||N>=0?A-N:S===x?0:S<x?-1:1}}]),_}(d.default.Inline);v.allowedChildren=[v,d.default.Embed,c.default],v.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function h(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(f){d(m,f);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(a.default.Text);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function w(S,x){for(var A=0;A<x.length;A++){var N=x[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(S,N.key,N)}}return function(S,x,A){return x&&w(S.prototype,x),A&&w(S,A),S}}(),a=function w(S,x,A){S===null&&(S=Function.prototype);var N=Object.getOwnPropertyDescriptor(S,x);if(N===void 0){var O=Object.getPrototypeOf(S);return O===null?void 0:w(O,x,A)}else{if("value"in N)return N.value;var P=N.get;return P===void 0?void 0:P.call(A)}},o=i(54),c=p(o),h=i(10),d=p(h);function p(w){return w&&w.__esModule?w:{default:w}}function f(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function m(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function g(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var v=(0,d.default)("quill:events"),b=["selectionchange","mousedown","mouseup","click"];b.forEach(function(w){document.addEventListener(w,function(){for(var S=arguments.length,x=Array(S),A=0;A<S;A++)x[A]=arguments[A];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(N){if(N.__quill&&N.__quill.emitter){var O;(O=N.__quill.emitter).handleDOM.apply(O,x)}})})});var _=function(w){g(S,w);function S(){f(this,S);var x=m(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));return x.listeners={},x.on("error",v.error),x}return s(S,[{key:"emit",value:function(){v.log.apply(v,arguments),a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(A){for(var N=arguments.length,O=Array(N>1?N-1:0),P=1;P<N;P++)O[P-1]=arguments[P];(this.listeners[A.type]||[]).forEach(function(B){var I=B.node,C=B.handler;(A.target===I||I.contains(A.target))&&C.apply(void 0,[A].concat(O))})}},{key:"listenDOM",value:function(A,N,O){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push({node:N,handler:O})}}]),S}(c.default);_.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},_.sources={API:"api",SILENT:"silent",USER:"user"},n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function s(o,c){if(!(o instanceof c))throw new TypeError("Cannot call a class as a function")}var a=function o(c){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=c,this.options=h};a.DEFAULTS={},n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],a="warn";function o(h){if(s.indexOf(h)<=s.indexOf(a)){for(var d,p=arguments.length,f=Array(p>1?p-1:0),m=1;m<p;m++)f[m-1]=arguments[m];(d=console)[h].apply(d,f)}}function c(h){return s.reduce(function(d,p){return d[p]=o.bind(console,p,h),d},{})}o.level=c.level=function(h){a=h},n.default=c},function(r,n,i){var s=Array.prototype.slice,a=i(52),o=i(53),c=r.exports=function(f,m,g){return g||(g={}),f===m?!0:f instanceof Date&&m instanceof Date?f.getTime()===m.getTime():!f||!m||typeof f!="object"&&typeof m!="object"?g.strict?f===m:f==m:p(f,m,g)};function h(f){return f==null}function d(f){return!(!f||typeof f!="object"||typeof f.length!="number"||typeof f.copy!="function"||typeof f.slice!="function"||f.length>0&&typeof f[0]!="number")}function p(f,m,g){var v,b;if(h(f)||h(m)||f.prototype!==m.prototype)return!1;if(o(f))return o(m)?(f=s.call(f),m=s.call(m),c(f,m,g)):!1;if(d(f)){if(!d(m)||f.length!==m.length)return!1;for(v=0;v<f.length;v++)if(f[v]!==m[v])return!1;return!0}try{var _=a(f),w=a(m)}catch{return!1}if(_.length!=w.length)return!1;for(_.sort(),w.sort(),v=_.length-1;v>=0;v--)if(_[v]!=w[v])return!1;for(v=_.length-1;v>=0;v--)if(b=_[v],!c(f[b],m[b],g))return!1;return typeof f==typeof m}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(c,h,d){d===void 0&&(d={}),this.attrName=c,this.keyName=h;var p=s.Scope.TYPE&s.Scope.ATTRIBUTE;d.scope!=null?this.scope=d.scope&s.Scope.LEVEL|p:this.scope=s.Scope.ATTRIBUTE,d.whitelist!=null&&(this.whitelist=d.whitelist)}return o.keys=function(c){return[].map.call(c.attributes,function(h){return h.name})},o.prototype.add=function(c,h){return this.canAdd(c,h)?(c.setAttribute(this.keyName,h),!0):!1},o.prototype.canAdd=function(c,h){var d=s.query(c,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return d==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},o.prototype.remove=function(c){c.removeAttribute(this.keyName)},o.prototype.value=function(c){var h=c.getAttribute(this.keyName);return this.canAdd(c,h)&&h?h:""},o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=function(){function P(B,I){var C=[],k=!0,M=!1,F=void 0;try{for(var $=B[Symbol.iterator](),V;!(k=(V=$.next()).done)&&(C.push(V.value),!(I&&C.length===I));k=!0);}catch(q){M=!0,F=q}finally{try{!k&&$.return&&$.return()}finally{if(M)throw F}}return C}return function(B,I){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return P(B,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function P(B,I){for(var C=0;C<I.length;C++){var k=I[C];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(B,k.key,k)}}return function(B,I,C){return I&&P(B.prototype,I),C&&P(B,C),B}}(),o=function P(B,I,C){B===null&&(B=Function.prototype);var k=Object.getOwnPropertyDescriptor(B,I);if(k===void 0){var M=Object.getPrototypeOf(B);return M===null?void 0:P(M,I,C)}else{if("value"in k)return k.value;var F=k.get;return F===void 0?void 0:F.call(C)}},c=i(2),h=w(c),d=i(0),p=w(d),f=i(4),m=w(f),g=i(6),v=w(g),b=i(7),_=w(b);function w(P){return P&&P.__esModule?P:{default:P}}function S(P,B){if(!(P instanceof B))throw new TypeError("Cannot call a class as a function")}function x(P,B){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:P}function A(P,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);P.prototype=Object.create(B&&B.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(P,B):P.__proto__=B)}var N=function(P){A(B,P);function B(){return S(this,B),x(this,(B.__proto__||Object.getPrototypeOf(B)).apply(this,arguments))}return B}(v.default);N.blotName="code",N.tagName="CODE";var O=function(P){A(B,P);function B(){return S(this,B),x(this,(B.__proto__||Object.getPrototypeOf(B)).apply(this,arguments))}return a(B,[{key:"delta",value:function(){var C=this,k=this.domNode.textContent;return k.endsWith(`
865
- `)&&(k=k.slice(0,-1)),k.split(`
866
- `).reduce(function(M,F){return M.insert(F).insert(`
867
- `,C.formats())},new h.default)}},{key:"format",value:function(C,k){if(!(C===this.statics.blotName&&k)){var M=this.descendant(_.default,this.length()-1),F=s(M,1),$=F[0];$!=null&&$.deleteAt($.length()-1,1),o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"format",this).call(this,C,k)}}},{key:"formatAt",value:function(C,k,M,F){if(k!==0&&!(p.default.query(M,p.default.Scope.BLOCK)==null||M===this.statics.blotName&&F===this.statics.formats(this.domNode))){var $=this.newlineIndex(C);if(!($<0||$>=C+k)){var V=this.newlineIndex(C,!0)+1,q=$-V+1,X=this.isolate(V,q),G=X.next;X.format(M,F),G instanceof B&&G.formatAt(0,C-V+k-q,M,F)}}}},{key:"insertAt",value:function(C,k,M){if(M==null){var F=this.descendant(_.default,C),$=s(F,2),V=$[0],q=$[1];V.insertAt(q,k)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
868
- `)?C:C+1}},{key:"newlineIndex",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(k)return this.domNode.textContent.slice(0,C).lastIndexOf(`
869
- `);var M=this.domNode.textContent.slice(C).indexOf(`
870
- `);return M>-1?C+M:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
871
- `)||this.appendChild(p.default.create("text",`
872
- `)),o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"optimize",this).call(this,C);var k=this.next;k!=null&&k.prev===this&&k.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===k.statics.formats(k.domNode)&&(k.optimize(C),k.moveChildren(this),k.remove())}},{key:"replace",value:function(C){o(B.prototype.__proto__||Object.getPrototypeOf(B.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(k){var M=p.default.find(k);M==null?k.parentNode.removeChild(k):M instanceof p.default.Embed?M.remove():M.unwrap()})}}],[{key:"create",value:function(C){var k=o(B.__proto__||Object.getPrototypeOf(B),"create",this).call(this,C);return k.setAttribute("spellcheck",!1),k}},{key:"formats",value:function(){return!0}}]),B}(m.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",n.Code=N,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},a=function(){function G(D,L){var U=[],H=!0,Y=!1,K=void 0;try{for(var j=D[Symbol.iterator](),W;!(H=(W=j.next()).done)&&(U.push(W.value),!(L&&U.length===L));H=!0);}catch(Q){Y=!0,K=Q}finally{try{!H&&j.return&&j.return()}finally{if(Y)throw K}}return U}return function(D,L){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return G(D,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function G(D,L){for(var U=0;U<L.length;U++){var H=L[U];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(D,H.key,H)}}return function(D,L,U){return L&&G(D.prototype,L),U&&G(D,U),D}}(),c=i(2),h=k(c),d=i(20),p=k(d),f=i(0),m=k(f),g=i(13),v=k(g),b=i(24),_=k(b),w=i(4),S=k(w),x=i(16),A=k(x),N=i(21),O=k(N),P=i(11),B=k(P),I=i(3),C=k(I);function k(G){return G&&G.__esModule?G:{default:G}}function M(G,D,L){return D in G?Object.defineProperty(G,D,{value:L,enumerable:!0,configurable:!0,writable:!0}):G[D]=L,G}function F(G,D){if(!(G instanceof D))throw new TypeError("Cannot call a class as a function")}var $=/^[ -~]*$/,V=function(){function G(D){F(this,G),this.scroll=D,this.delta=this.getDelta()}return o(G,[{key:"applyDelta",value:function(L){var U=this,H=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),L=X(L),L.reduce(function(K,j){var W=j.retain||j.delete||j.insert.length||1,Q=j.attributes||{};if(j.insert!=null){if(typeof j.insert=="string"){var tt=j.insert;tt.endsWith(`
873
- `)&&H&&(H=!1,tt=tt.slice(0,-1)),K>=Y&&!tt.endsWith(`
874
- `)&&(H=!0),U.scroll.insertAt(K,tt);var rt=U.scroll.line(K),ct=a(rt,2),_t=ct[0],yt=ct[1],Nt=(0,C.default)({},(0,w.bubbleFormats)(_t));if(_t instanceof S.default){var Ft=_t.descendant(m.default.Leaf,yt),ie=a(Ft,1),ne=ie[0];Nt=(0,C.default)(Nt,(0,w.bubbleFormats)(ne))}Q=p.default.attributes.diff(Nt,Q)||{}}else if(s(j.insert)==="object"){var nt=Object.keys(j.insert)[0];if(nt==null)return K;U.scroll.insertAt(K,nt,j.insert[nt])}Y+=W}return Object.keys(Q).forEach(function(at){U.scroll.formatAt(K,W,at,Q[at])}),K+W},0),L.reduce(function(K,j){return typeof j.delete=="number"?(U.scroll.deleteAt(K,j.delete),K):K+(j.retain||j.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,U){return this.scroll.deleteAt(L,U),this.update(new h.default().retain(L).delete(U))}},{key:"formatLine",value:function(L,U){var H=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(K){if(!(H.scroll.whitelist!=null&&!H.scroll.whitelist[K])){var j=H.scroll.lines(L,Math.max(U,1)),W=U;j.forEach(function(Q){var tt=Q.length();if(!(Q instanceof v.default))Q.format(K,Y[K]);else{var rt=L-Q.offset(H.scroll),ct=Q.newlineIndex(rt+W)-rt+1;Q.formatAt(rt,ct,K,Y[K])}W-=tt})}}),this.scroll.optimize(),this.update(new h.default().retain(L).retain(U,(0,O.default)(Y)))}},{key:"formatText",value:function(L,U){var H=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(K){H.scroll.formatAt(L,U,K,Y[K])}),this.update(new h.default().retain(L).retain(U,(0,O.default)(Y)))}},{key:"getContents",value:function(L,U){return this.delta.slice(L,L+U)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,U){return L.concat(U.delta())},new h.default)}},{key:"getFormat",value:function(L){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,H=[],Y=[];U===0?this.scroll.path(L).forEach(function(j){var W=a(j,1),Q=W[0];Q instanceof S.default?H.push(Q):Q instanceof m.default.Leaf&&Y.push(Q)}):(H=this.scroll.lines(L,U),Y=this.scroll.descendants(m.default.Leaf,L,U));var K=[H,Y].map(function(j){if(j.length===0)return{};for(var W=(0,w.bubbleFormats)(j.shift());Object.keys(W).length>0;){var Q=j.shift();if(Q==null)return W;W=q((0,w.bubbleFormats)(Q),W)}return W});return C.default.apply(C.default,K)}},{key:"getText",value:function(L,U){return this.getContents(L,U).filter(function(H){return typeof H.insert=="string"}).map(function(H){return H.insert}).join("")}},{key:"insertEmbed",value:function(L,U,H){return this.scroll.insertAt(L,U,H),this.update(new h.default().retain(L).insert(M({},U,H)))}},{key:"insertText",value:function(L,U){var H=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return U=U.replace(/\r\n/g,`
555
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:ke,function(){return function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(17),a=i(18),o=i(19),l=i(45),h=i(46),c=i(47),f=i(48),u=i(49),d=i(12),p=i(32),v=i(33),g=i(31),y=i(1),b={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:s.default,Format:a.default,Leaf:o.default,Embed:f.default,Scroll:l.default,Block:c.default,Inline:h.default,Text:u.default,Attributor:{Attribute:d.default,Class:p.default,Style:v.default,Store:g.default}};n.default=b},function(r,n,i){var s=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var _ in b)b.hasOwnProperty(_)&&(y[_]=b[_])};return function(y,b){g(y,b);function _(){this.constructor=y}y.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(g){s(y,g);function y(b){var _=this;return b="[Parchment] "+b,_=g.call(this,b)||this,_.message=b,_.name=_.constructor.name,_}return y}(Error);n.ParchmentError=a;var o={},l={},h={},c={};n.DATA_KEY="__blot";var f;(function(g){g[g.TYPE=3]="TYPE",g[g.LEVEL=12]="LEVEL",g[g.ATTRIBUTE=13]="ATTRIBUTE",g[g.BLOT=14]="BLOT",g[g.INLINE=7]="INLINE",g[g.BLOCK=11]="BLOCK",g[g.BLOCK_BLOT=10]="BLOCK_BLOT",g[g.INLINE_BLOT=6]="INLINE_BLOT",g[g.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",g[g.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",g[g.ANY=15]="ANY"})(f=n.Scope||(n.Scope={}));function u(g,y){var b=p(g);if(b==null)throw new a("Unable to create "+g+" blot");var _=b,m=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:_.create(y);return new _(m,y)}n.create=u;function d(g,y){return y===void 0&&(y=!1),g==null?null:g[n.DATA_KEY]!=null?g[n.DATA_KEY].blot:y?d(g.parentNode,y):null}n.find=d;function p(g,y){y===void 0&&(y=f.ANY);var b;if(typeof g=="string")b=c[g]||o[g];else if(g instanceof Text||g.nodeType===Node.TEXT_NODE)b=c.text;else if(typeof g=="number")g&f.LEVEL&f.BLOCK?b=c.block:g&f.LEVEL&f.INLINE&&(b=c.inline);else if(g instanceof HTMLElement){var _=(g.getAttribute("class")||"").split(/\s+/);for(var m in _)if(b=l[_[m]],b)break;b=b||h[g.tagName]}return b==null?null:y&f.LEVEL&b.scope&&y&f.TYPE&b.scope?b:null}n.query=p;function v(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];if(g.length>1)return g.map(function(m){return v(m)});var b=g[0];if(typeof b.blotName!="string"&&typeof b.attrName!="string")throw new a("Invalid definition");if(b.blotName==="abstract")throw new a("Cannot register abstract class");if(c[b.blotName||b.attrName]=b,typeof b.keyName=="string")o[b.keyName]=b;else if(b.className!=null&&(l[b.className]=b),b.tagName!=null){Array.isArray(b.tagName)?b.tagName=b.tagName.map(function(m){return m.toUpperCase()}):b.tagName=b.tagName.toUpperCase();var _=Array.isArray(b.tagName)?b.tagName:[b.tagName];_.forEach(function(m){(h[m]==null||b.className==null)&&(h[m]=b)})}return b}n.register=v},function(r,n,i){var s=i(51),a=i(11),o=i(3),l=i(20),h=String.fromCharCode(0),c=function(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]};c.prototype.insert=function(f,u){var d={};return f.length===0?this:(d.insert=f,u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d))},c.prototype.delete=function(f){return f<=0?this:this.push({delete:f})},c.prototype.retain=function(f,u){if(f<=0)return this;var d={retain:f};return u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d)},c.prototype.push=function(f){var u=this.ops.length,d=this.ops[u-1];if(f=o(!0,{},f),typeof d=="object"){if(typeof f.delete=="number"&&typeof d.delete=="number")return this.ops[u-1]={delete:d.delete+f.delete},this;if(typeof d.delete=="number"&&f.insert!=null&&(u-=1,d=this.ops[u-1],typeof d!="object"))return this.ops.unshift(f),this;if(a(f.attributes,d.attributes)){if(typeof f.insert=="string"&&typeof d.insert=="string")return this.ops[u-1]={insert:d.insert+f.insert},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof d.retain=="number")return this.ops[u-1]={retain:d.retain+f.retain},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this}}return u===this.ops.length?this.ops.push(f):this.ops.splice(u,0,f),this},c.prototype.chop=function(){var f=this.ops[this.ops.length-1];return f&&f.retain&&!f.attributes&&this.ops.pop(),this},c.prototype.filter=function(f){return this.ops.filter(f)},c.prototype.forEach=function(f){this.ops.forEach(f)},c.prototype.map=function(f){return this.ops.map(f)},c.prototype.partition=function(f){var u=[],d=[];return this.forEach(function(p){var v=f(p)?u:d;v.push(p)}),[u,d]},c.prototype.reduce=function(f,u){return this.ops.reduce(f,u)},c.prototype.changeLength=function(){return this.reduce(function(f,u){return u.insert?f+l.length(u):u.delete?f-u.delete:f},0)},c.prototype.length=function(){return this.reduce(function(f,u){return f+l.length(u)},0)},c.prototype.slice=function(f,u){f=f||0,typeof u!="number"&&(u=1/0);for(var d=[],p=l.iterator(this.ops),v=0;v<u&&p.hasNext();){var g;v<f?g=p.next(f-v):(g=p.next(u-v),d.push(g)),v+=l.length(g)}return new c(d)},c.prototype.compose=function(f){var u=l.iterator(this.ops),d=l.iterator(f.ops),p=[],v=d.peek();if(v!=null&&typeof v.retain=="number"&&v.attributes==null){for(var g=v.retain;u.peekType()==="insert"&&u.peekLength()<=g;)g-=u.peekLength(),p.push(u.next());v.retain-g>0&&d.next(v.retain-g)}for(var y=new c(p);u.hasNext()||d.hasNext();)if(d.peekType()==="insert")y.push(d.next());else if(u.peekType()==="delete")y.push(u.next());else{var b=Math.min(u.peekLength(),d.peekLength()),_=u.next(b),m=d.next(b);if(typeof m.retain=="number"){var x={};typeof _.retain=="number"?x.retain=b:x.insert=_.insert;var S=l.attributes.compose(_.attributes,m.attributes,typeof _.retain=="number");if(S&&(x.attributes=S),y.push(x),!d.hasNext()&&a(y.ops[y.ops.length-1],x)){var w=new c(u.rest());return y.concat(w).chop()}}else typeof m.delete=="number"&&typeof _.retain=="number"&&y.push(m)}return y.chop()},c.prototype.concat=function(f){var u=new c(this.ops.slice());return f.ops.length>0&&(u.push(f.ops[0]),u.ops=u.ops.concat(f.ops.slice(1))),u},c.prototype.diff=function(f,u){if(this.ops===f.ops)return new c;var d=[this,f].map(function(b){return b.map(function(_){if(_.insert!=null)return typeof _.insert=="string"?_.insert:h;var m=b===f?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),p=new c,v=s(d[0],d[1],u),g=l.iterator(this.ops),y=l.iterator(f.ops);return v.forEach(function(b){for(var _=b[1].length;_>0;){var m=0;switch(b[0]){case s.INSERT:m=Math.min(y.peekLength(),_),p.push(y.next(m));break;case s.DELETE:m=Math.min(_,g.peekLength()),g.next(m),p.delete(m);break;case s.EQUAL:m=Math.min(g.peekLength(),y.peekLength(),_);var x=g.next(m),S=y.next(m);a(x.insert,S.insert)?p.retain(m,l.attributes.diff(x.attributes,S.attributes)):p.push(S).delete(m);break}_-=m}}),p.chop()},c.prototype.eachLine=function(f,u){u=u||`
556
+ `;for(var d=l.iterator(this.ops),p=new c,v=0;d.hasNext();){if(d.peekType()!=="insert")return;var g=d.peek(),y=l.length(g)-d.peekLength(),b=typeof g.insert=="string"?g.insert.indexOf(u,y)-y:-1;if(b<0)p.push(d.next());else if(b>0)p.push(d.next(b));else{if(f(p,d.next(1).attributes||{},v)===!1)return;v+=1,p=new c}}p.length()>0&&f(p,{},v)},c.prototype.transform=function(f,u){if(u=!!u,typeof f=="number")return this.transformPosition(f,u);for(var d=l.iterator(this.ops),p=l.iterator(f.ops),v=new c;d.hasNext()||p.hasNext();)if(d.peekType()==="insert"&&(u||p.peekType()!=="insert"))v.retain(l.length(d.next()));else if(p.peekType()==="insert")v.push(p.next());else{var g=Math.min(d.peekLength(),p.peekLength()),y=d.next(g),b=p.next(g);if(y.delete)continue;b.delete?v.push(b):v.retain(g,l.attributes.transform(y.attributes,b.attributes,u))}return v.chop()},c.prototype.transformPosition=function(f,u){u=!!u;for(var d=l.iterator(this.ops),p=0;d.hasNext()&&p<=f;){var v=d.peekLength(),g=d.peekType();if(d.next(),g==="delete"){f-=Math.min(v,f-p);continue}else g==="insert"&&(p<f||!u)&&(f+=v);p+=v}return f},r.exports=c},function(r,n){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):s.call(d)==="[object Array]"},h=function(d){if(!d||s.call(d)!=="[object Object]")return!1;var p=i.call(d,"constructor"),v=d.constructor&&d.constructor.prototype&&i.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!v)return!1;var g;for(g in d);return typeof g>"u"||i.call(d,g)},c=function(d,p){a&&p.name==="__proto__"?a(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},f=function(d,p){if(p==="__proto__")if(i.call(d,p)){if(o)return o(d,p).value}else return;return d[p]};r.exports=function u(){var d,p,v,g,y,b,_=arguments[0],m=1,x=arguments.length,S=!1;for(typeof _=="boolean"&&(S=_,_=arguments[1]||{},m=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});m<x;++m)if(d=arguments[m],d!=null)for(p in d)v=f(_,p),g=f(d,p),_!==g&&(S&&g&&(h(g)||(y=l(g)))?(y?(y=!1,b=v&&l(v)?v:[]):b=v&&h(v)?v:{},c(_,{name:p,newValue:u(S,b,g)})):typeof g<"u"&&c(_,{name:p,newValue:g}));return _}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var s=function(){function E(O,R){for(var C=0;C<R.length;C++){var F=R[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(O,F.key,F)}}return function(O,R,C){return R&&E(O.prototype,R),C&&E(O,C),O}}(),a=function E(O,R,C){O===null&&(O=Function.prototype);var F=Object.getOwnPropertyDescriptor(O,R);if(F===void 0){var U=Object.getPrototypeOf(O);return U===null?void 0:E(U,R,C)}else{if("value"in F)return F.value;var D=F.get;return D===void 0?void 0:D.call(C)}},o=i(3),l=_(o),h=i(2),c=_(h),f=i(0),u=_(f),d=i(16),p=_(d),v=i(6),g=_(v),y=i(7),b=_(y);function _(E){return E&&E.__esModule?E:{default:E}}function m(E,O){if(!(E instanceof O))throw new TypeError("Cannot call a class as a function")}function x(E,O){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:E}function S(E,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);E.prototype=Object.create(O&&O.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(E,O):E.__proto__=O)}var w=1,T=function(E){S(O,E);function O(){return m(this,O),x(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return s(O,[{key:"attach",value:function(){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"attach",this).call(this),this.attributes=new u.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new c.default().insert(this.value(),(0,l.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(C,F){var U=u.default.query(C,u.default.Scope.BLOCK_ATTRIBUTE);U!=null&&this.attributes.attribute(U,F)}},{key:"formatAt",value:function(C,F,U,D){this.format(U,D)}},{key:"insertAt",value:function(C,F,U){if(typeof F=="string"&&F.endsWith(`
557
+ `)){var D=u.default.create(N.blotName);this.parent.insertBefore(D,C===0?this:this.next),D.insertAt(0,F.slice(0,-1))}else a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,C,F,U)}}]),O}(u.default.Embed);T.scope=u.default.Scope.BLOCK_BLOT;var N=function(E){S(O,E);function O(R){m(this,O);var C=x(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R));return C.cache={},C}return s(O,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(u.default.Leaf).reduce(function(C,F){return F.length()===0?C:C.insert(F.value(),A(F))},new c.default).insert(`
558
+ `,A(this))),this.cache.delta}},{key:"deleteAt",value:function(C,F){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,C,F),this.cache={}}},{key:"formatAt",value:function(C,F,U,D){F<=0||(u.default.query(U,u.default.Scope.BLOCK)?C+F===this.length()&&this.format(U,D):a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,C,Math.min(F,this.length()-C-1),U,D),this.cache={})}},{key:"insertAt",value:function(C,F,U){if(U!=null)return a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,C,F,U);if(F.length!==0){var D=F.split(`
559
+ `),z=D.shift();z.length>0&&(C<this.length()-1||this.children.tail==null?a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(C,this.length()-1),z):this.children.tail.insertAt(this.children.tail.length(),z),this.cache={});var j=this;D.reduce(function(k,I){return j=j.split(k,!0),j.insertAt(0,I),I.length},C+z.length)}}},{key:"insertBefore",value:function(C,F){var U=this.children.head;a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,C,F),U instanceof p.default&&U.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+w),this.cache.length}},{key:"moveChildren",value:function(C,F){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,C,F),this.cache={}}},{key:"optimize",value:function(C){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,C),this.cache={}}},{key:"path",value:function(C){return a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,C,!0)}},{key:"removeChild",value:function(C){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"removeChild",this).call(this,C),this.cache={}}},{key:"split",value:function(C){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(F&&(C===0||C>=this.length()-w)){var U=this.clone();return C===0?(this.parent.insertBefore(U,this),this):(this.parent.insertBefore(U,this.next),U)}else{var D=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,C,F);return this.cache={},D}}}]),O}(u.default.Block);N.blotName="block",N.tagName="P",N.defaultChild="break",N.allowedChildren=[g.default,u.default.Embed,b.default];function A(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E==null||(typeof E.formats=="function"&&(O=(0,l.default)(O,E.formats())),E.parent==null||E.parent.blotName=="scroll"||E.parent.statics.scope!==E.statics.scope)?O:A(E.parent,O)}n.bubbleFormats=A,n.BlockEmbed=T,n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(k,I){var P=[],L=!0,G=!1,$=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(I&&P.length===I));L=!0);}catch(q){G=!0,$=q}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return P}return function(k,I){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,I){for(var P=0;P<I.length;P++){var L=I[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,I,P){return I&&j(k.prototype,I),P&&j(k,P),k}}();i(50);var l=i(2),h=A(l),c=i(14),f=A(c),u=i(8),d=A(u),p=i(9),v=A(p),g=i(0),y=A(g),b=i(15),_=A(b),m=i(3),x=A(m),S=i(10),w=A(S),T=i(34),N=A(T);function A(j){return j&&j.__esModule?j:{default:j}}function E(j,k,I){return k in j?Object.defineProperty(j,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[k]=I,j}function O(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var R=(0,w.default)("quill"),C=function(){o(j,null,[{key:"debug",value:function(I){I===!0&&(I="log"),w.default.level(I)}},{key:"find",value:function(I){return I.__quill||y.default.find(I)}},{key:"import",value:function(I){return this.imports[I]==null&&R.error("Cannot import "+I+". Are you sure it was registered?"),this.imports[I]}},{key:"register",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof I!="string"){var $=I.attrName||I.blotName;typeof $=="string"?this.register("formats/"+$,I,P):Object.keys(I).forEach(function(M){L.register(M,I[M],P)})}else this.imports[I]!=null&&!G&&R.warn("Overwriting "+I+" with",P),this.imports[I]=P,(I.startsWith("blots/")||I.startsWith("formats/"))&&P.blotName!=="abstract"?y.default.register(P):I.startsWith("modules")&&typeof P.register=="function"&&P.register()}}]);function j(k){var I=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,j),this.options=F(k,P),this.container=this.options.container,this.container==null)return R.error("Invalid Quill container",k);this.options.debug&&j.debug(this.options.debug);var L=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new d.default,this.scroll=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new f.default(this.scroll),this.selection=new _.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(d.default.events.EDITOR_CHANGE,function($){$===d.default.events.TEXT_CHANGE&&I.root.classList.toggle("ql-blank",I.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function($,M){var B=I.selection.lastRange,q=B&&B.length===0?B.index:void 0;U.call(I,function(){return I.editor.update(null,M,q)},$)});var G=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+L+"<p><br></p></div>");this.setContents(G),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(j,[{key:"addContainer",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof I=="string"){var L=I;I=document.createElement("div"),I.classList.add(L)}return this.container.insertBefore(I,P),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,P,L){var G=this,$=D(I,P,L),M=a($,4);return I=M[0],P=M[1],L=M[3],U.call(this,function(){return G.editor.deleteText(I,P)},L,I,-1*P)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(I),this.container.classList.toggle("ql-disabled",!I)}},{key:"focus",value:function(){var I=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=I,this.scrollIntoView()}},{key:"format",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return U.call(this,function(){var $=L.getSelection(!0),M=new h.default;if($==null)return M;if(y.default.query(I,y.default.Scope.BLOCK))M=L.editor.formatLine($.index,$.length,E({},I,P));else{if($.length===0)return L.selection.format(I,P),M;M=L.editor.formatText($.index,$.length,E({},I,P))}return L.setSelection($,d.default.sources.SILENT),M},G)}},{key:"formatLine",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,P,L,G,$),H=a(q,4);return I=H[0],P=H[1],B=H[2],$=H[3],U.call(this,function(){return M.editor.formatLine(I,P,B)},$,I,0)}},{key:"formatText",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,P,L,G,$),H=a(q,4);return I=H[0],P=H[1],B=H[2],$=H[3],U.call(this,function(){return M.editor.formatText(I,P,B)},$,I,0)}},{key:"getBounds",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof I=="number"?L=this.selection.getBounds(I,P):L=this.selection.getBounds(I.index,I.length);var G=this.container.getBoundingClientRect();return{bottom:L.bottom-G.top,height:L.height,left:L.left-G.left,right:L.right-G.left,top:L.top-G.top,width:L.width}}},{key:"getContents",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,P),G=a(L,2);return I=G[0],P=G[1],this.editor.getContents(I,P)}},{key:"getFormat",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof I=="number"?this.editor.getFormat(I,P):this.editor.getFormat(I.index,I.length)}},{key:"getIndex",value:function(I){return I.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(I){return this.scroll.leaf(I)}},{key:"getLine",value:function(I){return this.scroll.line(I)}},{key:"getLines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof I!="number"?this.scroll.lines(I.index,I.length):this.scroll.lines(I,P)}},{key:"getModule",value:function(I){return this.theme.modules[I]}},{key:"getSelection",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return I&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,P),G=a(L,2);return I=G[0],P=G[1],this.editor.getText(I,P)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,P,L){var G=this,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return U.call(this,function(){return G.editor.insertEmbed(I,P,L)},$,I)}},{key:"insertText",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,0,L,G,$),H=a(q,4);return I=H[0],B=H[2],$=H[3],U.call(this,function(){return M.editor.insertText(I,P,B)},$,I,P.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(I,P,L){this.clipboard.dangerouslyPasteHTML(I,P,L)}},{key:"removeFormat",value:function(I,P,L){var G=this,$=D(I,P,L),M=a($,4);return I=M[0],P=M[1],L=M[3],U.call(this,function(){return G.editor.removeFormat(I,P)},L,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return U.call(this,function(){I=new h.default(I);var G=P.getLength(),$=P.editor.deleteText(0,G),M=P.editor.applyDelta(I),B=M.ops[M.ops.length-1];B!=null&&typeof B.insert=="string"&&B.insert[B.insert.length-1]===`
560
+ `&&(P.editor.deleteText(P.getLength()-1,1),M.delete(1));var q=$.compose(M);return q},L)}},{key:"setSelection",value:function(I,P,L){if(I==null)this.selection.setRange(null,P||j.sources.API);else{var G=D(I,P,L),$=a(G,4);I=$[0],P=$[1],L=$[3],this.selection.setRange(new b.Range(I,P),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new h.default().insert(I);return this.setContents(L,P)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,P=this.scroll.update(I);return this.selection.update(I),P}},{key:"updateContents",value:function(I){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return U.call(this,function(){return I=new h.default(I),P.editor.applyDelta(I,L)},L,!0)}}]),j}();C.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},C.events=d.default.events,C.sources=d.default.sources,C.version="1.3.7",C.imports={delta:h.default,parchment:y.default,"core/module":v.default,"core/theme":N.default};function F(j,k){if(k=(0,x.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},k),!k.theme||k.theme===C.DEFAULTS.theme)k.theme=N.default;else if(k.theme=C.import("themes/"+k.theme),k.theme==null)throw new Error("Invalid theme "+k.theme+". Did you register it?");var I=(0,x.default)(!0,{},k.theme.DEFAULTS);[I,k].forEach(function(G){G.modules=G.modules||{},Object.keys(G.modules).forEach(function($){G.modules[$]===!0&&(G.modules[$]={})})});var P=Object.keys(I.modules).concat(Object.keys(k.modules)),L=P.reduce(function(G,$){var M=C.import("modules/"+$);return M==null?R.error("Cannot load "+$+" module. Are you sure you registered it?"):G[$]=M.DEFAULTS||{},G},{});return k.modules!=null&&k.modules.toolbar&&k.modules.toolbar.constructor!==Object&&(k.modules.toolbar={container:k.modules.toolbar}),k=(0,x.default)(!0,{},C.DEFAULTS,{modules:L},I,k),["bounds","container","scrollingContainer"].forEach(function(G){typeof k[G]=="string"&&(k[G]=document.querySelector(k[G]))}),k.modules=Object.keys(k.modules).reduce(function(G,$){return k.modules[$]&&(G[$]=k.modules[$]),G},{}),k}function U(j,k,I,P){if(this.options.strict&&!this.isEnabled()&&k===d.default.sources.USER)return new h.default;var L=I==null?null:this.getSelection(),G=this.editor.delta,$=j();if(L!=null&&(I===!0&&(I=L.index),P==null?L=z(L,$,k):P!==0&&(L=z(L,I,P,k)),this.setSelection(L,d.default.sources.SILENT)),$.length()>0){var M,B=[d.default.events.TEXT_CHANGE,$,G,k];if((M=this.emitter).emit.apply(M,[d.default.events.EDITOR_CHANGE].concat(B)),k!==d.default.sources.SILENT){var q;(q=this.emitter).emit.apply(q,B)}}return $}function D(j,k,I,P,L){var G={};return typeof j.index=="number"&&typeof j.length=="number"?typeof k!="number"?(L=P,P=I,I=k,k=j.length,j=j.index):(k=j.length,j=j.index):typeof k!="number"&&(L=P,P=I,I=k,k=0),(typeof I>"u"?"undefined":s(I))==="object"?(G=I,L=P):typeof I=="string"&&(P!=null?G[I]=P:L=I),L=L||d.default.sources.API,[j,k,G,L]}function z(j,k,I,P){if(j==null)return null;var L=void 0,G=void 0;if(k instanceof h.default){var $=[j.index,j.index+j.length].map(function(H){return k.transformPosition(H,P!==d.default.sources.USER)}),M=a($,2);L=M[0],G=M[1]}else{var B=[j.index,j.index+j.length].map(function(H){return H<k||H===k&&P===d.default.sources.USER?H:I>=0?H+I:Math.max(k,H+I)}),q=a(B,2);L=q[0],G=q[1]}return new b.Range(L,G-L)}n.expandConfig=F,n.overload=D,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(7),l=f(o),h=i(0),c=f(h);function f(g){return g&&g.__esModule?g:{default:g}}function u(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function d(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function p(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var v=function(g){p(y,g);function y(){return u(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"formatAt",value:function(_,m,x,S){if(y.compare(this.statics.blotName,x)<0&&c.default.query(x,c.default.Scope.BLOT)){var w=this.isolate(_,m);S&&w.wrap(x,S)}else a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,_,m,x,S)}},{key:"optimize",value:function(_){if(a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,_),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(_,m){var x=y.order.indexOf(_),S=y.order.indexOf(m);return x>=0||S>=0?x-S:_===m?0:_<m?-1:1}}]),y}(c.default.Inline);v.allowedChildren=[v,c.default.Embed,l.default],v.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function h(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default.Text);n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,m){for(var x=0;x<m.length;x++){var S=m[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,m,x){return m&&b(_.prototype,m),x&&b(_,x),_}}(),a=function b(_,m,x){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,m);if(S===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,m,x)}else{if("value"in S)return S.value;var T=S.get;return T===void 0?void 0:T.call(x)}},o=i(54),l=f(o),h=i(10),c=f(h);function f(b){return b&&b.__esModule?b:{default:b}}function u(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function d(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var v=(0,c.default)("quill:events"),g=["selectionchange","mousedown","mouseup","click"];g.forEach(function(b){document.addEventListener(b,function(){for(var _=arguments.length,m=Array(_),x=0;x<_;x++)m[x]=arguments[x];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(S){if(S.__quill&&S.__quill.emitter){var w;(w=S.__quill.emitter).handleDOM.apply(w,m)}})})});var y=function(b){p(_,b);function _(){u(this,_);var m=d(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return m.listeners={},m.on("error",v.error),m}return s(_,[{key:"emit",value:function(){v.log.apply(v,arguments),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(x){for(var S=arguments.length,w=Array(S>1?S-1:0),T=1;T<S;T++)w[T-1]=arguments[T];(this.listeners[x.type]||[]).forEach(function(N){var A=N.node,E=N.handler;(x.target===A||A.contains(x.target))&&E.apply(void 0,[x].concat(w))})}},{key:"listenDOM",value:function(x,S,w){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:S,handler:w})}}]),_}(l.default);y.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},y.sources={API:"api",SILENT:"silent",USER:"user"},n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function s(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}var a=function o(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=l,this.options=h};a.DEFAULTS={},n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],a="warn";function o(h){if(s.indexOf(h)<=s.indexOf(a)){for(var c,f=arguments.length,u=Array(f>1?f-1:0),d=1;d<f;d++)u[d-1]=arguments[d];(c=console)[h].apply(c,u)}}function l(h){return s.reduce(function(c,f){return c[f]=o.bind(console,f,h),c},{})}o.level=l.level=function(h){a=h},n.default=l},function(r,n,i){var s=Array.prototype.slice,a=i(52),o=i(53),l=r.exports=function(u,d,p){return p||(p={}),u===d?!0:u instanceof Date&&d instanceof Date?u.getTime()===d.getTime():!u||!d||typeof u!="object"&&typeof d!="object"?p.strict?u===d:u==d:f(u,d,p)};function h(u){return u==null}function c(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function f(u,d,p){var v,g;if(h(u)||h(d)||u.prototype!==d.prototype)return!1;if(o(u))return o(d)?(u=s.call(u),d=s.call(d),l(u,d,p)):!1;if(c(u)){if(!c(d)||u.length!==d.length)return!1;for(v=0;v<u.length;v++)if(u[v]!==d[v])return!1;return!0}try{var y=a(u),b=a(d)}catch{return!1}if(y.length!=b.length)return!1;for(y.sort(),b.sort(),v=y.length-1;v>=0;v--)if(y[v]!=b[v])return!1;for(v=y.length-1;v>=0;v--)if(g=y[v],!l(u[g],d[g],p))return!1;return typeof u==typeof d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(l,h,c){c===void 0&&(c={}),this.attrName=l,this.keyName=h;var f=s.Scope.TYPE&s.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&s.Scope.LEVEL|f:this.scope=s.Scope.ATTRIBUTE,c.whitelist!=null&&(this.whitelist=c.whitelist)}return o.keys=function(l){return[].map.call(l.attributes,function(h){return h.name})},o.prototype.add=function(l,h){return this.canAdd(l,h)?(l.setAttribute(this.keyName,h),!0):!1},o.prototype.canAdd=function(l,h){var c=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return c==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},o.prototype.remove=function(l){l.removeAttribute(this.keyName)},o.prototype.value=function(l){var h=l.getAttribute(this.keyName);return this.canAdd(l,h)&&h?h:""},o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=function(){function T(N,A){var E=[],O=!0,R=!1,C=void 0;try{for(var F=N[Symbol.iterator](),U;!(O=(U=F.next()).done)&&(E.push(U.value),!(A&&E.length===A));O=!0);}catch(D){R=!0,C=D}finally{try{!O&&F.return&&F.return()}finally{if(R)throw C}}return E}return function(N,A){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return T(N,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function T(N,A){for(var E=0;E<A.length;E++){var O=A[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,O.key,O)}}return function(N,A,E){return A&&T(N.prototype,A),E&&T(N,E),N}}(),o=function T(N,A,E){N===null&&(N=Function.prototype);var O=Object.getOwnPropertyDescriptor(N,A);if(O===void 0){var R=Object.getPrototypeOf(N);return R===null?void 0:T(R,A,E)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(E)}},l=i(2),h=b(l),c=i(0),f=b(c),u=i(4),d=b(u),p=i(6),v=b(p),g=i(7),y=b(g);function b(T){return T&&T.__esModule?T:{default:T}}function _(T,N){if(!(T instanceof N))throw new TypeError("Cannot call a class as a function")}function m(T,N){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:T}function x(T,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);T.prototype=Object.create(N&&N.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(T,N):T.__proto__=N)}var S=function(T){x(N,T);function N(){return _(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return N}(v.default);S.blotName="code",S.tagName="CODE";var w=function(T){x(N,T);function N(){return _(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return a(N,[{key:"delta",value:function(){var E=this,O=this.domNode.textContent;return O.endsWith(`
561
+ `)&&(O=O.slice(0,-1)),O.split(`
562
+ `).reduce(function(R,C){return R.insert(C).insert(`
563
+ `,E.formats())},new h.default)}},{key:"format",value:function(E,O){if(!(E===this.statics.blotName&&O)){var R=this.descendant(y.default,this.length()-1),C=s(R,1),F=C[0];F!=null&&F.deleteAt(F.length()-1,1),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"format",this).call(this,E,O)}}},{key:"formatAt",value:function(E,O,R,C){if(O!==0&&!(f.default.query(R,f.default.Scope.BLOCK)==null||R===this.statics.blotName&&C===this.statics.formats(this.domNode))){var F=this.newlineIndex(E);if(!(F<0||F>=E+O)){var U=this.newlineIndex(E,!0)+1,D=F-U+1,z=this.isolate(U,D),j=z.next;z.format(R,C),j instanceof N&&j.formatAt(0,E-U+O-D,R,C)}}}},{key:"insertAt",value:function(E,O,R){if(R==null){var C=this.descendant(y.default,E),F=s(C,2),U=F[0],D=F[1];U.insertAt(D,O)}}},{key:"length",value:function(){var E=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
564
+ `)?E:E+1}},{key:"newlineIndex",value:function(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,E).lastIndexOf(`
565
+ `);var R=this.domNode.textContent.slice(E).indexOf(`
566
+ `);return R>-1?E+R:-1}},{key:"optimize",value:function(E){this.domNode.textContent.endsWith(`
567
+ `)||this.appendChild(f.default.create("text",`
568
+ `)),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,E);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===O.statics.formats(O.domNode)&&(O.optimize(E),O.moveChildren(this),O.remove())}},{key:"replace",value:function(E){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"replace",this).call(this,E),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(O){var R=f.default.find(O);R==null?O.parentNode.removeChild(O):R instanceof f.default.Embed?R.remove():R.unwrap()})}}],[{key:"create",value:function(E){var O=o(N.__proto__||Object.getPrototypeOf(N),"create",this).call(this,E);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),N}(d.default);w.blotName="code-block",w.tagName="PRE",w.TAB=" ",n.Code=S,n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(k,I){var P=[],L=!0,G=!1,$=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(I&&P.length===I));L=!0);}catch(q){G=!0,$=q}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return P}return function(k,I){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,I){for(var P=0;P<I.length;P++){var L=I[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,I,P){return I&&j(k.prototype,I),P&&j(k,P),k}}(),l=i(2),h=O(l),c=i(20),f=O(c),u=i(0),d=O(u),p=i(13),v=O(p),g=i(24),y=O(g),b=i(4),_=O(b),m=i(16),x=O(m),S=i(21),w=O(S),T=i(11),N=O(T),A=i(3),E=O(A);function O(j){return j&&j.__esModule?j:{default:j}}function R(j,k,I){return k in j?Object.defineProperty(j,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[k]=I,j}function C(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,U=function(){function j(k){C(this,j),this.scroll=k,this.delta=this.getDelta()}return o(j,[{key:"applyDelta",value:function(I){var P=this,L=!1;this.scroll.update();var G=this.scroll.length();return this.scroll.batchStart(),I=z(I),I.reduce(function($,M){var B=M.retain||M.delete||M.insert.length||1,q=M.attributes||{};if(M.insert!=null){if(typeof M.insert=="string"){var H=M.insert;H.endsWith(`
569
+ `)&&L&&(L=!1,H=H.slice(0,-1)),$>=G&&!H.endsWith(`
570
+ `)&&(L=!0),P.scroll.insertAt($,H);var X=P.scroll.line($),K=a(X,2),et=K[0],it=K[1],ot=(0,E.default)({},(0,b.bubbleFormats)(et));if(et instanceof _.default){var ht=et.descendant(d.default.Leaf,it),Ct=a(ht,1),It=Ct[0];ot=(0,E.default)(ot,(0,b.bubbleFormats)(It))}q=f.default.attributes.diff(ot,q)||{}}else if(s(M.insert)==="object"){var V=Object.keys(M.insert)[0];if(V==null)return $;P.scroll.insertAt($,V,M.insert[V])}G+=B}return Object.keys(q).forEach(function(W){P.scroll.formatAt($,B,W,q[W])}),$+B},0),I.reduce(function($,M){return typeof M.delete=="number"?(P.scroll.deleteAt($,M.delete),$):$+(M.retain||M.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,P){return this.scroll.deleteAt(I,P),this.update(new h.default().retain(I).delete(P))}},{key:"formatLine",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(G).forEach(function($){if(!(L.scroll.whitelist!=null&&!L.scroll.whitelist[$])){var M=L.scroll.lines(I,Math.max(P,1)),B=P;M.forEach(function(q){var H=q.length();if(!(q instanceof v.default))q.format($,G[$]);else{var X=I-q.offset(L.scroll),K=q.newlineIndex(X+B)-X+1;q.formatAt(X,K,$,G[$])}B-=H})}}),this.scroll.optimize(),this.update(new h.default().retain(I).retain(P,(0,w.default)(G)))}},{key:"formatText",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(G).forEach(function($){L.scroll.formatAt(I,P,$,G[$])}),this.update(new h.default().retain(I).retain(P,(0,w.default)(G)))}},{key:"getContents",value:function(I,P){return this.delta.slice(I,I+P)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,P){return I.concat(P.delta())},new h.default)}},{key:"getFormat",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],G=[];P===0?this.scroll.path(I).forEach(function(M){var B=a(M,1),q=B[0];q instanceof _.default?L.push(q):q instanceof d.default.Leaf&&G.push(q)}):(L=this.scroll.lines(I,P),G=this.scroll.descendants(d.default.Leaf,I,P));var $=[L,G].map(function(M){if(M.length===0)return{};for(var B=(0,b.bubbleFormats)(M.shift());Object.keys(B).length>0;){var q=M.shift();if(q==null)return B;B=D((0,b.bubbleFormats)(q),B)}return B});return E.default.apply(E.default,$)}},{key:"getText",value:function(I,P){return this.getContents(I,P).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(I,P,L){return this.scroll.insertAt(I,P,L),this.update(new h.default().retain(I).insert(R({},P,L)))}},{key:"insertText",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return P=P.replace(/\r\n/g,`
875
571
  `).replace(/\r/g,`
876
- `),this.scroll.insertAt(L,U),Object.keys(Y).forEach(function(K){H.scroll.formatAt(L,U.length,K,Y[K])}),this.update(new h.default().retain(L).insert(U,(0,O.default)(Y)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==S.default.blotName||L.children.length>1?!1:L.children.head instanceof A.default}},{key:"removeFormat",value:function(L,U){var H=this.getText(L,U),Y=this.scroll.line(L+U),K=a(Y,2),j=K[0],W=K[1],Q=0,tt=new h.default;j!=null&&(j instanceof v.default?Q=j.newlineIndex(W)-W+1:Q=j.length()-W,tt=j.delta().slice(W,W+Q-1).insert(`
877
- `));var rt=this.getContents(L,U+Q),ct=rt.diff(new h.default().insert(H).concat(tt)),_t=new h.default().retain(L).concat(ct);return this.applyDelta(_t)}},{key:"update",value:function(L){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(U.length===1&&U[0].type==="characterData"&&U[0].target.data.match($)&&m.default.find(U[0].target)){var K=m.default.find(U[0].target),j=(0,w.bubbleFormats)(K),W=K.offset(this.scroll),Q=U[0].oldValue.replace(_.default.CONTENTS,""),tt=new h.default().insert(Q),rt=new h.default().insert(K.value()),ct=new h.default().retain(W).concat(tt.diff(rt,H));L=ct.reduce(function(_t,yt){return yt.insert?_t.insert(yt.insert,j):_t.push(yt)},new h.default),this.delta=Y.compose(L)}else this.delta=this.getDelta(),(!L||!(0,B.default)(Y.compose(L),this.delta))&&(L=Y.diff(this.delta,H));return L}}]),G}();function q(G,D){return Object.keys(D).reduce(function(L,U){return G[U]==null||(D[U]===G[U]?L[U]=D[U]:Array.isArray(D[U])?D[U].indexOf(G[U])<0&&(L[U]=D[U].concat([G[U]])):L[U]=[D[U],G[U]]),L},{})}function X(G){return G.reduce(function(D,L){if(L.insert===1){var U=(0,O.default)(L.attributes);return delete U.image,D.insert({image:L.attributes.image},U)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,O.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var H=L.insert.replace(/\r\n/g,`
572
+ `),this.scroll.insertAt(I,P),Object.keys(G).forEach(function($){L.scroll.formatAt(I,P.length,$,G[$])}),this.update(new h.default().retain(I).insert(P,(0,w.default)(G)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var I=this.scroll.children.head;return I.statics.blotName!==_.default.blotName||I.children.length>1?!1:I.children.head instanceof x.default}},{key:"removeFormat",value:function(I,P){var L=this.getText(I,P),G=this.scroll.line(I+P),$=a(G,2),M=$[0],B=$[1],q=0,H=new h.default;M!=null&&(M instanceof v.default?q=M.newlineIndex(B)-B+1:q=M.length()-B,H=M.delta().slice(B,B+q-1).insert(`
573
+ `));var X=this.getContents(I,P+q),K=X.diff(new h.default().insert(L).concat(H)),et=new h.default().retain(I).concat(K);return this.applyDelta(et)}},{key:"update",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,G=this.delta;if(P.length===1&&P[0].type==="characterData"&&P[0].target.data.match(F)&&d.default.find(P[0].target)){var $=d.default.find(P[0].target),M=(0,b.bubbleFormats)($),B=$.offset(this.scroll),q=P[0].oldValue.replace(y.default.CONTENTS,""),H=new h.default().insert(q),X=new h.default().insert($.value()),K=new h.default().retain(B).concat(H.diff(X,L));I=K.reduce(function(et,it){return it.insert?et.insert(it.insert,M):et.push(it)},new h.default),this.delta=G.compose(I)}else this.delta=this.getDelta(),(!I||!(0,N.default)(G.compose(I),this.delta))&&(I=G.diff(this.delta,L));return I}}]),j}();function D(j,k){return Object.keys(k).reduce(function(I,P){return j[P]==null||(k[P]===j[P]?I[P]=k[P]:Array.isArray(k[P])?k[P].indexOf(j[P])<0&&(I[P]=k[P].concat([j[P]])):I[P]=[k[P],j[P]]),I},{})}function z(j){return j.reduce(function(k,I){if(I.insert===1){var P=(0,w.default)(I.attributes);return delete P.image,k.insert({image:I.attributes.image},P)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,w.default)(I),I.attributes.list?I.attributes.list="ordered":(I.attributes.list="bullet",delete I.attributes.bullet)),typeof I.insert=="string"){var L=I.insert.replace(/\r\n/g,`
878
574
  `).replace(/\r/g,`
879
- `);return D.insert(H,L.attributes)}return D.push(L)},new h.default)}n.default=V},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=function(){function P(B,I){var C=[],k=!0,M=!1,F=void 0;try{for(var $=B[Symbol.iterator](),V;!(k=(V=$.next()).done)&&(C.push(V.value),!(I&&C.length===I));k=!0);}catch(q){M=!0,F=q}finally{try{!k&&$.return&&$.return()}finally{if(M)throw F}}return C}return function(B,I){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return P(B,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function P(B,I){for(var C=0;C<I.length;C++){var k=I[C];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(B,k.key,k)}}return function(B,I,C){return I&&P(B.prototype,I),C&&P(B,C),B}}(),o=i(0),c=_(o),h=i(21),d=_(h),p=i(11),f=_(p),m=i(8),g=_(m),v=i(10),b=_(v);function _(P){return P&&P.__esModule?P:{default:P}}function w(P){if(Array.isArray(P)){for(var B=0,I=Array(P.length);B<P.length;B++)I[B]=P[B];return I}else return Array.from(P)}function S(P,B){if(!(P instanceof B))throw new TypeError("Cannot call a class as a function")}var x=(0,b.default)("quill:selection"),A=function P(B){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;S(this,P),this.index=B,this.length=I},N=function(){function P(B,I){var C=this;S(this,P),this.emitter=I,this.scroll=B,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new A(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,g.default.sources.USER),1)}),this.emitter.on(g.default.events.EDITOR_CHANGE,function(k,M){k===g.default.events.TEXT_CHANGE&&M.length()>0&&C.update(g.default.sources.SILENT)}),this.emitter.on(g.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var k=C.getNativeRange();k!=null&&k.start.node!==C.cursor.textNode&&C.emitter.once(g.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(k.start.node,k.start.offset,k.end.node,k.end.offset)}catch{}})}}),this.emitter.on(g.default.events.SCROLL_OPTIMIZE,function(k,M){if(M.range){var F=M.range,$=F.startNode,V=F.startOffset,q=F.endNode,X=F.endOffset;C.setNativeRange($,V,q,X)}}),this.update(g.default.sources.SILENT)}return a(P,[{key:"handleComposition",value:function(){var I=this;this.root.addEventListener("compositionstart",function(){I.composing=!0}),this.root.addEventListener("compositionend",function(){if(I.composing=!1,I.cursor.parent){var C=I.cursor.restore();if(!C)return;setTimeout(function(){I.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var I=this;this.emitter.listenDOM("mousedown",document.body,function(){I.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){I.mouseDown=!1,I.update(g.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(I,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[I])){this.scroll.update();var k=this.getNativeRange();if(!(k==null||!k.native.collapsed||c.default.query(I,c.default.Scope.BLOCK))){if(k.start.node!==this.cursor.textNode){var M=c.default.find(k.start.node,!1);if(M==null)return;if(M instanceof c.default.Leaf){var F=M.split(k.start.offset);M.parent.insertBefore(this.cursor,F)}else M.insertBefore(this.cursor,k.start.node);this.cursor.attach()}this.cursor.format(I,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=this.scroll.length();I=Math.min(I,k-1),C=Math.min(I+C,k-1)-I;var M=void 0,F=this.scroll.leaf(I),$=s(F,2),V=$[0],q=$[1];if(V==null)return null;var X=V.position(q,!0),G=s(X,2);M=G[0],q=G[1];var D=document.createRange();if(C>0){D.setStart(M,q);var L=this.scroll.leaf(I+C),U=s(L,2);if(V=U[0],q=U[1],V==null)return null;var H=V.position(q,!0),Y=s(H,2);return M=Y[0],q=Y[1],D.setEnd(M,q),D.getBoundingClientRect()}else{var K="left",j=void 0;return M instanceof Text?(q<M.data.length?(D.setStart(M,q),D.setEnd(M,q+1)):(D.setStart(M,q-1),D.setEnd(M,q),K="right"),j=D.getBoundingClientRect()):(j=V.domNode.getBoundingClientRect(),q>0&&(K="right")),{bottom:j.top+j.height,height:j.height,left:j[K],right:j[K],top:j.top,width:0}}}},{key:"getNativeRange",value:function(){var I=document.getSelection();if(I==null||I.rangeCount<=0)return null;var C=I.getRangeAt(0);if(C==null)return null;var k=this.normalizeNative(C);return x.info("getNativeRange",k),k}},{key:"getRange",value:function(){var I=this.getNativeRange();if(I==null)return[null,null];var C=this.normalizedToRange(I);return[C,I]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(I){var C=this,k=[[I.start.node,I.start.offset]];I.native.collapsed||k.push([I.end.node,I.end.offset]);var M=k.map(function(V){var q=s(V,2),X=q[0],G=q[1],D=c.default.find(X,!0),L=D.offset(C.scroll);return G===0?L:D instanceof c.default.Container?L+D.length():L+D.index(X,G)}),F=Math.min(Math.max.apply(Math,w(M)),this.scroll.length()-1),$=Math.min.apply(Math,[F].concat(w(M)));return new A($,F-$)}},{key:"normalizeNative",value:function(I){if(!O(this.root,I.startContainer)||!I.collapsed&&!O(this.root,I.endContainer))return null;var C={start:{node:I.startContainer,offset:I.startOffset},end:{node:I.endContainer,offset:I.endOffset},native:I};return[C.start,C.end].forEach(function(k){for(var M=k.node,F=k.offset;!(M instanceof Text)&&M.childNodes.length>0;)if(M.childNodes.length>F)M=M.childNodes[F],F=0;else if(M.childNodes.length===F)M=M.lastChild,F=M instanceof Text?M.data.length:M.childNodes.length+1;else break;k.node=M,k.offset=F}),C}},{key:"rangeToNative",value:function(I){var C=this,k=I.collapsed?[I.index]:[I.index,I.index+I.length],M=[],F=this.scroll.length();return k.forEach(function($,V){$=Math.min(F-1,$);var q=void 0,X=C.scroll.leaf($),G=s(X,2),D=G[0],L=G[1],U=D.position(L,V!==0),H=s(U,2);q=H[0],L=H[1],M.push(q,L)}),M.length<2&&(M=M.concat(M)),M}},{key:"scrollIntoView",value:function(I){var C=this.lastRange;if(C!=null){var k=this.getBounds(C.index,C.length);if(k!=null){var M=this.scroll.length()-1,F=this.scroll.line(Math.min(C.index,M)),$=s(F,1),V=$[0],q=V;if(C.length>0){var X=this.scroll.line(Math.min(C.index+C.length,M)),G=s(X,1);q=G[0]}if(!(V==null||q==null)){var D=I.getBoundingClientRect();k.top<D.top?I.scrollTop-=D.top-k.top:k.bottom>D.bottom&&(I.scrollTop+=k.bottom-D.bottom)}}}}},{key:"setNativeRange",value:function(I,C){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(x.info("setNativeRange",I,C,k,M),!(I!=null&&(this.root.parentNode==null||I.parentNode==null||k.parentNode==null))){var $=document.getSelection();if($!=null)if(I!=null){this.hasFocus()||this.root.focus();var V=(this.getNativeRange()||{}).native;if(V==null||F||I!==V.startContainer||C!==V.startOffset||k!==V.endContainer||M!==V.endOffset){I.tagName=="BR"&&(C=[].indexOf.call(I.parentNode.childNodes,I),I=I.parentNode),k.tagName=="BR"&&(M=[].indexOf.call(k.parentNode.childNodes,k),k=k.parentNode);var q=document.createRange();q.setStart(I,C),q.setEnd(k,M),$.removeAllRanges(),$.addRange(q)}}else $.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof C=="string"&&(k=C,C=!1),x.info("setRange",I),I!=null){var M=this.rangeToNative(I);this.setNativeRange.apply(this,w(M).concat([C]))}else this.setNativeRange(null);this.update(k)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g.default.sources.USER,C=this.lastRange,k=this.getRange(),M=s(k,2),F=M[0],$=M[1];if(this.lastRange=F,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,f.default)(C,this.lastRange)){var V;!this.composing&&$!=null&&$.native.collapsed&&$.start.node!==this.cursor.textNode&&this.cursor.restore();var q=[g.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(C),I];if((V=this.emitter).emit.apply(V,[g.default.events.EDITOR_CHANGE].concat(q)),I!==g.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,q)}}}}]),P}();function O(P,B){try{B.parentNode}catch{return!1}return B instanceof Text&&(B=B.parentNode),P.contains(B)}n.Range=A,n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(v,b){for(var _=0;_<b.length;_++){var w=b[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(v,w.key,w)}}return function(v,b,_){return b&&g(v.prototype,b),_&&g(v,_),v}}(),a=function g(v,b,_){v===null&&(v=Function.prototype);var w=Object.getOwnPropertyDescriptor(v,b);if(w===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:g(S,b,_)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(_)}},o=i(0),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(){return d(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"insertInto",value:function(_,w){_.children.length===0?a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,_,w):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),v}(c.default.Embed);m.blotName="break",m.tagName="BR",n.default=m},function(r,n,i){var s=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var g in m)m.hasOwnProperty(g)&&(f[g]=m[g])};return function(f,m){p(f,m);function g(){this.constructor=f}f.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(44),o=i(30),c=i(1),h=function(p){s(f,p);function f(m){var g=p.call(this,m)||this;return g.build(),g}return f.prototype.appendChild=function(m){this.insertBefore(m)},f.prototype.attach=function(){p.prototype.attach.call(this),this.children.forEach(function(m){m.attach()})},f.prototype.build=function(){var m=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(g){try{var v=d(g);m.insertBefore(v,m.children.head||void 0)}catch(b){if(b instanceof c.ParchmentError)return;throw b}})},f.prototype.deleteAt=function(m,g){if(m===0&&g===this.length())return this.remove();this.children.forEachAt(m,g,function(v,b,_){v.deleteAt(b,_)})},f.prototype.descendant=function(m,g){var v=this.children.find(g),b=v[0],_=v[1];return m.blotName==null&&m(b)||m.blotName!=null&&b instanceof m?[b,_]:b instanceof f?b.descendant(m,_):[null,-1]},f.prototype.descendants=function(m,g,v){g===void 0&&(g=0),v===void 0&&(v=Number.MAX_VALUE);var b=[],_=v;return this.children.forEachAt(g,v,function(w,S,x){(m.blotName==null&&m(w)||m.blotName!=null&&w instanceof m)&&b.push(w),w instanceof f&&(b=b.concat(w.descendants(m,S,_))),_-=x}),b},f.prototype.detach=function(){this.children.forEach(function(m){m.detach()}),p.prototype.detach.call(this)},f.prototype.formatAt=function(m,g,v,b){this.children.forEachAt(m,g,function(_,w,S){_.formatAt(w,S,v,b)})},f.prototype.insertAt=function(m,g,v){var b=this.children.find(m),_=b[0],w=b[1];if(_)_.insertAt(w,g,v);else{var S=v==null?c.create("text",g):c.create(g,v);this.appendChild(S)}},f.prototype.insertBefore=function(m,g){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(v){return m instanceof v}))throw new c.ParchmentError("Cannot insert "+m.statics.blotName+" into "+this.statics.blotName);m.insertInto(this,g)},f.prototype.length=function(){return this.children.reduce(function(m,g){return m+g.length()},0)},f.prototype.moveChildren=function(m,g){this.children.forEach(function(v){m.insertBefore(v,g)})},f.prototype.optimize=function(m){if(p.prototype.optimize.call(this,m),this.children.length===0)if(this.statics.defaultChild!=null){var g=c.create(this.statics.defaultChild);this.appendChild(g),g.optimize(m)}else this.remove()},f.prototype.path=function(m,g){g===void 0&&(g=!1);var v=this.children.find(m,g),b=v[0],_=v[1],w=[[this,m]];return b instanceof f?w.concat(b.path(_,g)):(b!=null&&w.push([b,_]),w)},f.prototype.removeChild=function(m){this.children.remove(m)},f.prototype.replace=function(m){m instanceof f&&m.moveChildren(this),p.prototype.replace.call(this,m)},f.prototype.split=function(m,g){if(g===void 0&&(g=!1),!g){if(m===0)return this;if(m===this.length())return this.next}var v=this.clone();return this.parent.insertBefore(v,this.next),this.children.forEachAt(m,this.length(),function(b,_,w){b=b.split(_,g),v.appendChild(b)}),v},f.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},f.prototype.update=function(m,g){var v=this,b=[],_=[];m.forEach(function(w){w.target===v.domNode&&w.type==="childList"&&(b.push.apply(b,w.addedNodes),_.push.apply(_,w.removedNodes))}),_.forEach(function(w){if(!(w.parentNode!=null&&w.tagName!=="IFRAME"&&document.body.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var S=c.find(w);S!=null&&(S.domNode.parentNode==null||S.domNode.parentNode===v.domNode)&&S.detach()}}),b.filter(function(w){return w.parentNode==v.domNode}).sort(function(w,S){return w===S?0:w.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(w){var S=null;w.nextSibling!=null&&(S=c.find(w.nextSibling));var x=d(w);(x.next!=S||x.next==null)&&(x.parent!=null&&x.parent.removeChild(v),v.insertBefore(x,S||void 0))})},f}(o.default);function d(p){var f=c.find(p);if(f==null)try{f=c.create(p)}catch{f=c.create(c.Scope.INLINE),[].slice.call(p.childNodes).forEach(function(g){f.domNode.appendChild(g)}),p.parentNode&&p.parentNode.replaceChild(f.domNode,p),f.attach()}return f}n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var g in m)m.hasOwnProperty(g)&&(f[g]=m[g])};return function(f,m){p(f,m);function g(){this.constructor=f}f.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(31),c=i(17),h=i(1),d=function(p){s(f,p);function f(m){var g=p.call(this,m)||this;return g.attributes=new o.default(g.domNode),g}return f.formats=function(m){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return m.tagName.toLowerCase()},f.prototype.format=function(m,g){var v=h.query(m);v instanceof a.default?this.attributes.attribute(v,g):g&&v!=null&&(m!==this.statics.blotName||this.formats()[m]!==g)&&this.replaceWith(m,g)},f.prototype.formats=function(){var m=this.attributes.values(),g=this.statics.formats(this.domNode);return g!=null&&(m[this.statics.blotName]=g),m},f.prototype.replaceWith=function(m,g){var v=p.prototype.replaceWith.call(this,m,g);return this.attributes.copy(v),v},f.prototype.update=function(m,g){var v=this;p.prototype.update.call(this,m,g),m.some(function(b){return b.target===v.domNode&&b.type==="attributes"})&&this.attributes.build()},f.prototype.wrap=function(m,g){var v=p.prototype.wrap.call(this,m,g);return v instanceof f&&v.statics.scope===this.statics.scope&&this.attributes.move(v),v},f}(c.default);n.default=d},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var f in p)p.hasOwnProperty(f)&&(d[f]=p[f])};return function(d,p){h(d,p);function f(){this.constructor=d}d.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(30),o=i(1),c=function(h){s(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.value=function(p){return!0},d.prototype.index=function(p,f){return this.domNode===p||this.domNode.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(f,1):-1},d.prototype.position=function(p,f){var m=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return p>0&&(m+=1),[this.parent.domNode,m]},d.prototype.value=function(){var p;return p={},p[this.statics.blotName]=this.statics.value(this.domNode)||!0,p},d.scope=o.Scope.INLINE_BLOT,d}(a.default);n.default=c},function(r,n,i){var s=i(11),a=i(3),o={attributes:{compose:function(h,d,p){typeof h!="object"&&(h={}),typeof d!="object"&&(d={});var f=a(!0,{},d);p||(f=Object.keys(f).reduce(function(g,v){return f[v]!=null&&(g[v]=f[v]),g},{}));for(var m in h)h[m]!==void 0&&d[m]===void 0&&(f[m]=h[m]);return Object.keys(f).length>0?f:void 0},diff:function(h,d){typeof h!="object"&&(h={}),typeof d!="object"&&(d={});var p=Object.keys(h).concat(Object.keys(d)).reduce(function(f,m){return s(h[m],d[m])||(f[m]=d[m]===void 0?null:d[m]),f},{});return Object.keys(p).length>0?p:void 0},transform:function(h,d,p){if(typeof h!="object")return d;if(typeof d=="object"){if(!p)return d;var f=Object.keys(d).reduce(function(m,g){return h[g]===void 0&&(m[g]=d[g]),m},{});return Object.keys(f).length>0?f:void 0}}},iterator:function(h){return new c(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function c(h){this.ops=h,this.index=0,this.offset=0}c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(h){h||(h=1/0);var d=this.ops[this.index];if(d){var p=this.offset,f=o.length(d);if(h>=f-p?(h=f-p,this.index+=1,this.offset=0):this.offset+=h,typeof d.delete=="number")return{delete:h};var m={};return d.attributes&&(m.attributes=d.attributes),typeof d.retain=="number"?m.retain=h:typeof d.insert=="string"?m.insert=d.insert.substr(p,h):m.insert=d.insert,m}else return{retain:1/0}},c.prototype.peek=function(){return this.ops[this.index]},c.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},c.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},c.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,d=this.index,p=this.next(),f=this.ops.slice(this.index);return this.offset=h,this.index=d,[p].concat(f)}else return[]},r.exports=o},function(r,n){var i=function(){function s(v,b){return b!=null&&v instanceof b}var a;try{a=Map}catch{a=function(){}}var o;try{o=Set}catch{o=function(){}}var c;try{c=Promise}catch{c=function(){}}function h(v,b,_,w,S){typeof b=="object"&&(_=b.depth,w=b.prototype,S=b.includeNonEnumerable,b=b.circular);var x=[],A=[],N=typeof Buffer<"u";typeof b>"u"&&(b=!0),typeof _>"u"&&(_=1/0);function O(P,B){if(P===null)return null;if(B===0)return P;var I,C;if(typeof P!="object")return P;if(s(P,a))I=new a;else if(s(P,o))I=new o;else if(s(P,c))I=new c(function(D,L){P.then(function(U){D(O(U,B-1))},function(U){L(O(U,B-1))})});else if(h.__isArray(P))I=[];else if(h.__isRegExp(P))I=new RegExp(P.source,g(P)),P.lastIndex&&(I.lastIndex=P.lastIndex);else if(h.__isDate(P))I=new Date(P.getTime());else{if(N&&Buffer.isBuffer(P))return Buffer.allocUnsafe?I=Buffer.allocUnsafe(P.length):I=new Buffer(P.length),P.copy(I),I;s(P,Error)?I=Object.create(P):typeof w>"u"?(C=Object.getPrototypeOf(P),I=Object.create(C)):(I=Object.create(w),C=w)}if(b){var k=x.indexOf(P);if(k!=-1)return A[k];x.push(P),A.push(I)}s(P,a)&&P.forEach(function(D,L){var U=O(L,B-1),H=O(D,B-1);I.set(U,H)}),s(P,o)&&P.forEach(function(D){var L=O(D,B-1);I.add(L)});for(var M in P){var F;C&&(F=Object.getOwnPropertyDescriptor(C,M)),!(F&&F.set==null)&&(I[M]=O(P[M],B-1))}if(Object.getOwnPropertySymbols)for(var $=Object.getOwnPropertySymbols(P),M=0;M<$.length;M++){var V=$[M],q=Object.getOwnPropertyDescriptor(P,V);q&&!q.enumerable&&!S||(I[V]=O(P[V],B-1),q.enumerable||Object.defineProperty(I,V,{enumerable:!1}))}if(S)for(var X=Object.getOwnPropertyNames(P),M=0;M<X.length;M++){var G=X[M],q=Object.getOwnPropertyDescriptor(P,G);q&&q.enumerable||(I[G]=O(P[G],B-1),Object.defineProperty(I,G,{enumerable:!1}))}return I}return O(v,_)}h.clonePrototype=function(b){if(b===null)return null;var _=function(){};return _.prototype=b,new _};function d(v){return Object.prototype.toString.call(v)}h.__objToStr=d;function p(v){return typeof v=="object"&&d(v)==="[object Date]"}h.__isDate=p;function f(v){return typeof v=="object"&&d(v)==="[object Array]"}h.__isArray=f;function m(v){return typeof v=="object"&&d(v)==="[object RegExp]"}h.__isRegExp=m;function g(v){var b="";return v.global&&(b+="g"),v.ignoreCase&&(b+="i"),v.multiline&&(b+="m"),b}return h.__getRegExpFlags=g,h}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function I(C,k){var M=[],F=!0,$=!1,V=void 0;try{for(var q=C[Symbol.iterator](),X;!(F=(X=q.next()).done)&&(M.push(X.value),!(k&&M.length===k));F=!0);}catch(G){$=!0,V=G}finally{try{!F&&q.return&&q.return()}finally{if($)throw V}}return M}return function(C,k){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return I(C,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function I(C,k){for(var M=0;M<k.length;M++){var F=k[M];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(C,F.key,F)}}return function(C,k,M){return k&&I(C.prototype,k),M&&I(C,M),C}}(),o=function I(C,k,M){C===null&&(C=Function.prototype);var F=Object.getOwnPropertyDescriptor(C,k);if(F===void 0){var $=Object.getPrototypeOf(C);return $===null?void 0:I($,k,M)}else{if("value"in F)return F.value;var V=F.get;return V===void 0?void 0:V.call(M)}},c=i(0),h=x(c),d=i(8),p=x(d),f=i(4),m=x(f),g=i(16),v=x(g),b=i(13),_=x(b),w=i(25),S=x(w);function x(I){return I&&I.__esModule?I:{default:I}}function A(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function N(I,C){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:I}function O(I,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);I.prototype=Object.create(C&&C.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(I,C):I.__proto__=C)}function P(I){return I instanceof m.default||I instanceof f.BlockEmbed}var B=function(I){O(C,I);function C(k,M){A(this,C);var F=N(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,k));return F.emitter=M.emitter,Array.isArray(M.whitelist)&&(F.whitelist=M.whitelist.reduce(function($,V){return $[V]=!0,$},{})),F.domNode.addEventListener("DOMNodeInserted",function(){}),F.optimize(),F.enable(),F}return a(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(M,F){var $=this.line(M),V=s($,2),q=V[0],X=V[1],G=this.line(M+F),D=s(G,1),L=D[0];if(o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,M,F),L!=null&&q!==L&&X>0){if(q instanceof f.BlockEmbed||L instanceof f.BlockEmbed){this.optimize();return}if(q instanceof _.default){var U=q.newlineIndex(q.length(),!0);if(U>-1&&(q=q.split(U+1),q===L)){this.optimize();return}}else if(L instanceof _.default){var H=L.newlineIndex(0);H>-1&&L.split(H+1)}var Y=L.children.head instanceof v.default?null:L.children.head;q.moveChildren(L,Y),q.remove()}this.optimize()}},{key:"enable",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",M)}},{key:"formatAt",value:function(M,F,$,V){this.whitelist!=null&&!this.whitelist[$]||(o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,M,F,$,V),this.optimize())}},{key:"insertAt",value:function(M,F,$){if(!($!=null&&this.whitelist!=null&&!this.whitelist[F])){if(M>=this.length())if($==null||h.default.query(F,h.default.Scope.BLOCK)==null){var V=h.default.create(this.statics.defaultChild);this.appendChild(V),$==null&&F.endsWith(`
880
- `)&&(F=F.slice(0,-1)),V.insertAt(0,F,$)}else{var q=h.default.create(F,$);this.appendChild(q)}else o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,M,F,$);this.optimize()}}},{key:"insertBefore",value:function(M,F){if(M.statics.scope===h.default.Scope.INLINE_BLOT){var $=h.default.create(this.statics.defaultChild);$.appendChild(M),M=$}o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,M,F)}},{key:"leaf",value:function(M){return this.path(M).pop()||[null,-1]}},{key:"line",value:function(M){return M===this.length()?this.line(M-1):this.descendant(P,M)}},{key:"lines",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,$=function V(q,X,G){var D=[],L=G;return q.children.forEachAt(X,G,function(U,H,Y){P(U)?D.push(U):U instanceof h.default.Container&&(D=D.concat(V(U,H,L))),L-=Y}),D};return $(this,M,F)}},{key:"optimize",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,M,F),M.length>0&&this.emitter.emit(p.default.events.SCROLL_OPTIMIZE,M,F))}},{key:"path",value:function(M){return o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,M).slice(1)}},{key:"update",value:function(M){if(this.batch!==!0){var F=p.default.sources.USER;typeof M=="string"&&(F=M),Array.isArray(M)||(M=this.observer.takeRecords()),M.length>0&&this.emitter.emit(p.default.events.SCROLL_BEFORE_UPDATE,F,M),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,M.concat([])),M.length>0&&this.emitter.emit(p.default.events.SCROLL_UPDATE,F,M)}}}]),C}(h.default.Scroll);B.blotName="scroll",B.className="ql-editor",B.tagName="DIV",B.defaultChild="block",B.allowedChildren=[m.default,f.BlockEmbed,S.default],n.default=B},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(W,Q){var tt=[],rt=!0,ct=!1,_t=void 0;try{for(var yt=W[Symbol.iterator](),Nt;!(rt=(Nt=yt.next()).done)&&(tt.push(Nt.value),!(Q&&tt.length===Q));rt=!0);}catch(Ft){ct=!0,_t=Ft}finally{try{!rt&&yt.return&&yt.return()}finally{if(ct)throw _t}}return tt}return function(W,Q){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return j(W,Q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(W,Q){for(var tt=0;tt<Q.length;tt++){var rt=Q[tt];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(W,rt.key,rt)}}return function(W,Q,tt){return Q&&j(W.prototype,Q),tt&&j(W,tt),W}}(),c=i(21),h=I(c),d=i(11),p=I(d),f=i(3),m=I(f),g=i(2),v=I(g),b=i(20),_=I(b),w=i(0),S=I(w),x=i(5),A=I(x),N=i(10),O=I(N),P=i(9),B=I(P);function I(j){return j&&j.__esModule?j:{default:j}}function C(j,W,Q){return W in j?Object.defineProperty(j,W,{value:Q,enumerable:!0,configurable:!0,writable:!0}):j[W]=Q,j}function k(j,W){if(!(j instanceof W))throw new TypeError("Cannot call a class as a function")}function M(j,W){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:j}function F(j,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);j.prototype=Object.create(W&&W.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(j,W):j.__proto__=W)}var $=(0,O.default)("quill:keyboard"),V=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",q=function(j){F(W,j),o(W,null,[{key:"match",value:function(tt,rt){return rt=K(rt),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ct){return!!rt[ct]!==tt[ct]&&rt[ct]!==null})?!1:rt.key===(tt.which||tt.keyCode)}}]);function W(Q,tt){k(this,W);var rt=M(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Q,tt));return rt.bindings={},Object.keys(rt.options.bindings).forEach(function(ct){ct==="list autofill"&&Q.scroll.whitelist!=null&&!Q.scroll.whitelist.list||rt.options.bindings[ct]&&rt.addBinding(rt.options.bindings[ct])}),rt.addBinding({key:W.keys.ENTER,shiftKey:null},U),rt.addBinding({key:W.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(rt.addBinding({key:W.keys.BACKSPACE},{collapsed:!0},G),rt.addBinding({key:W.keys.DELETE},{collapsed:!0},D)):(rt.addBinding({key:W.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},G),rt.addBinding({key:W.keys.DELETE},{collapsed:!0,suffix:/^.?$/},D)),rt.addBinding({key:W.keys.BACKSPACE},{collapsed:!1},L),rt.addBinding({key:W.keys.DELETE},{collapsed:!1},L),rt.addBinding({key:W.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},G),rt.listen(),rt}return o(W,[{key:"addBinding",value:function(tt){var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_t=K(tt);if(_t==null||_t.key==null)return $.warn("Attempted to add invalid keyboard binding",_t);typeof rt=="function"&&(rt={handler:rt}),typeof ct=="function"&&(ct={handler:ct}),_t=(0,m.default)(_t,rt,ct),this.bindings[_t.key]=this.bindings[_t.key]||[],this.bindings[_t.key].push(_t)}},{key:"listen",value:function(){var tt=this;this.quill.root.addEventListener("keydown",function(rt){if(!rt.defaultPrevented){var ct=rt.which||rt.keyCode,_t=(tt.bindings[ct]||[]).filter(function(Qt){return W.match(rt,Qt)});if(_t.length!==0){var yt=tt.quill.getSelection();if(!(yt==null||!tt.quill.hasFocus())){var Nt=tt.quill.getLine(yt.index),Ft=a(Nt,2),ie=Ft[0],ne=Ft[1],nt=tt.quill.getLeaf(yt.index),at=a(nt,2),gt=at[0],bt=at[1],ht=yt.length===0?[gt,bt]:tt.quill.getLeaf(yt.index+yt.length),Dt=a(ht,2),mt=Dt[0],It=Dt[1],re=gt instanceof S.default.Text?gt.value().slice(0,bt):"",Pe=mt instanceof S.default.Text?mt.value().slice(It):"",Wt={collapsed:yt.length===0,empty:yt.length===0&&ie.length()<=1,format:tt.quill.getFormat(yt),offset:ne,prefix:re,suffix:Pe},Zt=_t.some(function(Qt){if(Qt.collapsed!=null&&Qt.collapsed!==Wt.collapsed||Qt.empty!=null&&Qt.empty!==Wt.empty||Qt.offset!=null&&Qt.offset!==Wt.offset)return!1;if(Array.isArray(Qt.format)){if(Qt.format.every(function(ye){return Wt.format[ye]==null}))return!1}else if(s(Qt.format)==="object"&&!Object.keys(Qt.format).every(function(ye){return Qt.format[ye]===!0?Wt.format[ye]!=null:Qt.format[ye]===!1?Wt.format[ye]==null:(0,p.default)(Qt.format[ye],Wt.format[ye])}))return!1;return Qt.prefix!=null&&!Qt.prefix.test(Wt.prefix)||Qt.suffix!=null&&!Qt.suffix.test(Wt.suffix)?!1:Qt.handler.call(tt,yt,Wt)!==!0});Zt&&rt.preventDefault()}}}})}}]),W}(B.default);q.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},q.DEFAULTS={bindings:{bold:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:q.keys.TAB,format:["blockquote","indent","list"],handler:function(W,Q){if(Q.collapsed&&Q.offset!==0)return!0;this.quill.format("indent","+1",A.default.sources.USER)}},outdent:{key:q.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(W,Q){if(Q.collapsed&&Q.offset!==0)return!0;this.quill.format("indent","-1",A.default.sources.USER)}},"outdent backspace":{key:q.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(W,Q){Q.format.indent!=null?this.quill.format("indent","-1",A.default.sources.USER):Q.format.list!=null&&this.quill.format("list",!1,A.default.sources.USER)}},"indent code-block":H(!0),"outdent code-block":H(!1),"remove tab":{key:q.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(W){this.quill.deleteText(W.index-1,1,A.default.sources.USER)}},tab:{key:q.keys.TAB,handler:function(W){this.quill.history.cutoff();var Q=new v.default().retain(W.index).delete(W.length).insert(" ");this.quill.updateContents(Q,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index+1,A.default.sources.SILENT)}},"list empty enter":{key:q.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(W,Q){this.quill.format("list",!1,A.default.sources.USER),Q.format.indent&&this.quill.format("indent",!1,A.default.sources.USER)}},"checklist enter":{key:q.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(W){var Q=this.quill.getLine(W.index),tt=a(Q,2),rt=tt[0],ct=tt[1],_t=(0,m.default)({},rt.formats(),{list:"checked"}),yt=new v.default().retain(W.index).insert(`
881
- `,_t).retain(rt.length()-ct-1).retain(1,{list:"unchecked"});this.quill.updateContents(yt,A.default.sources.USER),this.quill.setSelection(W.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:q.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(W,Q){var tt=this.quill.getLine(W.index),rt=a(tt,2),ct=rt[0],_t=rt[1],yt=new v.default().retain(W.index).insert(`
882
- `,Q.format).retain(ct.length()-_t-1).retain(1,{header:null});this.quill.updateContents(yt,A.default.sources.USER),this.quill.setSelection(W.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(W,Q){var tt=Q.prefix.length,rt=this.quill.getLine(W.index),ct=a(rt,2),_t=ct[0],yt=ct[1];if(yt>tt)return!0;var Nt=void 0;switch(Q.prefix.trim()){case"[]":case"[ ]":Nt="unchecked";break;case"[x]":Nt="checked";break;case"-":case"*":Nt="bullet";break;default:Nt="ordered"}this.quill.insertText(W.index," ",A.default.sources.USER),this.quill.history.cutoff();var Ft=new v.default().retain(W.index-yt).delete(tt+1).retain(_t.length()-2-yt).retain(1,{list:Nt});this.quill.updateContents(Ft,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index-tt,A.default.sources.SILENT)}},"code exit":{key:q.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(W){var Q=this.quill.getLine(W.index),tt=a(Q,2),rt=tt[0],ct=tt[1],_t=new v.default().retain(W.index+rt.length()-ct-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(_t,A.default.sources.USER)}},"embed left":X(q.keys.LEFT,!1),"embed left shift":X(q.keys.LEFT,!0),"embed right":X(q.keys.RIGHT,!1),"embed right shift":X(q.keys.RIGHT,!0)}};function X(j,W){var Q,tt=j===q.keys.LEFT?"prefix":"suffix";return Q={key:j,shiftKey:W,altKey:null},C(Q,tt,/^$/),C(Q,"handler",function(ct){var _t=ct.index;j===q.keys.RIGHT&&(_t+=ct.length+1);var yt=this.quill.getLeaf(_t),Nt=a(yt,1),Ft=Nt[0];return Ft instanceof S.default.Embed?(j===q.keys.LEFT?W?this.quill.setSelection(ct.index-1,ct.length+1,A.default.sources.USER):this.quill.setSelection(ct.index-1,A.default.sources.USER):W?this.quill.setSelection(ct.index,ct.length+1,A.default.sources.USER):this.quill.setSelection(ct.index+ct.length+1,A.default.sources.USER),!1):!0}),Q}function G(j,W){if(!(j.index===0||this.quill.getLength()<=1)){var Q=this.quill.getLine(j.index),tt=a(Q,1),rt=tt[0],ct={};if(W.offset===0){var _t=this.quill.getLine(j.index-1),yt=a(_t,1),Nt=yt[0];if(Nt!=null&&Nt.length()>1){var Ft=rt.formats(),ie=this.quill.getFormat(j.index-1,1);ct=_.default.attributes.diff(Ft,ie)||{}}}var ne=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(W.prefix)?2:1;this.quill.deleteText(j.index-ne,ne,A.default.sources.USER),Object.keys(ct).length>0&&this.quill.formatLine(j.index-ne,ne,ct,A.default.sources.USER),this.quill.focus()}}function D(j,W){var Q=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(W.suffix)?2:1;if(!(j.index>=this.quill.getLength()-Q)){var tt={},rt=0,ct=this.quill.getLine(j.index),_t=a(ct,1),yt=_t[0];if(W.offset>=yt.length()-1){var Nt=this.quill.getLine(j.index+1),Ft=a(Nt,1),ie=Ft[0];if(ie){var ne=yt.formats(),nt=this.quill.getFormat(j.index,1);tt=_.default.attributes.diff(ne,nt)||{},rt=ie.length()}}this.quill.deleteText(j.index,Q,A.default.sources.USER),Object.keys(tt).length>0&&this.quill.formatLine(j.index+rt-1,Q,tt,A.default.sources.USER)}}function L(j){var W=this.quill.getLines(j),Q={};if(W.length>1){var tt=W[0].formats(),rt=W[W.length-1].formats();Q=_.default.attributes.diff(rt,tt)||{}}this.quill.deleteText(j,A.default.sources.USER),Object.keys(Q).length>0&&this.quill.formatLine(j.index,1,Q,A.default.sources.USER),this.quill.setSelection(j.index,A.default.sources.SILENT),this.quill.focus()}function U(j,W){var Q=this;j.length>0&&this.quill.scroll.deleteAt(j.index,j.length);var tt=Object.keys(W.format).reduce(function(rt,ct){return S.default.query(ct,S.default.Scope.BLOCK)&&!Array.isArray(W.format[ct])&&(rt[ct]=W.format[ct]),rt},{});this.quill.insertText(j.index,`
883
- `,tt,A.default.sources.USER),this.quill.setSelection(j.index+1,A.default.sources.SILENT),this.quill.focus(),Object.keys(W.format).forEach(function(rt){tt[rt]==null&&(Array.isArray(W.format[rt])||rt!=="link"&&Q.quill.format(rt,W.format[rt],A.default.sources.USER))})}function H(j){return{key:q.keys.TAB,shiftKey:!j,format:{"code-block":!0},handler:function(Q){var tt=S.default.query("code-block"),rt=Q.index,ct=Q.length,_t=this.quill.scroll.descendant(tt,rt),yt=a(_t,2),Nt=yt[0],Ft=yt[1];if(Nt!=null){var ie=this.quill.getIndex(Nt),ne=Nt.newlineIndex(Ft,!0)+1,nt=Nt.newlineIndex(ie+Ft+ct),at=Nt.domNode.textContent.slice(ne,nt).split(`
884
- `);Ft=0,at.forEach(function(gt,bt){j?(Nt.insertAt(ne+Ft,tt.TAB),Ft+=tt.TAB.length,bt===0?rt+=tt.TAB.length:ct+=tt.TAB.length):gt.startsWith(tt.TAB)&&(Nt.deleteAt(ne+Ft,tt.TAB.length),Ft-=tt.TAB.length,bt===0?rt-=tt.TAB.length:ct-=tt.TAB.length),Ft+=gt.length+1}),this.quill.update(A.default.sources.USER),this.quill.setSelection(rt,ct,A.default.sources.SILENT)}}}}function Y(j){return{key:j[0].toUpperCase(),shortKey:!0,handler:function(Q,tt){this.quill.format(j,!tt.format[j],A.default.sources.USER)}}}function K(j){if(typeof j=="string"||typeof j=="number")return K({key:j});if((typeof j>"u"?"undefined":s(j))==="object"&&(j=(0,h.default)(j,!1)),typeof j.key=="string")if(q.keys[j.key.toUpperCase()]!=null)j.key=q.keys[j.key.toUpperCase()];else if(j.key.length===1)j.key=j.key.toUpperCase().charCodeAt(0);else return null;return j.shortKey&&(j[V]=j.shortKey,delete j.shortKey),j}n.default=q,n.SHORTKEY=V},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function _(w,S){var x=[],A=!0,N=!1,O=void 0;try{for(var P=w[Symbol.iterator](),B;!(A=(B=P.next()).done)&&(x.push(B.value),!(S&&x.length===S));A=!0);}catch(I){N=!0,O=I}finally{try{!A&&P.return&&P.return()}finally{if(N)throw O}}return x}return function(w,S){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return _(w,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function _(w,S,x){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,S);if(A===void 0){var N=Object.getPrototypeOf(w);return N===null?void 0:_(N,S,x)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(x)}},o=function(){function _(w,S){for(var x=0;x<S.length;x++){var A=S[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,S,x){return S&&_(w.prototype,S),x&&_(w,x),w}}(),c=i(0),h=f(c),d=i(7),p=f(d);function f(_){return _&&_.__esModule?_:{default:_}}function m(_,w){if(!(_ instanceof w))throw new TypeError("Cannot call a class as a function")}function g(_,w){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:_}function v(_,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);_.prototype=Object.create(w&&w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(_,w):_.__proto__=w)}var b=function(_){v(w,_),o(w,null,[{key:"value",value:function(){}}]);function w(S,x){m(this,w);var A=g(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,S));return A.selection=x,A.textNode=document.createTextNode(w.CONTENTS),A.domNode.appendChild(A.textNode),A._length=0,A}return o(w,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(x,A){if(this._length!==0)return a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,x,A);for(var N=this,O=0;N!=null&&N.statics.scope!==h.default.Scope.BLOCK_BLOT;)O+=N.offset(N.parent),N=N.parent;N!=null&&(this._length=w.CONTENTS.length,N.optimize(),N.formatAt(O,w.CONTENTS.length,x,A),this._length=0)}},{key:"index",value:function(x,A){return x===this.textNode?0:a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,x,A)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var x=this.textNode,A=this.selection.getNativeRange(),N=void 0,O=void 0,P=void 0;if(A!=null&&A.start.node===x&&A.end.node===x){var B=[x,A.start.offset,A.end.offset];N=B[0],O=B[1],P=B[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==w.CONTENTS){var I=this.textNode.data.split(w.CONTENTS).join("");this.next instanceof p.default?(N=this.next.domNode,this.next.insertAt(0,I),this.textNode.data=w.CONTENTS):(this.textNode.data=I,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(w.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var C=[O,P].map(function(M){return Math.max(0,Math.min(N.data.length,M-1))}),k=s(C,2);return O=k[0],P=k[1],{startNode:N,startOffset:O,endNode:N,endOffset:P}}}}},{key:"update",value:function(x,A){var N=this;if(x.some(function(P){return P.type==="characterData"&&P.target===N.textNode})){var O=this.restore();O&&(A.range=O)}}},{key:"value",value:function(){return""}}]),w}(h.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=h(s),o=i(4),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(){return d(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default.Container);m.allowedChildren=[c.default,o.BlockEmbed,m],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var s=function(){function b(_,w){for(var S=0;S<w.length;S++){var x=w[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,w,S){return w&&b(_.prototype,w),S&&b(_,S),_}}(),a=function b(_,w,S){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,w);if(x===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:b(A,w,S)}else{if("value"in x)return x.value;var N=x.get;return N===void 0?void 0:N.call(S)}},o=i(0),c=h(o);function h(b){return b&&b.__esModule?b:{default:b}}function d(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function p(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function f(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var m=function(b){f(_,b);function _(){return d(this,_),p(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"value",value:function(S){var x=a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,S);return x.startsWith("rgb(")?(x=x.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+x.split(",").map(function(A){return("00"+parseInt(A).toString(16)).slice(-2)}).join("")):x}}]),_}(c.default.Attributor.Style),g=new c.default.Attributor.Class("color","ql-color",{scope:c.default.Scope.INLINE}),v=new m("color","color",{scope:c.default.Scope.INLINE});n.ColorAttributor=m,n.ColorClass=g,n.ColorStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=function(){function v(b,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,_,w){return _&&v(b.prototype,_),w&&v(b,w),b}}(),a=function v(b,_,w){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,_);if(S===void 0){var x=Object.getPrototypeOf(b);return x===null?void 0:v(x,_,w)}else{if("value"in S)return S.value;var A=S.get;return A===void 0?void 0:A.call(w)}},o=i(6),c=h(o);function h(v){return v&&v.__esModule?v:{default:v}}function d(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function p(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function f(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var m=function(v){f(b,v);function b(){return d(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"format",value:function(w,S){if(w!==this.statics.blotName||!S)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,w,S);S=this.constructor.sanitize(S),this.domNode.setAttribute("href",S)}}],[{key:"create",value:function(w){var S=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,w);return w=this.sanitize(w),S.setAttribute("href",w),S.setAttribute("rel","noopener noreferrer"),S.setAttribute("target","_blank"),S}},{key:"formats",value:function(w){return w.getAttribute("href")}},{key:"sanitize",value:function(w){return g(w,this.PROTOCOL_WHITELIST)?w:this.SANITIZED_URL}}]),b}(c.default);m.blotName="link",m.tagName="A",m.SANITIZED_URL="about:blank",m.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function g(v,b){var _=document.createElement("a");_.href=v;var w=_.href.slice(0,_.href.indexOf(":"));return b.indexOf(w)>-1}n.default=m,n.sanitize=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a=function(){function b(_,w){for(var S=0;S<w.length;S++){var x=w[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,w,S){return w&&b(_.prototype,w),S&&b(_,S),_}}(),o=i(23),c=p(o),h=i(107),d=p(h);function p(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}var m=0;function g(b,_){b.setAttribute(_,b.getAttribute(_)!=="true")}var v=function(){function b(_){var w=this;f(this,b),this.select=_,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){w.togglePicker()}),this.label.addEventListener("keydown",function(S){switch(S.keyCode){case c.default.keys.ENTER:w.togglePicker();break;case c.default.keys.ESCAPE:w.escape(),S.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),g(this.label,"aria-expanded"),g(this.options,"aria-hidden")}},{key:"buildItem",value:function(w){var S=this,x=document.createElement("span");return x.tabIndex="0",x.setAttribute("role","button"),x.classList.add("ql-picker-item"),w.hasAttribute("value")&&x.setAttribute("data-value",w.getAttribute("value")),w.textContent&&x.setAttribute("data-label",w.textContent),x.addEventListener("click",function(){S.selectItem(x,!0)}),x.addEventListener("keydown",function(A){switch(A.keyCode){case c.default.keys.ENTER:S.selectItem(x,!0),A.preventDefault();break;case c.default.keys.ESCAPE:S.escape(),A.preventDefault();break}}),x}},{key:"buildLabel",value:function(){var w=document.createElement("span");return w.classList.add("ql-picker-label"),w.innerHTML=d.default,w.tabIndex="0",w.setAttribute("role","button"),w.setAttribute("aria-expanded","false"),this.container.appendChild(w),w}},{key:"buildOptions",value:function(){var w=this,S=document.createElement("span");S.classList.add("ql-picker-options"),S.setAttribute("aria-hidden","true"),S.tabIndex="-1",S.id="ql-picker-options-"+m,m+=1,this.label.setAttribute("aria-controls",S.id),this.options=S,[].slice.call(this.select.options).forEach(function(x){var A=w.buildItem(x);S.appendChild(A),x.selected===!0&&w.selectItem(A)}),this.container.appendChild(S)}},{key:"buildPicker",value:function(){var w=this;[].slice.call(this.select.attributes).forEach(function(S){w.container.setAttribute(S.name,S.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var w=this;this.close(),setTimeout(function(){return w.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(w){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=this.container.querySelector(".ql-selected");if(w!==x&&(x!=null&&x.classList.remove("ql-selected"),w!=null&&(w.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(w.parentNode.children,w),w.hasAttribute("data-value")?this.label.setAttribute("data-value",w.getAttribute("data-value")):this.label.removeAttribute("data-value"),w.hasAttribute("data-label")?this.label.setAttribute("data-label",w.getAttribute("data-label")):this.label.removeAttribute("data-label"),S))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var A=document.createEvent("Event");A.initEvent("change",!0,!0),this.select.dispatchEvent(A)}this.close()}}},{key:"update",value:function(){var w=void 0;if(this.select.selectedIndex>-1){var S=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];w=this.select.options[this.select.selectedIndex],this.selectItem(S)}else this.selectItem(null);var x=w!=null&&w!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",x)}}]),b}();n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=$(s),o=i(5),c=$(o),h=i(4),d=$(h),p=i(16),f=$(p),m=i(25),g=$(m),v=i(24),b=$(v),_=i(35),w=$(_),S=i(6),x=$(S),A=i(22),N=$(A),O=i(7),P=$(O),B=i(55),I=$(B),C=i(42),k=$(C),M=i(23),F=$(M);function $(V){return V&&V.__esModule?V:{default:V}}c.default.register({"blots/block":d.default,"blots/block/embed":h.BlockEmbed,"blots/break":f.default,"blots/container":g.default,"blots/cursor":b.default,"blots/embed":w.default,"blots/inline":x.default,"blots/scroll":N.default,"blots/text":P.default,"modules/clipboard":I.default,"modules/history":k.default,"modules/keyboard":F.default}),a.default.register(d.default,f.default,b.default,x.default,N.default,P.default),n.default=c.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(c){this.domNode=c,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(c){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof c=="string"&&(c=c.toUpperCase(),parseInt(c).toString()===c&&(c=parseInt(c))),typeof c=="number"?h=document.createElement(this.tagName[c-1]):this.tagName.indexOf(c)>-1?h=document.createElement(c):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var c=this.domNode.cloneNode(!1);return s.create(c)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},o.prototype.deleteAt=function(c,h){var d=this.isolate(c,h);d.remove()},o.prototype.formatAt=function(c,h,d,p){var f=this.isolate(c,h);if(s.query(d,s.Scope.BLOT)!=null&&p)f.wrap(d,p);else if(s.query(d,s.Scope.ATTRIBUTE)!=null){var m=s.create(this.statics.scope);f.wrap(m),m.format(d,p)}},o.prototype.insertAt=function(c,h,d){var p=d==null?s.create("text",h):s.create(h,d),f=this.split(c);this.parent.insertBefore(p,f)},o.prototype.insertInto=function(c,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var d=null;c.children.insertBefore(this,h),h!=null&&(d=h.domNode),(this.domNode.parentNode!=c.domNode||this.domNode.nextSibling!=d)&&c.domNode.insertBefore(this.domNode,d),this.parent=c,this.attach()},o.prototype.isolate=function(c,h){var d=this.split(c);return d.split(h),d},o.prototype.length=function(){return 1},o.prototype.offset=function(c){return c===void 0&&(c=this.parent),this.parent==null||this==c?0:this.parent.children.offset(this)+this.parent.offset(c)},o.prototype.optimize=function(c){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(c){c.parent!=null&&(c.parent.insertBefore(this,c.next),c.remove())},o.prototype.replaceWith=function(c,h){var d=typeof c=="string"?s.create(c,h):c;return d.replace(this),d},o.prototype.split=function(c,h){return c===0?this:this.next},o.prototype.update=function(c,h){},o.prototype.wrap=function(c,h){var d=typeof c=="string"?s.create(c,h):c;return this.parent!=null&&this.parent.insertBefore(d,this.next),d.appendChild(this),d},o.blotName="abstract",o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),a=i(32),o=i(33),c=i(1),h=function(){function d(p){this.attributes={},this.domNode=p,this.build()}return d.prototype.attribute=function(p,f){f?p.add(this.domNode,f)&&(p.value(this.domNode)!=null?this.attributes[p.attrName]=p:delete this.attributes[p.attrName]):(p.remove(this.domNode),delete this.attributes[p.attrName])},d.prototype.build=function(){var p=this;this.attributes={};var f=s.default.keys(this.domNode),m=a.default.keys(this.domNode),g=o.default.keys(this.domNode);f.concat(m).concat(g).forEach(function(v){var b=c.query(v,c.Scope.ATTRIBUTE);b instanceof s.default&&(p.attributes[b.attrName]=b)})},d.prototype.copy=function(p){var f=this;Object.keys(this.attributes).forEach(function(m){var g=f.attributes[m].value(f.domNode);p.format(m,g)})},d.prototype.move=function(p){var f=this;this.copy(p),Object.keys(this.attributes).forEach(function(m){f.attributes[m].remove(f.domNode)}),this.attributes={}},d.prototype.values=function(){var p=this;return Object.keys(this.attributes).reduce(function(f,m){return f[m]=p.attributes[m].value(p.domNode),f},{})},d}();n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var f in p)p.hasOwnProperty(f)&&(d[f]=p[f])};return function(d,p){h(d,p);function f(){this.constructor=d}d.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h,d){var p=h.getAttribute("class")||"";return p.split(/\s+/).filter(function(f){return f.indexOf(d+"-")===0})}var c=function(h){s(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.keys=function(p){return(p.getAttribute("class")||"").split(/\s+/).map(function(f){return f.split("-").slice(0,-1).join("-")})},d.prototype.add=function(p,f){return this.canAdd(p,f)?(this.remove(p),p.classList.add(this.keyName+"-"+f),!0):!1},d.prototype.remove=function(p){var f=o(p,this.keyName);f.forEach(function(m){p.classList.remove(m)}),p.classList.length===0&&p.removeAttribute("class")},d.prototype.value=function(p){var f=o(p,this.keyName)[0]||"",m=f.slice(this.keyName.length+1);return this.canAdd(p,m)?m:""},d}(a.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var f in p)p.hasOwnProperty(f)&&(d[f]=p[f])};return function(d,p){h(d,p);function f(){this.constructor=d}d.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h){var d=h.split("-"),p=d.slice(1).map(function(f){return f[0].toUpperCase()+f.slice(1)}).join("");return d[0]+p}var c=function(h){s(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.keys=function(p){return(p.getAttribute("style")||"").split(";").map(function(f){var m=f.split(":");return m[0].trim()})},d.prototype.add=function(p,f){return this.canAdd(p,f)?(p.style[o(this.keyName)]=f,!0):!1},d.prototype.remove=function(p){p.style[o(this.keyName)]="",p.getAttribute("style")||p.removeAttribute("style")},d.prototype.value=function(p){var f=p.style[o(this.keyName)];return this.canAdd(p,f)?f:""},d}(a.default);n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function c(h,d){for(var p=0;p<d.length;p++){var f=d[p];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,d,p){return d&&c(h.prototype,d),p&&c(h,p),h}}();function a(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function c(h,d){a(this,c),this.quill=h,this.options=d,this.modules={}}return s(c,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(p){d.modules[p]==null&&d.addModule(p)})}},{key:"addModule",value:function(d){var p=this.quill.constructor.import("modules/"+d);return this.modules[d]=new p(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),c}();o.DEFAULTS={modules:{}},o.themes={default:o},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function _(w,S){for(var x=0;x<S.length;x++){var A=S[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,S,x){return S&&_(w.prototype,S),x&&_(w,x),w}}(),a=function _(w,S,x){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,S);if(A===void 0){var N=Object.getPrototypeOf(w);return N===null?void 0:_(N,S,x)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(x)}},o=i(0),c=p(o),h=i(7),d=p(h);function p(_){return _&&_.__esModule?_:{default:_}}function f(_,w){if(!(_ instanceof w))throw new TypeError("Cannot call a class as a function")}function m(_,w){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:_}function g(_,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);_.prototype=Object.create(w&&w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(_,w):_.__proto__=w)}var v="\uFEFF",b=function(_){g(w,_);function w(S){f(this,w);var x=m(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,S));return x.contentNode=document.createElement("span"),x.contentNode.setAttribute("contenteditable",!1),[].slice.call(x.domNode.childNodes).forEach(function(A){x.contentNode.appendChild(A)}),x.leftGuard=document.createTextNode(v),x.rightGuard=document.createTextNode(v),x.domNode.appendChild(x.leftGuard),x.domNode.appendChild(x.contentNode),x.domNode.appendChild(x.rightGuard),x}return s(w,[{key:"index",value:function(x,A){return x===this.leftGuard?0:x===this.rightGuard?1:a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,x,A)}},{key:"restore",value:function(x){var A=void 0,N=void 0,O=x.data.split(v).join("");if(x===this.leftGuard)if(this.prev instanceof d.default){var P=this.prev.length();this.prev.insertAt(P,O),A={startNode:this.prev.domNode,startOffset:P+O.length}}else N=document.createTextNode(O),this.parent.insertBefore(c.default.create(N),this),A={startNode:N,startOffset:O.length};else x===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,O),A={startNode:this.next.domNode,startOffset:O.length}):(N=document.createTextNode(O),this.parent.insertBefore(c.default.create(N),this.next),A={startNode:N,startOffset:O.length}));return x.data=v,A}},{key:"update",value:function(x,A){var N=this;x.forEach(function(O){if(O.type==="characterData"&&(O.target===N.leftGuard||O.target===N.rightGuard)){var P=N.restore(O.target);P&&(A.range=P)}})}}]),w}(c.default.Embed);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}var c={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new a.default.Attributor.Attribute("align","align",c),d=new a.default.Attributor.Class("align","ql-align",c),p=new a.default.Attributor.Style("align","text-align",c);n.AlignAttribute=h,n.AlignClass=d,n.AlignStyle=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var s=i(0),a=c(s),o=i(26);function c(p){return p&&p.__esModule?p:{default:p}}var h=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),d=new o.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});n.BackgroundClass=h,n.BackgroundStyle=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var s=i(0),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}var c={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},h=new a.default.Attributor.Attribute("direction","dir",c),d=new a.default.Attributor.Class("direction","ql-direction",c),p=new a.default.Attributor.Style("direction","direction",c);n.DirectionAttribute=h,n.DirectionClass=d,n.DirectionStyle=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=function(){function _(w,S){for(var x=0;x<S.length;x++){var A=S[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,S,x){return S&&_(w.prototype,S),x&&_(w,x),w}}(),a=function _(w,S,x){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,S);if(A===void 0){var N=Object.getPrototypeOf(w);return N===null?void 0:_(N,S,x)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(x)}},o=i(0),c=h(o);function h(_){return _&&_.__esModule?_:{default:_}}function d(_,w){if(!(_ instanceof w))throw new TypeError("Cannot call a class as a function")}function p(_,w){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:_}function f(_,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);_.prototype=Object.create(w&&w.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(_,w):_.__proto__=w)}var m={scope:c.default.Scope.INLINE,whitelist:["serif","monospace"]},g=new c.default.Attributor.Class("font","ql-font",m),v=function(_){f(w,_);function w(){return d(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return s(w,[{key:"value",value:function(x){return a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,x).replace(/["']/g,"")}}]),w}(c.default.Attributor.Style),b=new v("font","font-family",m);n.FontStyle=b,n.FontClass=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var s=i(0),a=o(s);function o(d){return d&&d.__esModule?d:{default:d}}var c=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=c,n.SizeStyle=h},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var s=function(){function S(x,A){for(var N=0;N<A.length;N++){var O=A[N];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(x,O.key,O)}}return function(x,A,N){return A&&S(x.prototype,A),N&&S(x,N),x}}(),a=i(0),o=f(a),c=i(5),h=f(c),d=i(9),p=f(d);function f(S){return S&&S.__esModule?S:{default:S}}function m(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function g(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function v(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var b=function(S){v(x,S);function x(A,N){m(this,x);var O=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,A,N));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(h.default.events.EDITOR_CHANGE,function(P,B,I,C){P!==h.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||C===h.default.sources.USER?O.record(B,I):O.transform(B))}),O.quill.keyboard.addBinding({key:"Z",shortKey:!0},O.undo.bind(O)),O.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},O.redo.bind(O)),/Win/i.test(navigator.platform)&&O.quill.keyboard.addBinding({key:"Y",shortKey:!0},O.redo.bind(O)),O}return s(x,[{key:"change",value:function(N,O){if(this.stack[N].length!==0){var P=this.stack[N].pop();this.stack[O].push(P),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(P[N],h.default.sources.USER),this.ignoreChange=!1;var B=w(P[N]);this.quill.setSelection(B)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(N,O){if(N.ops.length!==0){this.stack.redo=[];var P=this.quill.getContents().diff(O),B=Date.now();if(this.lastRecorded+this.options.delay>B&&this.stack.undo.length>0){var I=this.stack.undo.pop();P=P.compose(I.undo),N=I.redo.compose(N)}else this.lastRecorded=B;this.stack.undo.push({redo:N,undo:P}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(N){this.stack.undo.forEach(function(O){O.undo=N.transform(O.undo,!0),O.redo=N.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=N.transform(O.undo,!0),O.redo=N.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),x}(p.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function _(S){var x=S.ops[S.ops.length-1];return x==null?!1:x.insert!=null?typeof x.insert=="string"&&x.insert.endsWith(`
885
- `):x.attributes!=null?Object.keys(x.attributes).some(function(A){return o.default.query(A,o.default.Scope.BLOCK)!=null}):!1}function w(S){var x=S.reduce(function(N,O){return N+=O.delete||0,N},0),A=S.length()-x;return _(S)&&(A-=1),A}n.default=b,n.getLastChangeIndex=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=function(){function U(H,Y){for(var K=0;K<Y.length;K++){var j=Y[K];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(H,j.key,j)}}return function(H,Y,K){return Y&&U(H.prototype,Y),K&&U(H,K),H}}(),a=function U(H,Y,K){H===null&&(H=Function.prototype);var j=Object.getOwnPropertyDescriptor(H,Y);if(j===void 0){var W=Object.getPrototypeOf(H);return W===null?void 0:U(W,Y,K)}else{if("value"in j)return j.value;var Q=j.get;return Q===void 0?void 0:Q.call(K)}},o=i(3),c=B(o),h=i(2),d=B(h),p=i(8),f=B(p),m=i(23),g=B(m),v=i(34),b=B(v),_=i(59),w=B(_),S=i(60),x=B(S),A=i(28),N=B(A),O=i(61),P=B(O);function B(U){return U&&U.__esModule?U:{default:U}}function I(U,H){if(!(U instanceof H))throw new TypeError("Cannot call a class as a function")}function C(U,H){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H&&(typeof H=="object"||typeof H=="function")?H:U}function k(U,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof H);U.prototype=Object.create(H&&H.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),H&&(Object.setPrototypeOf?Object.setPrototypeOf(U,H):U.__proto__=H)}var M=[!1,"center","right","justify"],F=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],$=[!1,"serif","monospace"],V=["1","2","3",!1],q=["small",!1,"large","huge"],X=function(U){k(H,U);function H(Y,K){I(this,H);var j=C(this,(H.__proto__||Object.getPrototypeOf(H)).call(this,Y,K)),W=function Q(tt){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",Q);j.tooltip!=null&&!j.tooltip.root.contains(tt.target)&&document.activeElement!==j.tooltip.textbox&&!j.quill.hasFocus()&&j.tooltip.hide(),j.pickers!=null&&j.pickers.forEach(function(rt){rt.container.contains(tt.target)||rt.close()})};return Y.emitter.listenDOM("click",document.body,W),j}return s(H,[{key:"addModule",value:function(K){var j=a(H.prototype.__proto__||Object.getPrototypeOf(H.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(j),j}},{key:"buildButtons",value:function(K,j){K.forEach(function(W){var Q=W.getAttribute("class")||"";Q.split(/\s+/).forEach(function(tt){if(tt.startsWith("ql-")&&(tt=tt.slice(3),j[tt]!=null))if(tt==="direction")W.innerHTML=j[tt][""]+j[tt].rtl;else if(typeof j[tt]=="string")W.innerHTML=j[tt];else{var rt=W.value||"";rt!=null&&j[tt][rt]&&(W.innerHTML=j[tt][rt])}})})}},{key:"buildPickers",value:function(K,j){var W=this;this.pickers=K.map(function(tt){if(tt.classList.contains("ql-align"))return tt.querySelector("option")==null&&L(tt,M),new x.default(tt,j.align);if(tt.classList.contains("ql-background")||tt.classList.contains("ql-color")){var rt=tt.classList.contains("ql-background")?"background":"color";return tt.querySelector("option")==null&&L(tt,F,rt==="background"?"#ffffff":"#000000"),new w.default(tt,j[rt])}else return tt.querySelector("option")==null&&(tt.classList.contains("ql-font")?L(tt,$):tt.classList.contains("ql-header")?L(tt,V):tt.classList.contains("ql-size")&&L(tt,q)),new N.default(tt)});var Q=function(){W.pickers.forEach(function(rt){rt.update()})};this.quill.on(f.default.events.EDITOR_CHANGE,Q)}}]),H}(b.default);X.DEFAULTS=(0,c.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var H=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var K=new FileReader;K.onload=function(j){var W=H.quill.getSelection(!0);H.quill.updateContents(new d.default().retain(W.index).delete(W.length).insert({image:j.target.result}),f.default.sources.USER),H.quill.setSelection(W.index+1,f.default.sources.SILENT),Y.value=""},K.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var G=function(U){k(H,U);function H(Y,K){I(this,H);var j=C(this,(H.__proto__||Object.getPrototypeOf(H)).call(this,Y,K));return j.textbox=j.root.querySelector('input[type="text"]'),j.listen(),j}return s(H,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(j){g.default.match(j,"enter")?(K.save(),j.preventDefault()):g.default.match(j,"escape")&&(K.cancel(),j.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),j!=null?this.textbox.value=j:K!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var j=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,f.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,f.default.sources.USER)),this.quill.root.scrollTop=j;break}case"video":K=D(K);case"formula":{if(!K)break;var W=this.quill.getSelection(!0);if(W!=null){var Q=W.index+W.length;this.quill.insertEmbed(Q,this.root.getAttribute("data-mode"),K,f.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Q+1," ",f.default.sources.USER),this.quill.setSelection(Q+2,f.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),H}(P.default);function D(U){var H=U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return H?(H[1]||"https")+"://www.youtube.com/embed/"+H[2]+"?showinfo=0":(H=U.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(H[1]||"https")+"://player.vimeo.com/video/"+H[2]+"/":U}function L(U,H){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;H.forEach(function(K){var j=document.createElement("option");K===Y?j.setAttribute("selected","selected"):j.setAttribute("value",K),U.appendChild(j)})}n.BaseTooltip=G,n.default=X},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},a.prototype.contains=function(o){for(var c,h=this.iterator();c=h();)if(c===o)return!0;return!1},a.prototype.insertBefore=function(o,c){o&&(o.next=c,c!=null?(o.prev=c.prev,c.prev!=null&&(c.prev.next=o),c.prev=o,c===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},a.prototype.offset=function(o){for(var c=0,h=this.head;h!=null;){if(h===o)return c;c+=h.length(),h=h.next}return-1},a.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},a.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var c=o;return o!=null&&(o=o.next),c}},a.prototype.find=function(o,c){c===void 0&&(c=!1);for(var h,d=this.iterator();h=d();){var p=h.length();if(o<p||c&&o===p&&(h.next==null||h.next.length()!==0))return[h,o];o-=p}return[null,0]},a.prototype.forEach=function(o){for(var c,h=this.iterator();c=h();)o(c)},a.prototype.forEachAt=function(o,c,h){if(!(c<=0))for(var d=this.find(o),p=d[0],f=d[1],m,g=o-f,v=this.iterator(p);(m=v())&&g<o+c;){var b=m.length();o>g?h(m,o-g,Math.min(c,g+b-o)):h(m,0,Math.min(b,o+c-g)),g+=b}},a.prototype.map=function(o){return this.reduce(function(c,h){return c.push(o(h)),c},[])},a.prototype.reduce=function(o,c){for(var h,d=this.iterator();h=d();)c=o(c,h);return c},a}();n.default=s},function(r,n,i){var s=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var g in m)m.hasOwnProperty(g)&&(f[g]=m[g])};return function(f,m){p(f,m);function g(){this.constructor=f}f.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(1),c={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,d=function(p){s(f,p);function f(m){var g=p.call(this,m)||this;return g.scroll=g,g.observer=new MutationObserver(function(v){g.update(v)}),g.observer.observe(g.domNode,c),g.attach(),g}return f.prototype.detach=function(){p.prototype.detach.call(this),this.observer.disconnect()},f.prototype.deleteAt=function(m,g){this.update(),m===0&&g===this.length()?this.children.forEach(function(v){v.remove()}):p.prototype.deleteAt.call(this,m,g)},f.prototype.formatAt=function(m,g,v,b){this.update(),p.prototype.formatAt.call(this,m,g,v,b)},f.prototype.insertAt=function(m,g,v){this.update(),p.prototype.insertAt.call(this,m,g,v)},f.prototype.optimize=function(m,g){var v=this;m===void 0&&(m=[]),g===void 0&&(g={}),p.prototype.optimize.call(this,g);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)m.push(b.pop());for(var _=function(A,N){N===void 0&&(N=!0),!(A==null||A===v)&&A.domNode.parentNode!=null&&(A.domNode[o.DATA_KEY].mutations==null&&(A.domNode[o.DATA_KEY].mutations=[]),N&&_(A.parent))},w=function(A){A.domNode[o.DATA_KEY]==null||A.domNode[o.DATA_KEY].mutations==null||(A instanceof a.default&&A.children.forEach(w),A.optimize(g))},S=m,x=0;S.length>0;x+=1){if(x>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(S.forEach(function(A){var N=o.find(A.target,!0);N!=null&&(N.domNode===A.target&&(A.type==="childList"?(_(o.find(A.previousSibling,!1)),[].forEach.call(A.addedNodes,function(O){var P=o.find(O,!1);_(P,!1),P instanceof a.default&&P.children.forEach(function(B){_(B,!1)})})):A.type==="attributes"&&_(N.prev)),_(N))}),this.children.forEach(w),S=[].slice.call(this.observer.takeRecords()),b=S.slice();b.length>0;)m.push(b.pop())}},f.prototype.update=function(m,g){var v=this;g===void 0&&(g={}),m=m||this.observer.takeRecords(),m.map(function(b){var _=o.find(b.target,!0);return _==null?null:_.domNode[o.DATA_KEY].mutations==null?(_.domNode[o.DATA_KEY].mutations=[b],_):(_.domNode[o.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===v||b.domNode[o.DATA_KEY]==null||b.update(b.domNode[o.DATA_KEY].mutations||[],g)}),this.domNode[o.DATA_KEY].mutations!=null&&p.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,g),this.optimize(m,g)},f.blotName="scroll",f.defaultChild="block",f.scope=o.Scope.BLOCK_BLOT,f.tagName="DIV",f}(a.default);n.default=d},function(r,n,i){var s=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var m in f)f.hasOwnProperty(m)&&(p[m]=f[m])};return function(p,f){d(p,f);function m(){this.constructor=p}p.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1);function c(d,p){if(Object.keys(d).length!==Object.keys(p).length)return!1;for(var f in d)if(d[f]!==p[f])return!1;return!0}var h=function(d){s(p,d);function p(){return d!==null&&d.apply(this,arguments)||this}return p.formats=function(f){if(f.tagName!==p.tagName)return d.formats.call(this,f)},p.prototype.format=function(f,m){var g=this;f===this.statics.blotName&&!m?(this.children.forEach(function(v){v instanceof a.default||(v=v.wrap(p.blotName,!0)),g.attributes.copy(v)}),this.unwrap()):d.prototype.format.call(this,f,m)},p.prototype.formatAt=function(f,m,g,v){if(this.formats()[g]!=null||o.query(g,o.Scope.ATTRIBUTE)){var b=this.isolate(f,m);b.format(g,v)}else d.prototype.formatAt.call(this,f,m,g,v)},p.prototype.optimize=function(f){d.prototype.optimize.call(this,f);var m=this.formats();if(Object.keys(m).length===0)return this.unwrap();var g=this.next;g instanceof p&&g.prev===this&&c(m,g.formats())&&(g.moveChildren(this),g.remove())},p.blotName="inline",p.scope=o.Scope.INLINE_BLOT,p.tagName="SPAN",p}(a.default);n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var f in p)p.hasOwnProperty(f)&&(d[f]=p[f])};return function(d,p){h(d,p);function f(){this.constructor=d}d.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1),c=function(h){s(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.formats=function(p){var f=o.query(d.blotName).tagName;if(p.tagName!==f)return h.formats.call(this,p)},d.prototype.format=function(p,f){o.query(p,o.Scope.BLOCK)!=null&&(p===this.statics.blotName&&!f?this.replaceWith(d.blotName):h.prototype.format.call(this,p,f))},d.prototype.formatAt=function(p,f,m,g){o.query(m,o.Scope.BLOCK)!=null?this.format(m,g):h.prototype.formatAt.call(this,p,f,m,g)},d.prototype.insertAt=function(p,f,m){if(m==null||o.query(f,o.Scope.INLINE)!=null)h.prototype.insertAt.call(this,p,f,m);else{var g=this.split(p),v=o.create(f,m);g.parent.insertBefore(v,g)}},d.prototype.update=function(p,f){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,p,f)},d.blotName="block",d.scope=o.Scope.BLOCK_BLOT,d.tagName="P",d}(a.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var p in d)d.hasOwnProperty(p)&&(h[p]=d[p])};return function(h,d){c(h,d);function p(){this.constructor=h}h.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=function(c){s(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.formats=function(d){},h.prototype.format=function(d,p){c.prototype.formatAt.call(this,0,this.length(),d,p)},h.prototype.formatAt=function(d,p,f,m){d===0&&p===this.length()?this.format(f,m):c.prototype.formatAt.call(this,d,p,f,m)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h}(a.default);n.default=o},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var f in p)p.hasOwnProperty(f)&&(d[f]=p[f])};return function(d,p){h(d,p);function f(){this.constructor=d}d.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=i(1),c=function(h){s(d,h);function d(p){var f=h.call(this,p)||this;return f.text=f.statics.value(f.domNode),f}return d.create=function(p){return document.createTextNode(p)},d.value=function(p){var f=p.data;return f.normalize&&(f=f.normalize()),f},d.prototype.deleteAt=function(p,f){this.domNode.data=this.text=this.text.slice(0,p)+this.text.slice(p+f)},d.prototype.index=function(p,f){return this.domNode===p?f:-1},d.prototype.insertAt=function(p,f,m){m==null?(this.text=this.text.slice(0,p)+f+this.text.slice(p),this.domNode.data=this.text):h.prototype.insertAt.call(this,p,f,m)},d.prototype.length=function(){return this.text.length},d.prototype.optimize=function(p){h.prototype.optimize.call(this,p),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof d&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},d.prototype.position=function(p,f){return[this.domNode,p]},d.prototype.split=function(p,f){if(f===void 0&&(f=!1),!f){if(p===0)return this;if(p===this.length())return this.next}var m=o.create(this.domNode.splitText(p));return this.parent.insertBefore(m,this.next),this.text=this.statics.value(this.domNode),m},d.prototype.update=function(p,f){var m=this;p.some(function(g){return g.type==="characterData"&&g.target===m.domNode})&&(this.text=this.statics.value(this.domNode))},d.prototype.value=function(){return this.text},d.blotName="text",d.scope=o.Scope.INLINE_BLOT,d}(a.default);n.default=c},function(r,n,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,c){return arguments.length>1&&!this.contains(o)==!c?c:a.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,c){return c=c||0,this.substr(c,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,c){var h=this.toString();(typeof c!="number"||!isFinite(c)||Math.floor(c)!==c||c>h.length)&&(c=h.length),c-=o.length;var d=h.indexOf(o,c);return d!==-1&&d===c}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(c){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof c!="function")throw new TypeError("predicate must be a function");for(var h=Object(this),d=h.length>>>0,p=arguments[1],f,m=0;m<d;m++)if(f=h[m],c.call(p,f,m,h))return f}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,s=1,a=0;function o(x,A,N){if(x==A)return x?[[a,x]]:[];(N<0||x.length<N)&&(N=null);var O=p(x,A),P=x.substring(0,O);x=x.substring(O),A=A.substring(O),O=f(x,A);var B=x.substring(x.length-O);x=x.substring(0,x.length-O),A=A.substring(0,A.length-O);var I=c(x,A);return P&&I.unshift([a,P]),B&&I.push([a,B]),g(I),N!=null&&(I=_(I,N)),I=w(I),I}function c(x,A){var N;if(!x)return[[s,A]];if(!A)return[[i,x]];var O=x.length>A.length?x:A,P=x.length>A.length?A:x,B=O.indexOf(P);if(B!=-1)return N=[[s,O.substring(0,B)],[a,P],[s,O.substring(B+P.length)]],x.length>A.length&&(N[0][0]=N[2][0]=i),N;if(P.length==1)return[[i,x],[s,A]];var I=m(x,A);if(I){var C=I[0],k=I[1],M=I[2],F=I[3],$=I[4],V=o(C,M),q=o(k,F);return V.concat([[a,$]],q)}return h(x,A)}function h(x,A){for(var N=x.length,O=A.length,P=Math.ceil((N+O)/2),B=P,I=2*P,C=new Array(I),k=new Array(I),M=0;M<I;M++)C[M]=-1,k[M]=-1;C[B+1]=0,k[B+1]=0;for(var F=N-O,$=F%2!=0,V=0,q=0,X=0,G=0,D=0;D<P;D++){for(var L=-D+V;L<=D-q;L+=2){var U=B+L,H;L==-D||L!=D&&C[U-1]<C[U+1]?H=C[U+1]:H=C[U-1]+1;for(var Y=H-L;H<N&&Y<O&&x.charAt(H)==A.charAt(Y);)H++,Y++;if(C[U]=H,H>N)q+=2;else if(Y>O)V+=2;else if($){var K=B+F-L;if(K>=0&&K<I&&k[K]!=-1){var j=N-k[K];if(H>=j)return d(x,A,H,Y)}}}for(var W=-D+X;W<=D-G;W+=2){var K=B+W,j;W==-D||W!=D&&k[K-1]<k[K+1]?j=k[K+1]:j=k[K-1]+1;for(var Q=j-W;j<N&&Q<O&&x.charAt(N-j-1)==A.charAt(O-Q-1);)j++,Q++;if(k[K]=j,j>N)G+=2;else if(Q>O)X+=2;else if(!$){var U=B+F-W;if(U>=0&&U<I&&C[U]!=-1){var H=C[U],Y=B+H-U;if(j=N-j,H>=j)return d(x,A,H,Y)}}}}return[[i,x],[s,A]]}function d(x,A,N,O){var P=x.substring(0,N),B=A.substring(0,O),I=x.substring(N),C=A.substring(O),k=o(P,B),M=o(I,C);return k.concat(M)}function p(x,A){if(!x||!A||x.charAt(0)!=A.charAt(0))return 0;for(var N=0,O=Math.min(x.length,A.length),P=O,B=0;N<P;)x.substring(B,P)==A.substring(B,P)?(N=P,B=N):O=P,P=Math.floor((O-N)/2+N);return P}function f(x,A){if(!x||!A||x.charAt(x.length-1)!=A.charAt(A.length-1))return 0;for(var N=0,O=Math.min(x.length,A.length),P=O,B=0;N<P;)x.substring(x.length-P,x.length-B)==A.substring(A.length-P,A.length-B)?(N=P,B=N):O=P,P=Math.floor((O-N)/2+N);return P}function m(x,A){var N=x.length>A.length?x:A,O=x.length>A.length?A:x;if(N.length<4||O.length*2<N.length)return null;function P(q,X,G){for(var D=q.substring(G,G+Math.floor(q.length/4)),L=-1,U="",H,Y,K,j;(L=X.indexOf(D,L+1))!=-1;){var W=p(q.substring(G),X.substring(L)),Q=f(q.substring(0,G),X.substring(0,L));U.length<Q+W&&(U=X.substring(L-Q,L)+X.substring(L,L+W),H=q.substring(0,G-Q),Y=q.substring(G+W),K=X.substring(0,L-Q),j=X.substring(L+W))}return U.length*2>=q.length?[H,Y,K,j,U]:null}var B=P(N,O,Math.ceil(N.length/4)),I=P(N,O,Math.ceil(N.length/2)),C;if(!B&&!I)return null;I?B?C=B[4].length>I[4].length?B:I:C=I:C=B;var k,M,F,$;x.length>A.length?(k=C[0],M=C[1],F=C[2],$=C[3]):(F=C[0],$=C[1],k=C[2],M=C[3]);var V=C[4];return[k,M,F,$,V]}function g(x){x.push([a,""]);for(var A=0,N=0,O=0,P="",B="",I;A<x.length;)switch(x[A][0]){case s:O++,B+=x[A][1],A++;break;case i:N++,P+=x[A][1],A++;break;case a:N+O>1?(N!==0&&O!==0&&(I=p(B,P),I!==0&&(A-N-O>0&&x[A-N-O-1][0]==a?x[A-N-O-1][1]+=B.substring(0,I):(x.splice(0,0,[a,B.substring(0,I)]),A++),B=B.substring(I),P=P.substring(I)),I=f(B,P),I!==0&&(x[A][1]=B.substring(B.length-I)+x[A][1],B=B.substring(0,B.length-I),P=P.substring(0,P.length-I))),N===0?x.splice(A-O,N+O,[s,B]):O===0?x.splice(A-N,N+O,[i,P]):x.splice(A-N-O,N+O,[i,P],[s,B]),A=A-N-O+(N?1:0)+(O?1:0)+1):A!==0&&x[A-1][0]==a?(x[A-1][1]+=x[A][1],x.splice(A,1)):A++,O=0,N=0,P="",B="";break}x[x.length-1][1]===""&&x.pop();var C=!1;for(A=1;A<x.length-1;)x[A-1][0]==a&&x[A+1][0]==a&&(x[A][1].substring(x[A][1].length-x[A-1][1].length)==x[A-1][1]?(x[A][1]=x[A-1][1]+x[A][1].substring(0,x[A][1].length-x[A-1][1].length),x[A+1][1]=x[A-1][1]+x[A+1][1],x.splice(A-1,1),C=!0):x[A][1].substring(0,x[A+1][1].length)==x[A+1][1]&&(x[A-1][1]+=x[A+1][1],x[A][1]=x[A][1].substring(x[A+1][1].length)+x[A+1][1],x.splice(A+1,1),C=!0)),A++;C&&g(x)}var v=o;v.INSERT=s,v.DELETE=i,v.EQUAL=a,r.exports=v;function b(x,A){if(A===0)return[a,x];for(var N=0,O=0;O<x.length;O++){var P=x[O];if(P[0]===i||P[0]===a){var B=N+P[1].length;if(A===B)return[O+1,x];if(A<B){x=x.slice();var I=A-N,C=[P[0],P[1].slice(0,I)],k=[P[0],P[1].slice(I)];return x.splice(O,1,C,k),[O+1,x]}else N=B}}throw new Error("cursor_pos is out of bounds!")}function _(x,A){var N=b(x,A),O=N[1],P=N[0],B=O[P],I=O[P+1];if(B==null)return x;if(B[0]!==a)return x;if(I!=null&&B[1]+I[1]===I[1]+B[1])return O.splice(P,2,I,B),S(O,P,2);if(I!=null&&I[1].indexOf(B[1])===0){O.splice(P,2,[I[0],B[1]],[0,B[1]]);var C=I[1].slice(B[1].length);return C.length>0&&O.splice(P+2,0,[I[0],C]),S(O,P,3)}else return x}function w(x){for(var A=!1,N=function(I){return I.charCodeAt(0)>=56320&&I.charCodeAt(0)<=57343},O=function(I){return I.charCodeAt(I.length-1)>=55296&&I.charCodeAt(I.length-1)<=56319},P=2;P<x.length;P+=1)x[P-2][0]===a&&O(x[P-2][1])&&x[P-1][0]===i&&N(x[P-1][1])&&x[P][0]===s&&N(x[P][1])&&(A=!0,x[P-1][1]=x[P-2][1].slice(-1)+x[P-1][1],x[P][1]=x[P-2][1].slice(-1)+x[P][1],x[P-2][1]=x[P-2][1].slice(0,-1));if(!A)return x;for(var B=[],P=0;P<x.length;P+=1)x[P][1].length>0&&B.push(x[P]);return B}function S(x,A,N){for(var O=A+N-1;O>=0&&O>=A-1;O--)if(O+1<x.length){var P=x[O],B=x[O+1];P[0]===B[1]&&x.splice(O,2,[P[0],P[1]+B[1]])}return x}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(s){var a=[];for(var o in s)a.push(o);return a}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?s:a,n.supported=s;function s(o){return Object.prototype.toString.call(o)=="[object Arguments]"}n.unsupported=a;function a(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,s="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(s=!1));function o(h,d,p){this.fn=h,this.context=d,this.once=p||!1}function c(){this._events=new a,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,f;if(this._eventsCount===0)return d;for(f in p=this._events)i.call(p,f)&&d.push(s?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d,p){var f=s?s+d:d,m=this._events[f];if(p)return!!m;if(!m)return[];if(m.fn)return[m.fn];for(var g=0,v=m.length,b=new Array(v);g<v;g++)b[g]=m[g].fn;return b},c.prototype.emit=function(d,p,f,m,g,v){var b=s?s+d:d;if(!this._events[b])return!1;var _=this._events[b],w=arguments.length,S,x;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),w){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,p),!0;case 3:return _.fn.call(_.context,p,f),!0;case 4:return _.fn.call(_.context,p,f,m),!0;case 5:return _.fn.call(_.context,p,f,m,g),!0;case 6:return _.fn.call(_.context,p,f,m,g,v),!0}for(x=1,S=new Array(w-1);x<w;x++)S[x-1]=arguments[x];_.fn.apply(_.context,S)}else{var A=_.length,N;for(x=0;x<A;x++)switch(_[x].once&&this.removeListener(d,_[x].fn,void 0,!0),w){case 1:_[x].fn.call(_[x].context);break;case 2:_[x].fn.call(_[x].context,p);break;case 3:_[x].fn.call(_[x].context,p,f);break;case 4:_[x].fn.call(_[x].context,p,f,m);break;default:if(!S)for(N=1,S=new Array(w-1);N<w;N++)S[N-1]=arguments[N];_[x].fn.apply(_[x].context,S)}}return!0},c.prototype.on=function(d,p,f){var m=new o(p,f||this),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],m]:this._events[g].push(m):(this._events[g]=m,this._eventsCount++),this},c.prototype.once=function(d,p,f){var m=new o(p,f||this,!0),g=s?s+d:d;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],m]:this._events[g].push(m):(this._events[g]=m,this._eventsCount++),this},c.prototype.removeListener=function(d,p,f,m){var g=s?s+d:d;if(!this._events[g])return this;if(!p)return--this._eventsCount===0?this._events=new a:delete this._events[g],this;var v=this._events[g];if(v.fn)v.fn===p&&(!m||v.once)&&(!f||v.context===f)&&(--this._eventsCount===0?this._events=new a:delete this._events[g]);else{for(var b=0,_=[],w=v.length;b<w;b++)(v[b].fn!==p||m&&!v[b].once||f&&v[b].context!==f)&&_.push(v[b]);_.length?this._events[g]=_.length===1?_[0]:_:--this._eventsCount===0?this._events=new a:delete this._events[g]}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=s?s+d:d,this._events[p]&&(--this._eventsCount===0?this._events=new a:delete this._events[p])):(this._events=new a,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prototype.setMaxListeners=function(){return this},c.prefixed=s,c.EventEmitter=c,typeof r<"u"&&(r.exports=c)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},a=function(){function nt(at,gt){var bt=[],ht=!0,Dt=!1,mt=void 0;try{for(var It=at[Symbol.iterator](),re;!(ht=(re=It.next()).done)&&(bt.push(re.value),!(gt&&bt.length===gt));ht=!0);}catch(Pe){Dt=!0,mt=Pe}finally{try{!ht&&It.return&&It.return()}finally{if(Dt)throw mt}}return bt}return function(at,gt){if(Array.isArray(at))return at;if(Symbol.iterator in Object(at))return nt(at,gt);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function nt(at,gt){for(var bt=0;bt<gt.length;bt++){var ht=gt[bt];ht.enumerable=ht.enumerable||!1,ht.configurable=!0,"value"in ht&&(ht.writable=!0),Object.defineProperty(at,ht.key,ht)}}return function(at,gt,bt){return gt&&nt(at.prototype,gt),bt&&nt(at,bt),at}}(),c=i(3),h=k(c),d=i(2),p=k(d),f=i(0),m=k(f),g=i(5),v=k(g),b=i(10),_=k(b),w=i(9),S=k(w),x=i(36),A=i(37),N=i(13),O=k(N),P=i(26),B=i(38),I=i(39),C=i(40);function k(nt){return nt&&nt.__esModule?nt:{default:nt}}function M(nt,at,gt){return at in nt?Object.defineProperty(nt,at,{value:gt,enumerable:!0,configurable:!0,writable:!0}):nt[at]=gt,nt}function F(nt,at){if(!(nt instanceof at))throw new TypeError("Cannot call a class as a function")}function $(nt,at){if(!nt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return at&&(typeof at=="object"||typeof at=="function")?at:nt}function V(nt,at){if(typeof at!="function"&&at!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof at);nt.prototype=Object.create(at&&at.prototype,{constructor:{value:nt,enumerable:!1,writable:!0,configurable:!0}}),at&&(Object.setPrototypeOf?Object.setPrototypeOf(nt,at):nt.__proto__=at)}var q=(0,_.default)("quill:clipboard"),X="__ql-matcher",G=[[Node.TEXT_NODE,ne],[Node.TEXT_NODE,Nt],["br",ct],[Node.ELEMENT_NODE,Nt],[Node.ELEMENT_NODE,rt],[Node.ELEMENT_NODE,Ft],[Node.ELEMENT_NODE,tt],[Node.ELEMENT_NODE,ie],["li",yt],["b",Q.bind(Q,"bold")],["i",Q.bind(Q,"italic")],["style",_t]],D=[x.AlignAttribute,B.DirectionAttribute].reduce(function(nt,at){return nt[at.keyName]=at,nt},{}),L=[x.AlignStyle,A.BackgroundStyle,P.ColorStyle,B.DirectionStyle,I.FontStyle,C.SizeStyle].reduce(function(nt,at){return nt[at.keyName]=at,nt},{}),U=function(nt){V(at,nt);function at(gt,bt){F(this,at);var ht=$(this,(at.__proto__||Object.getPrototypeOf(at)).call(this,gt,bt));return ht.quill.root.addEventListener("paste",ht.onPaste.bind(ht)),ht.container=ht.quill.addContainer("ql-clipboard"),ht.container.setAttribute("contenteditable",!0),ht.container.setAttribute("tabindex",-1),ht.matchers=[],G.concat(ht.options.matchers).forEach(function(Dt){var mt=a(Dt,2),It=mt[0],re=mt[1];!bt.matchVisual&&re===Ft||ht.addMatcher(It,re)}),ht}return o(at,[{key:"addMatcher",value:function(bt,ht){this.matchers.push([bt,ht])}},{key:"convert",value:function(bt){if(typeof bt=="string")return this.container.innerHTML=bt.replace(/\>\r?\n +\</g,"><"),this.convert();var ht=this.quill.getFormat(this.quill.selection.savedRange.index);if(ht[O.default.blotName]){var Dt=this.container.innerText;return this.container.innerHTML="",new p.default().insert(Dt,M({},O.default.blotName,ht[O.default.blotName]))}var mt=this.prepareMatching(),It=a(mt,2),re=It[0],Pe=It[1],Wt=W(this.container,re,Pe);return K(Wt,`
886
- `)&&Wt.ops[Wt.ops.length-1].attributes==null&&(Wt=Wt.compose(new p.default().retain(Wt.length()-1).delete(1))),q.log("convert",this.container.innerHTML,Wt),this.container.innerHTML="",Wt}},{key:"dangerouslyPasteHTML",value:function(bt,ht){var Dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof bt=="string")this.quill.setContents(this.convert(bt),ht),this.quill.setSelection(0,v.default.sources.SILENT);else{var mt=this.convert(ht);this.quill.updateContents(new p.default().retain(bt).concat(mt),Dt),this.quill.setSelection(bt+mt.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(bt){var ht=this;if(!(bt.defaultPrevented||!this.quill.isEnabled())){var Dt=this.quill.getSelection(),mt=new p.default().retain(Dt.index),It=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){mt=mt.concat(ht.convert()).delete(Dt.length),ht.quill.updateContents(mt,v.default.sources.USER),ht.quill.setSelection(mt.length()-Dt.length,v.default.sources.SILENT),ht.quill.scrollingContainer.scrollTop=It,ht.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var bt=this,ht=[],Dt=[];return this.matchers.forEach(function(mt){var It=a(mt,2),re=It[0],Pe=It[1];switch(re){case Node.TEXT_NODE:Dt.push(Pe);break;case Node.ELEMENT_NODE:ht.push(Pe);break;default:[].forEach.call(bt.container.querySelectorAll(re),function(Wt){Wt[X]=Wt[X]||[],Wt[X].push(Pe)});break}}),[ht,Dt]}}]),at}(S.default);U.DEFAULTS={matchers:[],matchVisual:!0};function H(nt,at,gt){return(typeof at>"u"?"undefined":s(at))==="object"?Object.keys(at).reduce(function(bt,ht){return H(bt,ht,at[ht])},nt):nt.reduce(function(bt,ht){return ht.attributes&&ht.attributes[at]?bt.push(ht):bt.insert(ht.insert,(0,h.default)({},M({},at,gt),ht.attributes))},new p.default)}function Y(nt){if(nt.nodeType!==Node.ELEMENT_NODE)return{};var at="__ql-computed-style";return nt[at]||(nt[at]=window.getComputedStyle(nt))}function K(nt,at){for(var gt="",bt=nt.ops.length-1;bt>=0&&gt.length<at.length;--bt){var ht=nt.ops[bt];if(typeof ht.insert!="string")break;gt=ht.insert+gt}return gt.slice(-1*at.length)===at}function j(nt){if(nt.childNodes.length===0)return!1;var at=Y(nt);return["block","list-item"].indexOf(at.display)>-1}function W(nt,at,gt){return nt.nodeType===nt.TEXT_NODE?gt.reduce(function(bt,ht){return ht(nt,bt)},new p.default):nt.nodeType===nt.ELEMENT_NODE?[].reduce.call(nt.childNodes||[],function(bt,ht){var Dt=W(ht,at,gt);return ht.nodeType===nt.ELEMENT_NODE&&(Dt=at.reduce(function(mt,It){return It(ht,mt)},Dt),Dt=(ht[X]||[]).reduce(function(mt,It){return It(ht,mt)},Dt)),bt.concat(Dt)},new p.default):new p.default}function Q(nt,at,gt){return H(gt,nt,!0)}function tt(nt,at){var gt=m.default.Attributor.Attribute.keys(nt),bt=m.default.Attributor.Class.keys(nt),ht=m.default.Attributor.Style.keys(nt),Dt={};return gt.concat(bt).concat(ht).forEach(function(mt){var It=m.default.query(mt,m.default.Scope.ATTRIBUTE);It!=null&&(Dt[It.attrName]=It.value(nt),Dt[It.attrName])||(It=D[mt],It!=null&&(It.attrName===mt||It.keyName===mt)&&(Dt[It.attrName]=It.value(nt)||void 0),It=L[mt],It!=null&&(It.attrName===mt||It.keyName===mt)&&(It=L[mt],Dt[It.attrName]=It.value(nt)||void 0))}),Object.keys(Dt).length>0&&(at=H(at,Dt)),at}function rt(nt,at){var gt=m.default.query(nt);if(gt==null)return at;if(gt.prototype instanceof m.default.Embed){var bt={},ht=gt.value(nt);ht!=null&&(bt[gt.blotName]=ht,at=new p.default().insert(bt,gt.formats(nt)))}else typeof gt.formats=="function"&&(at=H(at,gt.blotName,gt.formats(nt)));return at}function ct(nt,at){return K(at,`
887
- `)||at.insert(`
888
- `),at}function _t(){return new p.default}function yt(nt,at){var gt=m.default.query(nt);if(gt==null||gt.blotName!=="list-item"||!K(at,`
889
- `))return at;for(var bt=-1,ht=nt.parentNode;!ht.classList.contains("ql-clipboard");)(m.default.query(ht)||{}).blotName==="list"&&(bt+=1),ht=ht.parentNode;return bt<=0?at:at.compose(new p.default().retain(at.length()-1).retain(1,{indent:bt}))}function Nt(nt,at){return K(at,`
890
- `)||(j(nt)||at.length()>0&&nt.nextSibling&&j(nt.nextSibling))&&at.insert(`
891
- `),at}function Ft(nt,at){if(j(nt)&&nt.nextElementSibling!=null&&!K(at,`
892
-
893
- `)){var gt=nt.offsetHeight+parseFloat(Y(nt).marginTop)+parseFloat(Y(nt).marginBottom);nt.nextElementSibling.offsetTop>nt.offsetTop+gt*1.5&&at.insert(`
894
- `)}return at}function ie(nt,at){var gt={},bt=nt.style||{};return bt.fontStyle&&Y(nt).fontStyle==="italic"&&(gt.italic=!0),bt.fontWeight&&(Y(nt).fontWeight.startsWith("bold")||parseInt(Y(nt).fontWeight)>=700)&&(gt.bold=!0),Object.keys(gt).length>0&&(at=H(at,gt)),parseFloat(bt.textIndent||0)>0&&(at=new p.default().insert(" ").concat(at)),at}function ne(nt,at){var gt=nt.data;if(nt.parentNode.tagName==="O:P")return at.insert(gt.trim());if(gt.trim().length===0&&nt.parentNode.classList.contains("ql-clipboard"))return at;if(!Y(nt.parentNode).whiteSpace.startsWith("pre")){var bt=function(Dt,mt){return mt=mt.replace(/[^\u00a0]/g,""),mt.length<1&&Dt?" ":mt};gt=gt.replace(/\r\n/g," ").replace(/\n/g," "),gt=gt.replace(/\s\s+/g,bt.bind(bt,!0)),(nt.previousSibling==null&&j(nt.parentNode)||nt.previousSibling!=null&&j(nt.previousSibling))&&(gt=gt.replace(/^\s+/,bt.bind(bt,!1))),(nt.nextSibling==null&&j(nt.parentNode)||nt.nextSibling!=null&&j(nt.nextSibling))&&(gt=gt.replace(/\s+$/,bt.bind(bt,!1)))}return at.insert(gt)}n.default=U,n.matchAttributor=tt,n.matchBlot=rt,n.matchNewline=Nt,n.matchSpacing=Ft,n.matchText=ne},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(v,b){for(var _=0;_<b.length;_++){var w=b[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(v,w.key,w)}}return function(v,b,_){return b&&g(v.prototype,b),_&&g(v,_),v}}(),a=function g(v,b,_){v===null&&(v=Function.prototype);var w=Object.getOwnPropertyDescriptor(v,b);if(w===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:g(S,b,_)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(_)}},o=i(6),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(){return d(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"optimize",value:function(_){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,_),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v}(c.default);m.blotName="bold",m.tagName=["STRONG","B"],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=function(){function C(k,M){var F=[],$=!0,V=!1,q=void 0;try{for(var X=k[Symbol.iterator](),G;!($=(G=X.next()).done)&&(F.push(G.value),!(M&&F.length===M));$=!0);}catch(D){V=!0,q=D}finally{try{!$&&X.return&&X.return()}finally{if(V)throw q}}return F}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return C(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function C(k,M){for(var F=0;F<M.length;F++){var $=M[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(k,$.key,$)}}return function(k,M,F){return M&&C(k.prototype,M),F&&C(k,F),k}}(),o=i(2),c=_(o),h=i(0),d=_(h),p=i(5),f=_(p),m=i(10),g=_(m),v=i(9),b=_(v);function _(C){return C&&C.__esModule?C:{default:C}}function w(C,k,M){return k in C?Object.defineProperty(C,k,{value:M,enumerable:!0,configurable:!0,writable:!0}):C[k]=M,C}function S(C,k){if(!(C instanceof k))throw new TypeError("Cannot call a class as a function")}function x(C,k){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:C}function A(C,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);C.prototype=Object.create(k&&k.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(C,k):C.__proto__=k)}var N=(0,g.default)("quill:toolbar"),O=function(C){A(k,C);function k(M,F){S(this,k);var $=x(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M,F));if(Array.isArray($.options.container)){var V=document.createElement("div");B(V,$.options.container),M.container.parentNode.insertBefore(V,M.container),$.container=V}else typeof $.options.container=="string"?$.container=document.querySelector($.options.container):$.container=$.options.container;if(!($.container instanceof HTMLElement)){var q;return q=N.error("Container required for toolbar",$.options),x($,q)}return $.container.classList.add("ql-toolbar"),$.controls=[],$.handlers={},Object.keys($.options.handlers).forEach(function(X){$.addHandler(X,$.options.handlers[X])}),[].forEach.call($.container.querySelectorAll("button, select"),function(X){$.attach(X)}),$.quill.on(f.default.events.EDITOR_CHANGE,function(X,G){X===f.default.events.SELECTION_CHANGE&&$.update(G)}),$.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){var X=$.quill.selection.getRange(),G=s(X,1),D=G[0];$.update(D)}),$}return a(k,[{key:"addHandler",value:function(F,$){this.handlers[F]=$}},{key:"attach",value:function(F){var $=this,V=[].find.call(F.classList,function(X){return X.indexOf("ql-")===0});if(V){if(V=V.slice(3),F.tagName==="BUTTON"&&F.setAttribute("type","button"),this.handlers[V]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[V]==null){N.warn("ignoring attaching to disabled format",V,F);return}if(d.default.query(V)==null){N.warn("ignoring attaching to nonexistent format",V,F);return}}var q=F.tagName==="SELECT"?"change":"click";F.addEventListener(q,function(X){var G=void 0;if(F.tagName==="SELECT"){if(F.selectedIndex<0)return;var D=F.options[F.selectedIndex];D.hasAttribute("selected")?G=!1:G=D.value||!1}else F.classList.contains("ql-active")?G=!1:G=F.value||!F.hasAttribute("value"),X.preventDefault();$.quill.focus();var L=$.quill.selection.getRange(),U=s(L,1),H=U[0];if($.handlers[V]!=null)$.handlers[V].call($,G);else if(d.default.query(V).prototype instanceof d.default.Embed){if(G=prompt("Enter "+V),!G)return;$.quill.updateContents(new c.default().retain(H.index).delete(H.length).insert(w({},V,G)),f.default.sources.USER)}else $.quill.format(V,G,f.default.sources.USER);$.update(H)}),this.controls.push([V,F])}}},{key:"update",value:function(F){var $=F==null?{}:this.quill.getFormat(F);this.controls.forEach(function(V){var q=s(V,2),X=q[0],G=q[1];if(G.tagName==="SELECT"){var D=void 0;if(F==null)D=null;else if($[X]==null)D=G.querySelector("option[selected]");else if(!Array.isArray($[X])){var L=$[X];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),D=G.querySelector('option[value="'+L+'"]')}D==null?(G.value="",G.selectedIndex=-1):D.selected=!0}else if(F==null)G.classList.remove("ql-active");else if(G.hasAttribute("value")){var U=$[X]===G.getAttribute("value")||$[X]!=null&&$[X].toString()===G.getAttribute("value")||$[X]==null&&!G.getAttribute("value");G.classList.toggle("ql-active",U)}else G.classList.toggle("ql-active",$[X]!=null)})}}]),k}(b.default);O.DEFAULTS={};function P(C,k,M){var F=document.createElement("button");F.setAttribute("type","button"),F.classList.add("ql-"+k),M!=null&&(F.value=M),C.appendChild(F)}function B(C,k){Array.isArray(k[0])||(k=[k]),k.forEach(function(M){var F=document.createElement("span");F.classList.add("ql-formats"),M.forEach(function($){if(typeof $=="string")P(F,$);else{var V=Object.keys($)[0],q=$[V];Array.isArray(q)?I(F,V,q):P(F,V,q)}}),C.appendChild(F)})}function I(C,k,M){var F=document.createElement("select");F.classList.add("ql-"+k),M.forEach(function($){var V=document.createElement("option");$!==!1?V.setAttribute("value",$):V.setAttribute("selected","selected"),F.appendChild(V)}),C.appendChild(F)}O.DEFAULTS={container:null,handlers:{clean:function(){var k=this,M=this.quill.getSelection();if(M!=null)if(M.length==0){var F=this.quill.getFormat();Object.keys(F).forEach(function($){d.default.query($,d.default.Scope.INLINE)!=null&&k.quill.format($,!1)})}else this.quill.removeFormat(M,f.default.sources.USER)},direction:function(k){var M=this.quill.getFormat().align;k==="rtl"&&M==null?this.quill.format("align","right",f.default.sources.USER):!k&&M==="right"&&this.quill.format("align",!1,f.default.sources.USER),this.quill.format("direction",k,f.default.sources.USER)},indent:function(k){var M=this.quill.getSelection(),F=this.quill.getFormat(M),$=parseInt(F.indent||0);if(k==="+1"||k==="-1"){var V=k==="+1"?1:-1;F.direction==="rtl"&&(V*=-1),this.quill.format("indent",$+V,f.default.sources.USER)}},link:function(k){k===!0&&(k=prompt("Enter link URL:")),this.quill.format("link",k,f.default.sources.USER)},list:function(k){var M=this.quill.getSelection(),F=this.quill.getFormat(M);k==="check"?F.list==="checked"||F.list==="unchecked"?this.quill.format("list",!1,f.default.sources.USER):this.quill.format("list","unchecked",f.default.sources.USER):this.quill.format("list",k,f.default.sources.USER)}}},n.default=O,n.addControls=B},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(v,b){for(var _=0;_<b.length;_++){var w=b[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(v,w.key,w)}}return function(v,b,_){return b&&g(v.prototype,b),_&&g(v,_),v}}(),a=function g(v,b,_){v===null&&(v=Function.prototype);var w=Object.getOwnPropertyDescriptor(v,b);if(w===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:g(S,b,_)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(_)}},o=i(28),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(b,_){d(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,b));return w.label.innerHTML=_,w.container.classList.add("ql-color-picker"),[].slice.call(w.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(S){S.classList.add("ql-primary")}),w}return s(v,[{key:"buildItem",value:function(_){var w=a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,_);return w.style.backgroundColor=_.getAttribute("value")||"",w}},{key:"selectItem",value:function(_,w){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,_,w);var S=this.label.querySelector(".ql-color-label"),x=_&&_.getAttribute("data-value")||"";S&&(S.tagName==="line"?S.style.stroke=x:S.style.fill=x)}}]),v}(c.default);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(v,b){for(var _=0;_<b.length;_++){var w=b[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(v,w.key,w)}}return function(v,b,_){return b&&g(v.prototype,b),_&&g(v,_),v}}(),a=function g(v,b,_){v===null&&(v=Function.prototype);var w=Object.getOwnPropertyDescriptor(v,b);if(w===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:g(S,b,_)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(_)}},o=i(28),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(b,_){d(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,b));return w.container.classList.add("ql-icon-picker"),[].forEach.call(w.container.querySelectorAll(".ql-picker-item"),function(S){S.innerHTML=_[S.getAttribute("data-value")||""]}),w.defaultItem=w.container.querySelector(".ql-selected"),w.selectItem(w.defaultItem),w}return s(v,[{key:"selectItem",value:function(_,w){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,_,w),_=_||this.defaultItem,this.label.innerHTML=_.innerHTML}}]),v}(c.default);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function c(h,d){for(var p=0;p<d.length;p++){var f=d[p];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,d,p){return d&&c(h.prototype,d),p&&c(h,p),h}}();function a(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function c(h,d){var p=this;a(this,c),this.quill=h,this.boundsContainer=d||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){p.root.style.marginTop=-1*p.quill.root.scrollTop+"px"}),this.hide()}return s(c,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var p=d.left+d.width/2-this.root.offsetWidth/2,f=d.bottom+this.quill.root.scrollTop;this.root.style.left=p+"px",this.root.style.top=f+"px",this.root.classList.remove("ql-flip");var m=this.boundsContainer.getBoundingClientRect(),g=this.root.getBoundingClientRect(),v=0;if(g.right>m.right&&(v=m.right-g.right,this.root.style.left=p+v+"px"),g.left<m.left&&(v=m.left-g.left,this.root.style.left=p+v+"px"),g.bottom>m.bottom){var b=g.bottom-g.top,_=d.bottom-d.top+b;this.root.style.top=f-_+"px",this.root.classList.add("ql-flip")}return v}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),c}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function I(C,k){var M=[],F=!0,$=!1,V=void 0;try{for(var q=C[Symbol.iterator](),X;!(F=(X=q.next()).done)&&(M.push(X.value),!(k&&M.length===k));F=!0);}catch(G){$=!0,V=G}finally{try{!F&&q.return&&q.return()}finally{if($)throw V}}return M}return function(C,k){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return I(C,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function I(C,k,M){C===null&&(C=Function.prototype);var F=Object.getOwnPropertyDescriptor(C,k);if(F===void 0){var $=Object.getPrototypeOf(C);return $===null?void 0:I($,k,M)}else{if("value"in F)return F.value;var V=F.get;return V===void 0?void 0:V.call(M)}},o=function(){function I(C,k){for(var M=0;M<k.length;M++){var F=k[M];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(C,F.key,F)}}return function(C,k,M){return k&&I(C.prototype,k),M&&I(C,M),C}}(),c=i(3),h=S(c),d=i(8),p=S(d),f=i(43),m=S(f),g=i(27),v=S(g),b=i(15),_=i(41),w=S(_);function S(I){return I&&I.__esModule?I:{default:I}}function x(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function A(I,C){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:I}function N(I,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);I.prototype=Object.create(C&&C.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(I,C):I.__proto__=C)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],P=function(I){N(C,I);function C(k,M){x(this,C),M.modules.toolbar!=null&&M.modules.toolbar.container==null&&(M.modules.toolbar.container=O);var F=A(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,k,M));return F.quill.container.classList.add("ql-snow"),F}return o(C,[{key:"extendToolbar",value:function(M){M.container.classList.add("ql-snow"),this.buildButtons([].slice.call(M.container.querySelectorAll("button")),w.default),this.buildPickers([].slice.call(M.container.querySelectorAll("select")),w.default),this.tooltip=new B(this.quill,this.options.bounds),M.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(F,$){M.handlers.link.call(M,!$.format.link)})}}]),C}(m.default);P.DEFAULTS=(0,h.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var k=this.quill.getSelection();if(k==null||k.length==0)return;var M=this.quill.getText(k);/^\S+@\S+\.\S+$/.test(M)&&M.indexOf("mailto:")!==0&&(M="mailto:"+M);var F=this.quill.theme.tooltip;F.edit("link",M)}else this.quill.format("link",!1)}}}}});var B=function(I){N(C,I);function C(k,M){x(this,C);var F=A(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,k,M));return F.preview=F.root.querySelector("a.ql-preview"),F}return o(C,[{key:"listen",value:function(){var M=this;a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(F){M.root.classList.contains("ql-editing")?M.save():M.edit("link",M.preview.textContent),F.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(F){if(M.linkRange!=null){var $=M.linkRange;M.restoreFocus(),M.quill.formatText($,"link",!1,p.default.sources.USER),delete M.linkRange}F.preventDefault(),M.hide()}),this.quill.on(p.default.events.SELECTION_CHANGE,function(F,$,V){if(F!=null){if(F.length===0&&V===p.default.sources.USER){var q=M.quill.scroll.descendant(v.default,F.index),X=s(q,2),G=X[0],D=X[1];if(G!=null){M.linkRange=new b.Range(F.index-D,G.length());var L=v.default.formats(G.domNode);M.preview.textContent=L,M.preview.setAttribute("href",L),M.show(),M.position(M.quill.getBounds(M.linkRange));return}}else delete M.linkRange;M.hide()}})}},{key:"show",value:function(){a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C}(f.BaseTooltip);B.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(29),a=ht(s),o=i(36),c=i(38),h=i(64),d=i(65),p=ht(d),f=i(66),m=ht(f),g=i(67),v=ht(g),b=i(37),_=i(26),w=i(39),S=i(40),x=i(56),A=ht(x),N=i(68),O=ht(N),P=i(27),B=ht(P),I=i(69),C=ht(I),k=i(70),M=ht(k),F=i(71),$=ht(F),V=i(72),q=ht(V),X=i(73),G=ht(X),D=i(13),L=ht(D),U=i(74),H=ht(U),Y=i(75),K=ht(Y),j=i(57),W=ht(j),Q=i(41),tt=ht(Q),rt=i(28),ct=ht(rt),_t=i(59),yt=ht(_t),Nt=i(60),Ft=ht(Nt),ie=i(61),ne=ht(ie),nt=i(108),at=ht(nt),gt=i(62),bt=ht(gt);function ht(Dt){return Dt&&Dt.__esModule?Dt:{default:Dt}}a.default.register({"attributors/attribute/direction":c.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":_.ColorClass,"attributors/class/direction":c.DirectionClass,"attributors/class/font":w.FontClass,"attributors/class/size":S.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":_.ColorStyle,"attributors/style/direction":c.DirectionStyle,"attributors/style/font":w.FontStyle,"attributors/style/size":S.SizeStyle},!0),a.default.register({"formats/align":o.AlignClass,"formats/direction":c.DirectionClass,"formats/indent":h.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":_.ColorStyle,"formats/font":w.FontClass,"formats/size":S.SizeClass,"formats/blockquote":p.default,"formats/code-block":L.default,"formats/header":m.default,"formats/list":v.default,"formats/bold":A.default,"formats/code":D.Code,"formats/italic":O.default,"formats/link":B.default,"formats/script":C.default,"formats/strike":M.default,"formats/underline":$.default,"formats/image":q.default,"formats/video":G.default,"formats/list/item":g.ListItem,"modules/formula":H.default,"modules/syntax":K.default,"modules/toolbar":W.default,"themes/bubble":at.default,"themes/snow":bt.default,"ui/icons":tt.default,"ui/picker":ct.default,"ui/icon-picker":Ft.default,"ui/color-picker":yt.default,"ui/tooltip":ne.default},!0),n.default=a.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=function(){function v(b,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,_,w){return _&&v(b.prototype,_),w&&v(b,w),b}}(),a=function v(b,_,w){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,_);if(S===void 0){var x=Object.getPrototypeOf(b);return x===null?void 0:v(x,_,w)}else{if("value"in S)return S.value;var A=S.get;return A===void 0?void 0:A.call(w)}},o=i(0),c=h(o);function h(v){return v&&v.__esModule?v:{default:v}}function d(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function p(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function f(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var m=function(v){f(b,v);function b(){return d(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"add",value:function(w,S){if(S==="+1"||S==="-1"){var x=this.value(w)||0;S=S==="+1"?x+1:x-1}return S===0?(this.remove(w),!0):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,w,S)}},{key:"canAdd",value:function(w,S){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,w,S)||a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,w,parseInt(S))}},{key:"value",value:function(w){return parseInt(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,w))||void 0}}]),b}(c.default.Attributor.Class),g=new m("indent","ql-indent",{scope:c.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(4),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function h(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(f){d(m,f);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(a.default);p.blotName="blockquote",p.tagName="blockquote",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function m(g,v){for(var b=0;b<v.length;b++){var _=v[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,v,b){return v&&m(g.prototype,v),b&&m(g,b),g}}(),a=i(4),o=c(a);function c(m){return m&&m.__esModule?m:{default:m}}function h(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function p(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var f=function(m){p(g,m);function g(){return h(this,g),d(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),g}(o.default);f.blotName="header",f.tagName=["H1","H2","H3","H4","H5","H6"],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var s=function(){function x(A,N){for(var O=0;O<N.length;O++){var P=N[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(A,P.key,P)}}return function(A,N,O){return N&&x(A.prototype,N),O&&x(A,O),A}}(),a=function x(A,N,O){A===null&&(A=Function.prototype);var P=Object.getOwnPropertyDescriptor(A,N);if(P===void 0){var B=Object.getPrototypeOf(A);return B===null?void 0:x(B,N,O)}else{if("value"in P)return P.value;var I=P.get;return I===void 0?void 0:I.call(O)}},o=i(0),c=m(o),h=i(4),d=m(h),p=i(25),f=m(p);function m(x){return x&&x.__esModule?x:{default:x}}function g(x,A,N){return A in x?Object.defineProperty(x,A,{value:N,enumerable:!0,configurable:!0,writable:!0}):x[A]=N,x}function v(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function b(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function _(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}var w=function(x){_(A,x);function A(){return v(this,A),b(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return s(A,[{key:"format",value:function(O,P){O===S.blotName&&!P?this.replaceWith(c.default.create(this.statics.scope)):a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,O,P)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,P){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,P),this):(this.parent.unwrap(),a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,O,P))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:a(A.__proto__||Object.getPrototypeOf(A),"formats",this).call(this,O)}}]),A}(d.default);w.blotName="list-item",w.tagName="LI";var S=function(x){_(A,x),s(A,null,[{key:"create",value:function(O){var P=O==="ordered"?"OL":"UL",B=a(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,P);return(O==="checked"||O==="unchecked")&&B.setAttribute("data-checked",O==="checked"),B}},{key:"formats",value:function(O){if(O.tagName==="OL")return"ordered";if(O.tagName==="UL")return O.hasAttribute("data-checked")?O.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function A(N){v(this,A);var O=b(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,N)),P=function(I){if(I.target.parentNode===N){var C=O.statics.formats(N),k=c.default.find(I.target);C==="checked"?k.format("list","unchecked"):C==="unchecked"&&k.format("list","checked")}};return N.addEventListener("touchstart",P),N.addEventListener("mousedown",P),O}return s(A,[{key:"format",value:function(O,P){this.children.length>0&&this.children.tail.format(O,P)}},{key:"formats",value:function(){return g({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,P){if(O instanceof w)a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,O,P);else{var B=P==null?this.length():P.offset(this),I=this.split(B);I.parent.insertBefore(O,I)}}},{key:"optimize",value:function(O){a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,O);var P=this.next;P!=null&&P.prev===this&&P.statics.blotName===this.statics.blotName&&P.domNode.tagName===this.domNode.tagName&&P.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(P.moveChildren(this),P.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var P=c.default.create(this.statics.defaultChild);O.moveChildren(P),this.appendChild(P)}a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,O)}}]),A}(f.default);S.blotName="list",S.scope=c.default.Scope.BLOCK_BLOT,S.tagName=["OL","UL"],S.defaultChild="list-item",S.allowedChildren=[w],n.ListItem=w,n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(56),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function h(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(f){d(m,f);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(a.default);p.blotName="italic",p.tagName=["EM","I"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(v,b){for(var _=0;_<b.length;_++){var w=b[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(v,w.key,w)}}return function(v,b,_){return b&&g(v.prototype,b),_&&g(v,_),v}}(),a=function g(v,b,_){v===null&&(v=Function.prototype);var w=Object.getOwnPropertyDescriptor(v,b);if(w===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:g(S,b,_)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(_)}},o=i(6),c=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function d(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function p(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function f(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var m=function(g){f(v,g);function v(){return d(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"create",value:function(_){return _==="super"?document.createElement("sup"):_==="sub"?document.createElement("sub"):a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,_)}},{key:"formats",value:function(_){if(_.tagName==="SUB")return"sub";if(_.tagName==="SUP")return"super"}}]),v}(c.default);m.blotName="script",m.tagName=["SUB","SUP"],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function h(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(f){d(m,f);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(a.default);p.blotName="strike",p.tagName="S",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function h(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(f){d(m,f);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(a.default);p.blotName="underline",p.tagName="U",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,w){for(var S=0;S<w.length;S++){var x=w[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,w,S){return w&&b(_.prototype,w),S&&b(_,S),_}}(),a=function b(_,w,S){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,w);if(x===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:b(A,w,S)}else{if("value"in x)return x.value;var N=x.get;return N===void 0?void 0:N.call(S)}},o=i(0),c=d(o),h=i(27);function d(b){return b&&b.__esModule?b:{default:b}}function p(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function f(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function m(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var g=["alt","height","width"],v=function(b){m(_,b);function _(){return p(this,_),f(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"format",value:function(S,x){g.indexOf(S)>-1?x?this.domNode.setAttribute(S,x):this.domNode.removeAttribute(S):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,S,x)}}],[{key:"create",value:function(S){var x=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,S);return typeof S=="string"&&x.setAttribute("src",this.sanitize(S)),x}},{key:"formats",value:function(S){return g.reduce(function(x,A){return S.hasAttribute(A)&&(x[A]=S.getAttribute(A)),x},{})}},{key:"match",value:function(S){return/\.(jpe?g|gif|png)$/.test(S)||/^data:image\/.+;base64/.test(S)}},{key:"sanitize",value:function(S){return(0,h.sanitize)(S,["http","https","data"])?S:"//:0"}},{key:"value",value:function(S){return S.getAttribute("src")}}]),_}(c.default.Embed);v.blotName="image",v.tagName="IMG",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,w){for(var S=0;S<w.length;S++){var x=w[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,w,S){return w&&b(_.prototype,w),S&&b(_,S),_}}(),a=function b(_,w,S){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,w);if(x===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:b(A,w,S)}else{if("value"in x)return x.value;var N=x.get;return N===void 0?void 0:N.call(S)}},o=i(4),c=i(27),h=d(c);function d(b){return b&&b.__esModule?b:{default:b}}function p(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function f(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function m(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var g=["height","width"],v=function(b){m(_,b);function _(){return p(this,_),f(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"format",value:function(S,x){g.indexOf(S)>-1?x?this.domNode.setAttribute(S,x):this.domNode.removeAttribute(S):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,S,x)}}],[{key:"create",value:function(S){var x=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,S);return x.setAttribute("frameborder","0"),x.setAttribute("allowfullscreen",!0),x.setAttribute("src",this.sanitize(S)),x}},{key:"formats",value:function(S){return g.reduce(function(x,A){return S.hasAttribute(A)&&(x[A]=S.getAttribute(A)),x},{})}},{key:"sanitize",value:function(S){return h.default.sanitize(S)}},{key:"value",value:function(S){return S.getAttribute("src")}}]),_}(o.BlockEmbed);v.blotName="video",v.className="ql-video",v.tagName="IFRAME",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var s=function(){function S(x,A){for(var N=0;N<A.length;N++){var O=A[N];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(x,O.key,O)}}return function(x,A,N){return A&&S(x.prototype,A),N&&S(x,N),x}}(),a=function S(x,A,N){x===null&&(x=Function.prototype);var O=Object.getOwnPropertyDescriptor(x,A);if(O===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:S(P,A,N)}else{if("value"in O)return O.value;var B=O.get;return B===void 0?void 0:B.call(N)}},o=i(35),c=m(o),h=i(5),d=m(h),p=i(9),f=m(p);function m(S){return S&&S.__esModule?S:{default:S}}function g(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function v(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function b(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var _=function(S){b(x,S);function x(){return g(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,null,[{key:"create",value:function(N){var O=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,N);return typeof N=="string"&&(window.katex.render(N,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",N)),O}},{key:"value",value:function(N){return N.getAttribute("data-value")}}]),x}(c.default);_.blotName="formula",_.className="ql-formula",_.tagName="SPAN";var w=function(S){b(x,S),s(x,null,[{key:"register",value:function(){d.default.register(_,!0)}}]);function x(){g(this,x);var A=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return A}return x}(f.default);n.FormulaBlot=_,n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=function(){function N(O,P){for(var B=0;B<P.length;B++){var I=P[B];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(O,I.key,I)}}return function(O,P,B){return P&&N(O.prototype,P),B&&N(O,B),O}}(),a=function N(O,P,B){O===null&&(O=Function.prototype);var I=Object.getOwnPropertyDescriptor(O,P);if(I===void 0){var C=Object.getPrototypeOf(O);return C===null?void 0:N(C,P,B)}else{if("value"in I)return I.value;var k=I.get;return k===void 0?void 0:k.call(B)}},o=i(0),c=v(o),h=i(5),d=v(h),p=i(9),f=v(p),m=i(13),g=v(m);function v(N){return N&&N.__esModule?N:{default:N}}function b(N,O){if(!(N instanceof O))throw new TypeError("Cannot call a class as a function")}function _(N,O){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:N}function w(N,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);N.prototype=Object.create(O&&O.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(N,O):N.__proto__=O)}var S=function(N){w(O,N);function O(){return b(this,O),_(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return s(O,[{key:"replaceWith",value:function(B){this.domNode.textContent=this.domNode.textContent,this.attach(),a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,B)}},{key:"highlight",value:function(B){var I=this.domNode.textContent;this.cachedText!==I&&((I.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=B(I),this.domNode.normalize(),this.attach()),this.cachedText=I)}}]),O}(g.default);S.className="ql-syntax";var x=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),A=function(N){w(O,N),s(O,null,[{key:"register",value:function(){d.default.register(x,!0),d.default.register(S,!0)}}]);function O(P,B){b(this,O);var I=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,P,B));if(typeof I.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return I.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){I.highlight(),C=null},I.options.interval)}),I.highlight(),I}return s(O,[{key:"highlight",value:function(){var B=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var I=this.quill.getSelection();this.quill.scroll.descendants(S).forEach(function(C){C.highlight(B.options.highlight)}),this.quill.update(d.default.sources.SILENT),I!=null&&this.quill.setSelection(I,d.default.sources.SILENT)}}}]),O}(f.default);A.DEFAULTS={highlight:function(){return window.hljs==null?null:function(N){var O=window.hljs.highlightAuto(N);return O.value}}(),interval:1e3},n.CodeBlock=S,n.CodeToken=x,n.default=A},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var s=function O(P,B,I){P===null&&(P=Function.prototype);var C=Object.getOwnPropertyDescriptor(P,B);if(C===void 0){var k=Object.getPrototypeOf(P);return k===null?void 0:O(k,B,I)}else{if("value"in C)return C.value;var M=C.get;return M===void 0?void 0:M.call(I)}},a=function(){function O(P,B){for(var I=0;I<B.length;I++){var C=B[I];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(P,C.key,C)}}return function(P,B,I){return B&&O(P.prototype,B),I&&O(P,I),P}}(),o=i(3),c=b(o),h=i(8),d=b(h),p=i(43),f=b(p),m=i(15),g=i(41),v=b(g);function b(O){return O&&O.__esModule?O:{default:O}}function _(O,P){if(!(O instanceof P))throw new TypeError("Cannot call a class as a function")}function w(O,P){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:O}function S(O,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);O.prototype=Object.create(P&&P.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(O,P):O.__proto__=P)}var x=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],A=function(O){S(P,O);function P(B,I){_(this,P),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=x);var C=w(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,B,I));return C.quill.container.classList.add("ql-bubble"),C}return a(P,[{key:"extendToolbar",value:function(I){this.tooltip=new N(this.quill,this.options.bounds),this.tooltip.root.appendChild(I.container),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),v.default)}}]),P}(f.default);A.DEFAULTS=(0,c.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){P?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var N=function(O){S(P,O);function P(B,I){_(this,P);var C=w(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,B,I));return C.quill.on(d.default.events.EDITOR_CHANGE,function(k,M,F,$){if(k===d.default.events.SELECTION_CHANGE)if(M!=null&&M.length>0&&$===d.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var V=C.quill.getLines(M.index,M.length);if(V.length===1)C.position(C.quill.getBounds(M));else{var q=V[V.length-1],X=C.quill.getIndex(q),G=Math.min(q.length()-1,M.index+M.length-X),D=C.quill.getBounds(new m.Range(X,G));C.position(D)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return a(P,[{key:"listen",value:function(){var I=this;s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){I.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!I.root.classList.contains("ql-hidden")){var C=I.quill.getSelection();C!=null&&I.position(I.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(I){var C=s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"position",this).call(this,I),k=this.root.querySelector(".ql-tooltip-arrow");if(k.style.marginLeft="",C===0)return C;k.style.marginLeft=-1*C-k.offsetWidth/2+"px"}}]),P}(p.BaseTooltip);N.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=N,n.default=A},function(r,n,i){r.exports=i(63)}]).default})})(hv);var EL=hv.exports;const AL=ni(EL),G3="",CL=e=>{const[t,r]=dt.useState(!1);console.log("allProps",e);const n=dt.useRef(null),i=dt.useRef(null),s=dt.useRef(null),a=dt.useRef(null),o=dt.useRef(16),c=dt.useRef(null),{uniqueId:h,text:d,locked:p,transformation:f,onTextUpdate:m,pointerdown:g,pointerup:v,mousedown:b,mouseup:_,pointerover:w,mouseover:S,mouseout:x}=e,{scale:A=[1,1],x:N,y:O,rotation:P=1,fontFamily:B="Arial",fontWeight:I="normal",fontStyle:C="normal",fontSize:k=16,fill:M="black",stroke:F,strokeThickness:$,blurRadius:V=0,blurEnabled:q=!1,dropShadowColor:X=null,wordWrapWidth:G=5e7,leading:D=0,letterSpacing:L}=f;Mt.useEffect(()=>{o.current=Number(k)},[k]);const U=["italic","oblique"].includes(C)?C:void 0,H=["bold","lighter","100","200","300"].includes(I)?I:void 0,Y=Number(L)>0?L:void 0,K=Mt.useMemo(()=>new Ar.TextStyle({fontFamily:B,fontSize:k,fill:M||"white",stroke:F,strokeThickness:$,...U&&{fontStyle:U},...H&&{fontWeight:H},...Y&&{letterSpacing:Y},...q&&{dropShadow:!0,dropShadowBlur:Number(V),dropShadowColor:(X==null?void 0:X.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:G||500,leading:D||0}),[q,V,M,B,k,D,U,H,Y,X,F,$,G]);Mt.useEffect(()=>{c.current={...f}},[f]);const j=W=>{m&&m({text:W,uniqueId:h,droptype:"titles"})};return Mt.useEffect(()=>{if(t&&s.current){let Q=document.getElementById("note-editor");if(Q){Q.style.position="absolute",Q.style.zIndex="10",Q.style.left=N+"px",Q.style.top=O+"px",Q.style.backgroundColor="var(--chakra-color-darkShark)",Q.style.transform="scale(1.5)",Q.style.width="300px",Q.style.height="100px",Q.style.color="#fff",Q.style.fontSize="20px",Q.style.border="1px solid #CBCEE0";const tt={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var W=new AL("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...tt}}},placeholder:"Compose your text here...",theme:"snow"});W.on("text-change",function(){j(W.root.innerText)}),W.setText(d),W.focus(),W.off("text-change",()=>{console.log("removed")}),W.hasFocus()||(Q.style.display="none")}}},[N,O,t]),$t.jsx(Eh,{...e,children:$t.jsxs(qt.Container,{ref:n,children:[t&&$t.jsx(qt.Container,{ref:s}),$t.jsx(qt.Container,{alpha:t?0:1,ref:a,children:$t.jsx(qt.Text,{style:K,x:N,y:O,rotation:P,anchor:.5,text:d,...!t&&!p&&{interactive:!0,buttonMode:!0,pointerdown:g,pointerout:x,pointerover:w,pointerup:v,mousedown:b,mouseup:_,mouseover:S},ref:i,scale:A})})]})})},OL=qt.withFilters(qt.Container,{blur:Ar.filters.BlurFilter,adjust:ah,matrix:Ar.filters.ColorMatrixFilter}),PL=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],IL={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},kL=e=>{const[t,r]=Mt.useState(!1),[,n]=dt.useState(!1),[,i]=Mt.useState({isWaiting:!1,isStalled:!1}),[s,a]=Mt.useState(),[o,c]=dt.useState(!1),h=dt.useRef(null),d=dt.useRef(null),p=dt.useRef(null),f=dt.useRef(null),m=dt.useRef(null),g=dt.useRef(null),v=dt.useRef(IL),{tl:b,playerTimeRef:_,isDragging:w}=dt.useContext(us),{uniqueId:S,mute:x=!1,locked:A=!1,src:N,startAt:O,endAt:P,frameStartAt:B,frameEndAt:I,initialAlpha:C,transformation:{x:k,y:M,width:F,height:$,scale:V,rotation:q,animation:X,colorCorrection:G,effect:D},pointerdown:L,pointerup:U,mousedown:H,mouseup:Y,pointerover:K,mouseover:j,mouseout:W,applyTransformer:Q,onAnchorTransformationEnd:tt}=e,rt=N||"",{contrast:ct=1,saturation:_t=1,exposure:yt=1,blurRadius:Nt=0,alpha:Ft=1}=G||{},ie={brightness:yt,contrast:ct,saturation:_t,alpha:Ft},ne=Mt.useCallback(()=>{c(!0)},[]),nt=Mt.useCallback(mt=>{console.log("changeEnd",mt),tt&&(console.log("running onAnchorTransformationEnd"),tt(mt))},[]),at=Mt.useMemo(()=>{const mt=document.createElement("video");return mt.src=N,mt.crossOrigin="Anonymus",mt.autoplay=!1,mt.currentTime=1e-4,mt},[N]);fa(Gn.PAUSE,mt=>{if(console.log("pause event",mt),g.current){const It=g.current;It.currentTime>0&&!It.paused&&!It.ended&&It.readyState>It.HAVE_CURRENT_DATA&&g.current.pause(),v.current.isPlaying=!1}}),Mt.useEffect(()=>{console.log("current",g.current,w),g.current&&(w?(g.current.pause(),v.current.isPlaying=!1,v.current.isDragging=!0):v.current.isDragging=!1)},[w]);const gt=mt=>{g.current&&(console.log("video gsapOnStart",_.current,w),_.current>=mt&&_.current<=P&&!w&&(g.current.currentTime=Number(B)||Number(mt),g.current.play(),v.current.isPlaying=!0))},bt=()=>{if(console.log("onComplete triggered"),g.current){const mt=g.current;mt.currentTime>0&&!mt.paused&&!mt.ended&&mt.readyState>mt.HAVE_CURRENT_DATA&&g.current.pause(),v.current.isPlaying=!1}},ht=()=>{},Dt=()=>{if(g.current){Math.abs(g.current.currentTime-_.current);const mt=g.current,It=mt.currentTime>0&&!mt.paused&&!mt.ended&&mt.readyState>mt.HAVE_CURRENT_DATA;v.current.isDragging?(console.log("video updating",_.current),g.current.currentTime=_.current,g.current.play(),setTimeout(()=>{v.current.isPlaying=!1,g.current&&g.current.pause()},55),v.current.isPlaying=!1):v.current.isPlaying||(It||g.current.play(),v.current.isPlaying=!0)}};return dt.useEffect(()=>{let mt=Wr.context(()=>{});if(d.current&&b.current){const It={duration:Number(P)-Number(O),onStart:gt,onComplete:bt,onStartParams:[O],onCompleteParams:[],onInterrupt:ht,onUpdate:Dt,onUpdateParams:[]},re=fh(X||"None");mt=Wr.context(()=>{var Pe,Wt;gr(re.from)?gr(re.to)?gr(re.fromTo)?b.current.to(d.current,{alpha:1,duration:.01},O).from(f.current,{...It},O).to(d.current,{alpha:0,duration:.1},Number(P)-.1):b.current.fromTo(d.current,(Pe=re.fromTo)==null?void 0:Pe.from,(Wt=re.fromTo)==null?void 0:Wt.to,O).from(f.current,{...It},O).to(d.current,{alpha:0,duration:.2},P-.2):b.current.to(d.current,{alpha:1,duration:.2,...re.to},O).from(f.current,{...It},O).to(d.current,{alpha:0,duration:.2},P-.2):b.current.from(d.current,{...re.from},O).to(f.current,{alpha:1,duration:.2},O).from(f.current,{...It},O).to(d.current,{alpha:0,duration:.2},P-.2)})}return()=>mt.revert()},[X,O,P]),Mt.useEffect(()=>{d.current&&r(!0)},[]),Mt.useEffect(()=>{g.current&&(g.current.muted=x)},[x]),Mt.useEffect(()=>{if(g.current){const mt=g.current;mt.currentTime>0&&!mt.paused&&!mt.ended&&mt.readyState>mt.HAVE_CURRENT_DATA&&(o||w)&&(g.current.pause(),v.current.isPlaying=!1)}},[o,w]),Mt.useEffect(()=>{const mt=Math.round((Number(B)+Number.EPSILON)*100)/100,It=function(){g.current&&(g.current.currentTime=mt)},re=function(){if(g.current){const Ie=g.current;Ie.currentTime>0&&!Ie.paused&&!Ie.ended&&Ie.readyState>Ie.HAVE_CURRENT_DATA&&g.current.pause()}i({isWaiting:!1,isStalled:!1})},Pe=function(){g.current&&g.current.pause(),i({isWaiting:!0,isStalled:!1})},Wt=function(){i({isWaiting:!1,isStalled:!1})},Zt=function(){i({isWaiting:!1,isStalled:!0})},Qt=Math.round((Number(B)+Number.EPSILON)*100)/100,ye=Math.round((Number(I)+Number.EPSILON)*100)/100,lr=`${rt}#t=${Qt},${ye}`;return console.log("urlTimestap",lr),Ar.Texture.fromLoader(at,lr,S,{pixiIdPrefix:S,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(Ie=>{Ie&&(a(Ie),console.log(Ie.baseTexture.resource.source),g.current=Ie.baseTexture.resource.source,g.current.id=S,g.current.addEventListener("loadedmetadata",It),g.current.addEventListener("ended",re),g.current.addEventListener("loadstart",Pe),g.current.addEventListener("canplaythrough",Wt),g.current.addEventListener("stalled",Zt))}),()=>{g.current.removeEventListener("loadedmetadata",It),g.current.removeEventListener("ended",re),g.current.removeEventListener("loadstart",Pe),g.current.removeEventListener("canplaythrough",Wt),g.current.removeEventListener("stalled",Zt)}},[rt,S,B,I,at]),$t.jsxs(qt.Container,{ref:p,children:[$t.jsx(qt.Container,{ref:d,alpha:C,position:[k,M],pivot:[k,M],width:F,height:$,children:$t.jsx(OL,{scale:1,blur:{blur:Nt,quality:4},adjust:ie,apply:({matrix:mt})=>{D==="BlackAndWhite"?mt.desaturate():D==="Sepia"?mt.sepia():D==="RetroVintage"||D==="NightVision"?mt.negative():D==="Normal"&&mt.reset()},matrix:{enabled:!0,matrix:PL},children:$t.jsx(qt.Container,{ref:f,children:s&&$t.jsx(qt.Sprite,{texture:s,width:F,height:$,anchor:.5,x:k,y:M,...!A&&!o&&{interactive:!0,buttonMode:!0,pointerdown:L,pointerover:K,pointerout:W,mousedown:H,mouseover:j,mouseout:W,mouseup:Y,pointerup:U},ref:h,scale:V,rotation:q})})})}),Q&&$t.jsx(ch,{pixiTransformerRef:m,imageRef:d,isMounted:t,transformCommit:nt,transformChange:ne,mouseoverEvent:n,uniqueId:S})]})};var fv=(e=>(e.FADE_IN="FADE_IN",e.FADE_OUT="FADE_OUT",e.FADE_IN_OUT="FADE_IN_OUT",e.SLIDE_IN_LEFT="SLIDE_IN_LEFT",e.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",e.SLIDE_IN_TOP="SLIDE_IN_TOP",e.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",e.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",e.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",e.SLIDE_OUT_TOP="SLIDE_OUT_TOP",e.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e.ZOOM_IN_OUT="ZOOM_IN_OUT",e.BOUNCE_IN="BOUNCE_IN",e.BOUNCE_OUT="BOUNCE_OUT",e.BOUNCE_IN_OUT="BOUNCE_IN_OUT",e.ELASTIC_IN="ELASTIC_IN",e.ELASTIC_OUT="ELASTIC_OUT",e.ELASTIC_IN_OUT="ELASTIC_IN_OUT",e.BACK_IN="BACK_IN",e.BACK_OUT="BACK_OUT",e.BACK_IN_OUT="BACK_IN_OUT",e.CIRCULAR_IN="CIRCULAR_IN",e.CIRCULAR_OUT="CIRCULAR_OUT",e.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",e.EXPO_IN="EXPO_IN",e.EXPO_OUT="EXPO_OUT",e.EXPO_IN_OUT="EXPO_IN_OUT",e.SINE_IN="SINE_IN",e.SINE_OUT="SINE_OUT",e.SINE_IN_OUT="SINE_IN_OUT",e.BOUNCE="BOUNCE",e.ELASTIC="ELASTIC",e.BACK="BACK",e.CIRCULAR="CIRCULAR",e.EXPO="EXPO",e.SINE="SINE",e))(fv||{}),dv=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e))(dv||{});Te.Animations=fv,Te.BlendModes=dv,Te.Events=Gn,Te.GsapPixieContext=us,Te.GsapPixieContextProvider=wE,Te.PixiAnimatedSprite=cv,Te.PixiAudioSprite=BO,Te.PixiGifSprite=TL,Te.PixiImageSprite=_C,Te.PixiSvgPathSprite=SO,Te.PixiTextSprite=CL,Te.PixiVideoSprite=kL,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
575
+ `);return k.insert(L,I.attributes)}return k.push(I)},new h.default)}n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=function(){function T(N,A){var E=[],O=!0,R=!1,C=void 0;try{for(var F=N[Symbol.iterator](),U;!(O=(U=F.next()).done)&&(E.push(U.value),!(A&&E.length===A));O=!0);}catch(D){R=!0,C=D}finally{try{!O&&F.return&&F.return()}finally{if(R)throw C}}return E}return function(N,A){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return T(N,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function T(N,A){for(var E=0;E<A.length;E++){var O=A[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,O.key,O)}}return function(N,A,E){return A&&T(N.prototype,A),E&&T(N,E),N}}(),o=i(0),l=y(o),h=i(21),c=y(h),f=i(11),u=y(f),d=i(8),p=y(d),v=i(10),g=y(v);function y(T){return T&&T.__esModule?T:{default:T}}function b(T){if(Array.isArray(T)){for(var N=0,A=Array(T.length);N<T.length;N++)A[N]=T[N];return A}else return Array.from(T)}function _(T,N){if(!(T instanceof N))throw new TypeError("Cannot call a class as a function")}var m=(0,g.default)("quill:selection"),x=function T(N){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_(this,T),this.index=N,this.length=A},S=function(){function T(N,A){var E=this;_(this,T),this.emitter=A,this.scroll=N,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new x(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){E.mouseDown||setTimeout(E.update.bind(E,p.default.sources.USER),1)}),this.emitter.on(p.default.events.EDITOR_CHANGE,function(O,R){O===p.default.events.TEXT_CHANGE&&R.length()>0&&E.update(p.default.sources.SILENT)}),this.emitter.on(p.default.events.SCROLL_BEFORE_UPDATE,function(){if(E.hasFocus()){var O=E.getNativeRange();O!=null&&O.start.node!==E.cursor.textNode&&E.emitter.once(p.default.events.SCROLL_UPDATE,function(){try{E.setNativeRange(O.start.node,O.start.offset,O.end.node,O.end.offset)}catch{}})}}),this.emitter.on(p.default.events.SCROLL_OPTIMIZE,function(O,R){if(R.range){var C=R.range,F=C.startNode,U=C.startOffset,D=C.endNode,z=C.endOffset;E.setNativeRange(F,U,D,z)}}),this.update(p.default.sources.SILENT)}return a(T,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var E=A.cursor.restore();if(!E)return;setTimeout(function(){A.setNativeRange(E.startNode,E.startOffset,E.endNode,E.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(p.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,E){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var O=this.getNativeRange();if(!(O==null||!O.native.collapsed||l.default.query(A,l.default.Scope.BLOCK))){if(O.start.node!==this.cursor.textNode){var R=l.default.find(O.start.node,!1);if(R==null)return;if(R instanceof l.default.Leaf){var C=R.split(O.start.offset);R.parent.insertBefore(this.cursor,C)}else R.insertBefore(this.cursor,O.start.node);this.cursor.attach()}this.cursor.format(A,E),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=this.scroll.length();A=Math.min(A,O-1),E=Math.min(A+E,O-1)-A;var R=void 0,C=this.scroll.leaf(A),F=s(C,2),U=F[0],D=F[1];if(U==null)return null;var z=U.position(D,!0),j=s(z,2);R=j[0],D=j[1];var k=document.createRange();if(E>0){k.setStart(R,D);var I=this.scroll.leaf(A+E),P=s(I,2);if(U=P[0],D=P[1],U==null)return null;var L=U.position(D,!0),G=s(L,2);return R=G[0],D=G[1],k.setEnd(R,D),k.getBoundingClientRect()}else{var $="left",M=void 0;return R instanceof Text?(D<R.data.length?(k.setStart(R,D),k.setEnd(R,D+1)):(k.setStart(R,D-1),k.setEnd(R,D),$="right"),M=k.getBoundingClientRect()):(M=U.domNode.getBoundingClientRect(),D>0&&($="right")),{bottom:M.top+M.height,height:M.height,left:M[$],right:M[$],top:M.top,width:0}}}},{key:"getNativeRange",value:function(){var A=document.getSelection();if(A==null||A.rangeCount<=0)return null;var E=A.getRangeAt(0);if(E==null)return null;var O=this.normalizeNative(E);return m.info("getNativeRange",O),O}},{key:"getRange",value:function(){var A=this.getNativeRange();if(A==null)return[null,null];var E=this.normalizedToRange(A);return[E,A]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(A){var E=this,O=[[A.start.node,A.start.offset]];A.native.collapsed||O.push([A.end.node,A.end.offset]);var R=O.map(function(U){var D=s(U,2),z=D[0],j=D[1],k=l.default.find(z,!0),I=k.offset(E.scroll);return j===0?I:k instanceof l.default.Container?I+k.length():I+k.index(z,j)}),C=Math.min(Math.max.apply(Math,b(R)),this.scroll.length()-1),F=Math.min.apply(Math,[C].concat(b(R)));return new x(F,C-F)}},{key:"normalizeNative",value:function(A){if(!w(this.root,A.startContainer)||!A.collapsed&&!w(this.root,A.endContainer))return null;var E={start:{node:A.startContainer,offset:A.startOffset},end:{node:A.endContainer,offset:A.endOffset},native:A};return[E.start,E.end].forEach(function(O){for(var R=O.node,C=O.offset;!(R instanceof Text)&&R.childNodes.length>0;)if(R.childNodes.length>C)R=R.childNodes[C],C=0;else if(R.childNodes.length===C)R=R.lastChild,C=R instanceof Text?R.data.length:R.childNodes.length+1;else break;O.node=R,O.offset=C}),E}},{key:"rangeToNative",value:function(A){var E=this,O=A.collapsed?[A.index]:[A.index,A.index+A.length],R=[],C=this.scroll.length();return O.forEach(function(F,U){F=Math.min(C-1,F);var D=void 0,z=E.scroll.leaf(F),j=s(z,2),k=j[0],I=j[1],P=k.position(I,U!==0),L=s(P,2);D=L[0],I=L[1],R.push(D,I)}),R.length<2&&(R=R.concat(R)),R}},{key:"scrollIntoView",value:function(A){var E=this.lastRange;if(E!=null){var O=this.getBounds(E.index,E.length);if(O!=null){var R=this.scroll.length()-1,C=this.scroll.line(Math.min(E.index,R)),F=s(C,1),U=F[0],D=U;if(E.length>0){var z=this.scroll.line(Math.min(E.index+E.length,R)),j=s(z,1);D=j[0]}if(!(U==null||D==null)){var k=A.getBoundingClientRect();O.top<k.top?A.scrollTop-=k.top-O.top:O.bottom>k.bottom&&(A.scrollTop+=O.bottom-k.bottom)}}}}},{key:"setNativeRange",value:function(A,E){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A,R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:E,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",A,E,O,R),!(A!=null&&(this.root.parentNode==null||A.parentNode==null||O.parentNode==null))){var F=document.getSelection();if(F!=null)if(A!=null){this.hasFocus()||this.root.focus();var U=(this.getNativeRange()||{}).native;if(U==null||C||A!==U.startContainer||E!==U.startOffset||O!==U.endContainer||R!==U.endOffset){A.tagName=="BR"&&(E=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode),O.tagName=="BR"&&(R=[].indexOf.call(O.parentNode.childNodes,O),O=O.parentNode);var D=document.createRange();D.setStart(A,E),D.setEnd(O,R),F.removeAllRanges(),F.addRange(D)}}else F.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof E=="string"&&(O=E,E=!1),m.info("setRange",A),A!=null){var R=this.rangeToNative(A);this.setNativeRange.apply(this,b(R).concat([E]))}else this.setNativeRange(null);this.update(O)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,E=this.lastRange,O=this.getRange(),R=s(O,2),C=R[0],F=R[1];if(this.lastRange=C,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(E,this.lastRange)){var U;!this.composing&&F!=null&&F.native.collapsed&&F.start.node!==this.cursor.textNode&&this.cursor.restore();var D=[p.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(E),A];if((U=this.emitter).emit.apply(U,[p.default.events.EDITOR_CHANGE].concat(D)),A!==p.default.sources.SILENT){var z;(z=this.emitter).emit.apply(z,D)}}}}]),T}();function w(T,N){try{N.parentNode}catch{return!1}return N instanceof Text&&(N=N.parentNode),T.contains(N)}n.Range=x,n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(0),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"insertInto",value:function(y,b){y.children.length===0?a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,y,b):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),v}(l.default.Embed);d.blotName="break",d.tagName="BR",n.default=d},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){f(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(44),o=i(30),l=i(1),h=function(f){s(u,f);function u(d){var p=f.call(this,d)||this;return p.build(),p}return u.prototype.appendChild=function(d){this.insertBefore(d)},u.prototype.attach=function(){f.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},u.prototype.build=function(){var d=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(p){try{var v=c(p);d.insertBefore(v,d.children.head||void 0)}catch(g){if(g instanceof l.ParchmentError)return;throw g}})},u.prototype.deleteAt=function(d,p){if(d===0&&p===this.length())return this.remove();this.children.forEachAt(d,p,function(v,g,y){v.deleteAt(g,y)})},u.prototype.descendant=function(d,p){var v=this.children.find(p),g=v[0],y=v[1];return d.blotName==null&&d(g)||d.blotName!=null&&g instanceof d?[g,y]:g instanceof u?g.descendant(d,y):[null,-1]},u.prototype.descendants=function(d,p,v){p===void 0&&(p=0),v===void 0&&(v=Number.MAX_VALUE);var g=[],y=v;return this.children.forEachAt(p,v,function(b,_,m){(d.blotName==null&&d(b)||d.blotName!=null&&b instanceof d)&&g.push(b),b instanceof u&&(g=g.concat(b.descendants(d,_,y))),y-=m}),g},u.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),f.prototype.detach.call(this)},u.prototype.formatAt=function(d,p,v,g){this.children.forEachAt(d,p,function(y,b,_){y.formatAt(b,_,v,g)})},u.prototype.insertAt=function(d,p,v){var g=this.children.find(d),y=g[0],b=g[1];if(y)y.insertAt(b,p,v);else{var _=v==null?l.create("text",p):l.create(p,v);this.appendChild(_)}},u.prototype.insertBefore=function(d,p){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(v){return d instanceof v}))throw new l.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,p)},u.prototype.length=function(){return this.children.reduce(function(d,p){return d+p.length()},0)},u.prototype.moveChildren=function(d,p){this.children.forEach(function(v){d.insertBefore(v,p)})},u.prototype.optimize=function(d){if(f.prototype.optimize.call(this,d),this.children.length===0)if(this.statics.defaultChild!=null){var p=l.create(this.statics.defaultChild);this.appendChild(p),p.optimize(d)}else this.remove()},u.prototype.path=function(d,p){p===void 0&&(p=!1);var v=this.children.find(d,p),g=v[0],y=v[1],b=[[this,d]];return g instanceof u?b.concat(g.path(y,p)):(g!=null&&b.push([g,y]),b)},u.prototype.removeChild=function(d){this.children.remove(d)},u.prototype.replace=function(d){d instanceof u&&d.moveChildren(this),f.prototype.replace.call(this,d)},u.prototype.split=function(d,p){if(p===void 0&&(p=!1),!p){if(d===0)return this;if(d===this.length())return this.next}var v=this.clone();return this.parent.insertBefore(v,this.next),this.children.forEachAt(d,this.length(),function(g,y,b){g=g.split(y,p),v.appendChild(g)}),v},u.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},u.prototype.update=function(d,p){var v=this,g=[],y=[];d.forEach(function(b){b.target===v.domNode&&b.type==="childList"&&(g.push.apply(g,b.addedNodes),y.push.apply(y,b.removedNodes))}),y.forEach(function(b){if(!(b.parentNode!=null&&b.tagName!=="IFRAME"&&document.body.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var _=l.find(b);_!=null&&(_.domNode.parentNode==null||_.domNode.parentNode===v.domNode)&&_.detach()}}),g.filter(function(b){return b.parentNode==v.domNode}).sort(function(b,_){return b===_?0:b.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(b){var _=null;b.nextSibling!=null&&(_=l.find(b.nextSibling));var m=c(b);(m.next!=_||m.next==null)&&(m.parent!=null&&m.parent.removeChild(v),v.insertBefore(m,_||void 0))})},u}(o.default);function c(f){var u=l.find(f);if(u==null)try{u=l.create(f)}catch{u=l.create(l.Scope.INLINE),[].slice.call(f.childNodes).forEach(function(p){u.domNode.appendChild(p)}),f.parentNode&&f.parentNode.replaceChild(u.domNode,f),u.attach()}return u}n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){f(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(31),l=i(17),h=i(1),c=function(f){s(u,f);function u(d){var p=f.call(this,d)||this;return p.attributes=new o.default(p.domNode),p}return u.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},u.prototype.format=function(d,p){var v=h.query(d);v instanceof a.default?this.attributes.attribute(v,p):p&&v!=null&&(d!==this.statics.blotName||this.formats()[d]!==p)&&this.replaceWith(d,p)},u.prototype.formats=function(){var d=this.attributes.values(),p=this.statics.formats(this.domNode);return p!=null&&(d[this.statics.blotName]=p),d},u.prototype.replaceWith=function(d,p){var v=f.prototype.replaceWith.call(this,d,p);return this.attributes.copy(v),v},u.prototype.update=function(d,p){var v=this;f.prototype.update.call(this,d,p),d.some(function(g){return g.target===v.domNode&&g.type==="attributes"})&&this.attributes.build()},u.prototype.wrap=function(d,p){var v=f.prototype.wrap.call(this,d,p);return v instanceof u&&v.statics.scope===this.statics.scope&&this.attributes.move(v),v},u}(l.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(30),o=i(1),l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.value=function(f){return!0},c.prototype.index=function(f,u){return this.domNode===f||this.domNode.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(u,1):-1},c.prototype.position=function(f,u){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return f>0&&(d+=1),[this.parent.domNode,d]},c.prototype.value=function(){var f;return f={},f[this.statics.blotName]=this.statics.value(this.domNode)||!0,f},c.scope=o.Scope.INLINE_BLOT,c}(a.default);n.default=l},function(r,n,i){var s=i(11),a=i(3),o={attributes:{compose:function(h,c,f){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var u=a(!0,{},c);f||(u=Object.keys(u).reduce(function(p,v){return u[v]!=null&&(p[v]=u[v]),p},{}));for(var d in h)h[d]!==void 0&&c[d]===void 0&&(u[d]=h[d]);return Object.keys(u).length>0?u:void 0},diff:function(h,c){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var f=Object.keys(h).concat(Object.keys(c)).reduce(function(u,d){return s(h[d],c[d])||(u[d]=c[d]===void 0?null:c[d]),u},{});return Object.keys(f).length>0?f:void 0},transform:function(h,c,f){if(typeof h!="object")return c;if(typeof c=="object"){if(!f)return c;var u=Object.keys(c).reduce(function(d,p){return h[p]===void 0&&(d[p]=c[p]),d},{});return Object.keys(u).length>0?u:void 0}}},iterator:function(h){return new l(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function l(h){this.ops=h,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(h){h||(h=1/0);var c=this.ops[this.index];if(c){var f=this.offset,u=o.length(c);if(h>=u-f?(h=u-f,this.index+=1,this.offset=0):this.offset+=h,typeof c.delete=="number")return{delete:h};var d={};return c.attributes&&(d.attributes=c.attributes),typeof c.retain=="number"?d.retain=h:typeof c.insert=="string"?d.insert=c.insert.substr(f,h):d.insert=c.insert,d}else return{retain:1/0}},l.prototype.peek=function(){return this.ops[this.index]},l.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},l.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},l.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,c=this.index,f=this.next(),u=this.ops.slice(this.index);return this.offset=h,this.index=c,[f].concat(u)}else return[]},r.exports=o},function(r,n){var i=function(){function s(v,g){return g!=null&&v instanceof g}var a;try{a=Map}catch{a=function(){}}var o;try{o=Set}catch{o=function(){}}var l;try{l=Promise}catch{l=function(){}}function h(v,g,y,b,_){typeof g=="object"&&(y=g.depth,b=g.prototype,_=g.includeNonEnumerable,g=g.circular);var m=[],x=[],S=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof y>"u"&&(y=1/0);function w(T,N){if(T===null)return null;if(N===0)return T;var A,E;if(typeof T!="object")return T;if(s(T,a))A=new a;else if(s(T,o))A=new o;else if(s(T,l))A=new l(function(k,I){T.then(function(P){k(w(P,N-1))},function(P){I(w(P,N-1))})});else if(h.__isArray(T))A=[];else if(h.__isRegExp(T))A=new RegExp(T.source,p(T)),T.lastIndex&&(A.lastIndex=T.lastIndex);else if(h.__isDate(T))A=new Date(T.getTime());else{if(S&&Buffer.isBuffer(T))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(T.length):A=new Buffer(T.length),T.copy(A),A;s(T,Error)?A=Object.create(T):typeof b>"u"?(E=Object.getPrototypeOf(T),A=Object.create(E)):(A=Object.create(b),E=b)}if(g){var O=m.indexOf(T);if(O!=-1)return x[O];m.push(T),x.push(A)}s(T,a)&&T.forEach(function(k,I){var P=w(I,N-1),L=w(k,N-1);A.set(P,L)}),s(T,o)&&T.forEach(function(k){var I=w(k,N-1);A.add(I)});for(var R in T){var C;E&&(C=Object.getOwnPropertyDescriptor(E,R)),!(C&&C.set==null)&&(A[R]=w(T[R],N-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(T),R=0;R<F.length;R++){var U=F[R],D=Object.getOwnPropertyDescriptor(T,U);D&&!D.enumerable&&!_||(A[U]=w(T[U],N-1),D.enumerable||Object.defineProperty(A,U,{enumerable:!1}))}if(_)for(var z=Object.getOwnPropertyNames(T),R=0;R<z.length;R++){var j=z[R],D=Object.getOwnPropertyDescriptor(T,j);D&&D.enumerable||(A[j]=w(T[j],N-1),Object.defineProperty(A,j,{enumerable:!1}))}return A}return w(v,y)}h.clonePrototype=function(g){if(g===null)return null;var y=function(){};return y.prototype=g,new y};function c(v){return Object.prototype.toString.call(v)}h.__objToStr=c;function f(v){return typeof v=="object"&&c(v)==="[object Date]"}h.__isDate=f;function u(v){return typeof v=="object"&&c(v)==="[object Array]"}h.__isArray=u;function d(v){return typeof v=="object"&&c(v)==="[object RegExp]"}h.__isRegExp=d;function p(v){var g="";return v.global&&(g+="g"),v.ignoreCase&&(g+="i"),v.multiline&&(g+="m"),g}return h.__getRegExpFlags=p,h}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(E,O){var R=[],C=!0,F=!1,U=void 0;try{for(var D=E[Symbol.iterator](),z;!(C=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));C=!0);}catch(j){F=!0,U=j}finally{try{!C&&D.return&&D.return()}finally{if(F)throw U}}return R}return function(E,O){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return A(E,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function A(E,O){for(var R=0;R<O.length;R++){var C=O[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(E,C.key,C)}}return function(E,O,R){return O&&A(E.prototype,O),R&&A(E,R),E}}(),o=function A(E,O,R){E===null&&(E=Function.prototype);var C=Object.getOwnPropertyDescriptor(E,O);if(C===void 0){var F=Object.getPrototypeOf(E);return F===null?void 0:A(F,O,R)}else{if("value"in C)return C.value;var U=C.get;return U===void 0?void 0:U.call(R)}},l=i(0),h=m(l),c=i(8),f=m(c),u=i(4),d=m(u),p=i(16),v=m(p),g=i(13),y=m(g),b=i(25),_=m(b);function m(A){return A&&A.__esModule?A:{default:A}}function x(A,E){if(!(A instanceof E))throw new TypeError("Cannot call a class as a function")}function S(A,E){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:A}function w(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);A.prototype=Object.create(E&&E.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(A,E):A.__proto__=E)}function T(A){return A instanceof d.default||A instanceof u.BlockEmbed}var N=function(A){w(E,A);function E(O,R){x(this,E);var C=S(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,O));return C.emitter=R.emitter,Array.isArray(R.whitelist)&&(C.whitelist=R.whitelist.reduce(function(F,U){return F[U]=!0,F},{})),C.domNode.addEventListener("DOMNodeInserted",function(){}),C.optimize(),C.enable(),C}return a(E,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(R,C){var F=this.line(R),U=s(F,2),D=U[0],z=U[1],j=this.line(R+C),k=s(j,1),I=k[0];if(o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"deleteAt",this).call(this,R,C),I!=null&&D!==I&&z>0){if(D instanceof u.BlockEmbed||I instanceof u.BlockEmbed){this.optimize();return}if(D instanceof y.default){var P=D.newlineIndex(D.length(),!0);if(P>-1&&(D=D.split(P+1),D===I)){this.optimize();return}}else if(I instanceof y.default){var L=I.newlineIndex(0);L>-1&&I.split(L+1)}var G=I.children.head instanceof v.default?null:I.children.head;D.moveChildren(I,G),D.remove()}this.optimize()}},{key:"enable",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",R)}},{key:"formatAt",value:function(R,C,F,U){this.whitelist!=null&&!this.whitelist[F]||(o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,R,C,F,U),this.optimize())}},{key:"insertAt",value:function(R,C,F){if(!(F!=null&&this.whitelist!=null&&!this.whitelist[C])){if(R>=this.length())if(F==null||h.default.query(C,h.default.Scope.BLOCK)==null){var U=h.default.create(this.statics.defaultChild);this.appendChild(U),F==null&&C.endsWith(`
576
+ `)&&(C=C.slice(0,-1)),U.insertAt(0,C,F)}else{var D=h.default.create(C,F);this.appendChild(D)}else o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,R,C,F);this.optimize()}}},{key:"insertBefore",value:function(R,C){if(R.statics.scope===h.default.Scope.INLINE_BLOT){var F=h.default.create(this.statics.defaultChild);F.appendChild(R),R=F}o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertBefore",this).call(this,R,C)}},{key:"leaf",value:function(R){return this.path(R).pop()||[null,-1]}},{key:"line",value:function(R){return R===this.length()?this.line(R-1):this.descendant(T,R)}},{key:"lines",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,F=function U(D,z,j){var k=[],I=j;return D.children.forEachAt(z,j,function(P,L,G){T(P)?k.push(P):P instanceof h.default.Container&&(k=k.concat(U(P,L,I))),I-=G}),k};return F(this,R,C)}},{key:"optimize",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,R,C),R.length>0&&this.emitter.emit(f.default.events.SCROLL_OPTIMIZE,R,C))}},{key:"path",value:function(R){return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"path",this).call(this,R).slice(1)}},{key:"update",value:function(R){if(this.batch!==!0){var C=f.default.sources.USER;typeof R=="string"&&(C=R),Array.isArray(R)||(R=this.observer.takeRecords()),R.length>0&&this.emitter.emit(f.default.events.SCROLL_BEFORE_UPDATE,C,R),o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"update",this).call(this,R.concat([])),R.length>0&&this.emitter.emit(f.default.events.SCROLL_UPDATE,C,R)}}}]),E}(h.default.Scroll);N.blotName="scroll",N.className="ql-editor",N.tagName="DIV",N.defaultChild="block",N.allowedChildren=[d.default,u.BlockEmbed,_.default],n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},a=function(){function M(B,q){var H=[],X=!0,K=!1,et=void 0;try{for(var it=B[Symbol.iterator](),ot;!(X=(ot=it.next()).done)&&(H.push(ot.value),!(q&&H.length===q));X=!0);}catch(ht){K=!0,et=ht}finally{try{!X&&it.return&&it.return()}finally{if(K)throw et}}return H}return function(B,q){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return M(B,q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(B,q){for(var H=0;H<q.length;H++){var X=q[H];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(B,X.key,X)}}return function(B,q,H){return q&&M(B.prototype,q),H&&M(B,H),B}}(),l=i(21),h=A(l),c=i(11),f=A(c),u=i(3),d=A(u),p=i(2),v=A(p),g=i(20),y=A(g),b=i(0),_=A(b),m=i(5),x=A(m),S=i(10),w=A(S),T=i(9),N=A(T);function A(M){return M&&M.__esModule?M:{default:M}}function E(M,B,q){return B in M?Object.defineProperty(M,B,{value:q,enumerable:!0,configurable:!0,writable:!0}):M[B]=q,M}function O(M,B){if(!(M instanceof B))throw new TypeError("Cannot call a class as a function")}function R(M,B){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:M}function C(M,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);M.prototype=Object.create(B&&B.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(M,B):M.__proto__=B)}var F=(0,w.default)("quill:keyboard"),U=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",D=function(M){C(B,M),o(B,null,[{key:"match",value:function(H,X){return X=$(X),["altKey","ctrlKey","metaKey","shiftKey"].some(function(K){return!!X[K]!==H[K]&&X[K]!==null})?!1:X.key===(H.which||H.keyCode)}}]);function B(q,H){O(this,B);var X=R(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,H));return X.bindings={},Object.keys(X.options.bindings).forEach(function(K){K==="list autofill"&&q.scroll.whitelist!=null&&!q.scroll.whitelist.list||X.options.bindings[K]&&X.addBinding(X.options.bindings[K])}),X.addBinding({key:B.keys.ENTER,shiftKey:null},P),X.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0},k)):(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},k)),X.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},I),X.addBinding({key:B.keys.DELETE},{collapsed:!1},I),X.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),X.listen(),X}return o(B,[{key:"addBinding",value:function(H){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},et=$(H);if(et==null||et.key==null)return F.warn("Attempted to add invalid keyboard binding",et);typeof X=="function"&&(X={handler:X}),typeof K=="function"&&(K={handler:K}),et=(0,d.default)(et,X,K),this.bindings[et.key]=this.bindings[et.key]||[],this.bindings[et.key].push(et)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(X){if(!X.defaultPrevented){var K=X.which||X.keyCode,et=(H.bindings[K]||[]).filter(function(Tt){return B.match(X,Tt)});if(et.length!==0){var it=H.quill.getSelection();if(!(it==null||!H.quill.hasFocus())){var ot=H.quill.getLine(it.index),ht=a(ot,2),Ct=ht[0],It=ht[1],V=H.quill.getLeaf(it.index),W=a(V,2),Q=W[0],tt=W[1],Y=it.length===0?[Q,tt]:H.quill.getLeaf(it.index+it.length),ct=a(Y,2),Z=ct[0],at=ct[1],St=Q instanceof _.default.Text?Q.value().slice(0,tt):"",Ht=Z instanceof _.default.Text?Z.value().slice(at):"",_t={collapsed:it.length===0,empty:it.length===0&&Ct.length()<=1,format:H.quill.getFormat(it),offset:It,prefix:St,suffix:Ht},Et=et.some(function(Tt){if(Tt.collapsed!=null&&Tt.collapsed!==_t.collapsed||Tt.empty!=null&&Tt.empty!==_t.empty||Tt.offset!=null&&Tt.offset!==_t.offset)return!1;if(Array.isArray(Tt.format)){if(Tt.format.every(function(Bt){return _t.format[Bt]==null}))return!1}else if(s(Tt.format)==="object"&&!Object.keys(Tt.format).every(function(Bt){return Tt.format[Bt]===!0?_t.format[Bt]!=null:Tt.format[Bt]===!1?_t.format[Bt]==null:(0,f.default)(Tt.format[Bt],_t.format[Bt])}))return!1;return Tt.prefix!=null&&!Tt.prefix.test(_t.prefix)||Tt.suffix!=null&&!Tt.suffix.test(_t.suffix)?!1:Tt.handler.call(H,it,_t)!==!0});Et&&X.preventDefault()}}}})}}]),B}(N.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:G("bold"),italic:G("italic"),underline:G("underline"),indent:{key:D.keys.TAB,format:["blockquote","indent","list"],handler:function(B,q){if(q.collapsed&&q.offset!==0)return!0;this.quill.format("indent","+1",x.default.sources.USER)}},outdent:{key:D.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(B,q){if(q.collapsed&&q.offset!==0)return!0;this.quill.format("indent","-1",x.default.sources.USER)}},"outdent backspace":{key:D.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(B,q){q.format.indent!=null?this.quill.format("indent","-1",x.default.sources.USER):q.format.list!=null&&this.quill.format("list",!1,x.default.sources.USER)}},"indent code-block":L(!0),"outdent code-block":L(!1),"remove tab":{key:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(B){this.quill.deleteText(B.index-1,1,x.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(B){this.quill.history.cutoff();var q=new v.default().retain(B.index).delete(B.length).insert(" ");this.quill.updateContents(q,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index+1,x.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(B,q){this.quill.format("list",!1,x.default.sources.USER),q.format.indent&&this.quill.format("indent",!1,x.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(B){var q=this.quill.getLine(B.index),H=a(q,2),X=H[0],K=H[1],et=(0,d.default)({},X.formats(),{list:"checked"}),it=new v.default().retain(B.index).insert(`
577
+ `,et).retain(X.length()-K-1).retain(1,{list:"unchecked"});this.quill.updateContents(it,x.default.sources.USER),this.quill.setSelection(B.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(B,q){var H=this.quill.getLine(B.index),X=a(H,2),K=X[0],et=X[1],it=new v.default().retain(B.index).insert(`
578
+ `,q.format).retain(K.length()-et-1).retain(1,{header:null});this.quill.updateContents(it,x.default.sources.USER),this.quill.setSelection(B.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(B,q){var H=q.prefix.length,X=this.quill.getLine(B.index),K=a(X,2),et=K[0],it=K[1];if(it>H)return!0;var ot=void 0;switch(q.prefix.trim()){case"[]":case"[ ]":ot="unchecked";break;case"[x]":ot="checked";break;case"-":case"*":ot="bullet";break;default:ot="ordered"}this.quill.insertText(B.index," ",x.default.sources.USER),this.quill.history.cutoff();var ht=new v.default().retain(B.index-it).delete(H+1).retain(et.length()-2-it).retain(1,{list:ot});this.quill.updateContents(ht,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index-H,x.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(B){var q=this.quill.getLine(B.index),H=a(q,2),X=H[0],K=H[1],et=new v.default().retain(B.index+X.length()-K-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(et,x.default.sources.USER)}},"embed left":z(D.keys.LEFT,!1),"embed left shift":z(D.keys.LEFT,!0),"embed right":z(D.keys.RIGHT,!1),"embed right shift":z(D.keys.RIGHT,!0)}};function z(M,B){var q,H=M===D.keys.LEFT?"prefix":"suffix";return q={key:M,shiftKey:B,altKey:null},E(q,H,/^$/),E(q,"handler",function(K){var et=K.index;M===D.keys.RIGHT&&(et+=K.length+1);var it=this.quill.getLeaf(et),ot=a(it,1),ht=ot[0];return ht instanceof _.default.Embed?(M===D.keys.LEFT?B?this.quill.setSelection(K.index-1,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index-1,x.default.sources.USER):B?this.quill.setSelection(K.index,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index+K.length+1,x.default.sources.USER),!1):!0}),q}function j(M,B){if(!(M.index===0||this.quill.getLength()<=1)){var q=this.quill.getLine(M.index),H=a(q,1),X=H[0],K={};if(B.offset===0){var et=this.quill.getLine(M.index-1),it=a(et,1),ot=it[0];if(ot!=null&&ot.length()>1){var ht=X.formats(),Ct=this.quill.getFormat(M.index-1,1);K=y.default.attributes.diff(ht,Ct)||{}}}var It=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText(M.index-It,It,x.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine(M.index-It,It,K,x.default.sources.USER),this.quill.focus()}}function k(M,B){var q=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(B.suffix)?2:1;if(!(M.index>=this.quill.getLength()-q)){var H={},X=0,K=this.quill.getLine(M.index),et=a(K,1),it=et[0];if(B.offset>=it.length()-1){var ot=this.quill.getLine(M.index+1),ht=a(ot,1),Ct=ht[0];if(Ct){var It=it.formats(),V=this.quill.getFormat(M.index,1);H=y.default.attributes.diff(It,V)||{},X=Ct.length()}}this.quill.deleteText(M.index,q,x.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(M.index+X-1,q,H,x.default.sources.USER)}}function I(M){var B=this.quill.getLines(M),q={};if(B.length>1){var H=B[0].formats(),X=B[B.length-1].formats();q=y.default.attributes.diff(X,H)||{}}this.quill.deleteText(M,x.default.sources.USER),Object.keys(q).length>0&&this.quill.formatLine(M.index,1,q,x.default.sources.USER),this.quill.setSelection(M.index,x.default.sources.SILENT),this.quill.focus()}function P(M,B){var q=this;M.length>0&&this.quill.scroll.deleteAt(M.index,M.length);var H=Object.keys(B.format).reduce(function(X,K){return _.default.query(K,_.default.Scope.BLOCK)&&!Array.isArray(B.format[K])&&(X[K]=B.format[K]),X},{});this.quill.insertText(M.index,`
579
+ `,H,x.default.sources.USER),this.quill.setSelection(M.index+1,x.default.sources.SILENT),this.quill.focus(),Object.keys(B.format).forEach(function(X){H[X]==null&&(Array.isArray(B.format[X])||X!=="link"&&q.quill.format(X,B.format[X],x.default.sources.USER))})}function L(M){return{key:D.keys.TAB,shiftKey:!M,format:{"code-block":!0},handler:function(q){var H=_.default.query("code-block"),X=q.index,K=q.length,et=this.quill.scroll.descendant(H,X),it=a(et,2),ot=it[0],ht=it[1];if(ot!=null){var Ct=this.quill.getIndex(ot),It=ot.newlineIndex(ht,!0)+1,V=ot.newlineIndex(Ct+ht+K),W=ot.domNode.textContent.slice(It,V).split(`
580
+ `);ht=0,W.forEach(function(Q,tt){M?(ot.insertAt(It+ht,H.TAB),ht+=H.TAB.length,tt===0?X+=H.TAB.length:K+=H.TAB.length):Q.startsWith(H.TAB)&&(ot.deleteAt(It+ht,H.TAB.length),ht-=H.TAB.length,tt===0?X-=H.TAB.length:K-=H.TAB.length),ht+=Q.length+1}),this.quill.update(x.default.sources.USER),this.quill.setSelection(X,K,x.default.sources.SILENT)}}}}function G(M){return{key:M[0].toUpperCase(),shortKey:!0,handler:function(q,H){this.quill.format(M,!H.format[M],x.default.sources.USER)}}}function $(M){if(typeof M=="string"||typeof M=="number")return $({key:M});if((typeof M>"u"?"undefined":s(M))==="object"&&(M=(0,h.default)(M,!1)),typeof M.key=="string")if(D.keys[M.key.toUpperCase()]!=null)M.key=D.keys[M.key.toUpperCase()];else if(M.key.length===1)M.key=M.key.toUpperCase().charCodeAt(0);else return null;return M.shortKey&&(M[U]=M.shortKey,delete M.shortKey),M}n.default=D,n.SHORTKEY=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function y(b,_){var m=[],x=!0,S=!1,w=void 0;try{for(var T=b[Symbol.iterator](),N;!(x=(N=T.next()).done)&&(m.push(N.value),!(_&&m.length===_));x=!0);}catch(A){S=!0,w=A}finally{try{!x&&T.return&&T.return()}finally{if(S)throw w}}return m}return function(b,_){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return y(b,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=function(){function y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),l=i(0),h=u(l),c=i(7),f=u(c);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function p(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function v(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var g=function(y){v(b,y),o(b,null,[{key:"value",value:function(){}}]);function b(_,m){d(this,b);var x=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return x.selection=m,x.textNode=document.createTextNode(b.CONTENTS),x.domNode.appendChild(x.textNode),x._length=0,x}return o(b,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,x){if(this._length!==0)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,m,x);for(var S=this,w=0;S!=null&&S.statics.scope!==h.default.Scope.BLOCK_BLOT;)w+=S.offset(S.parent),S=S.parent;S!=null&&(this._length=b.CONTENTS.length,S.optimize(),S.formatAt(w,b.CONTENTS.length,m,x),this._length=0)}},{key:"index",value:function(m,x){return m===this.textNode?0:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,m,x)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var m=this.textNode,x=this.selection.getNativeRange(),S=void 0,w=void 0,T=void 0;if(x!=null&&x.start.node===m&&x.end.node===m){var N=[m,x.start.offset,x.end.offset];S=N[0],w=N[1],T=N[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==b.CONTENTS){var A=this.textNode.data.split(b.CONTENTS).join("");this.next instanceof f.default?(S=this.next.domNode,this.next.insertAt(0,A),this.textNode.data=b.CONTENTS):(this.textNode.data=A,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(b.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),w!=null){var E=[w,T].map(function(R){return Math.max(0,Math.min(S.data.length,R-1))}),O=s(E,2);return w=O[0],T=O[1],{startNode:S,startOffset:w,endNode:S,endOffset:T}}}}},{key:"update",value:function(m,x){var S=this;if(m.some(function(T){return T.type==="characterData"&&T.target===S.textNode})){var w=this.restore();w&&(x.range=w)}}},{key:"value",value:function(){return""}}]),b}(h.default.Embed);g.blotName="cursor",g.className="ql-cursor",g.tagName="span",g.CONTENTS="\uFEFF",n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=h(s),o=i(4),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default.Container);d.allowedChildren=[l.default,o.BlockEmbed,d],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(0),l=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function c(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function f(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function u(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var d=function(g){u(y,g);function y(){return c(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"value",value:function(_){var m=a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,_);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(x){return("00"+parseInt(x).toString(16)).slice(-2)}).join("")):m}}]),y}(l.default.Attributor.Style),p=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),v=new d("color","color",{scope:l.default.Scope.INLINE});n.ColorAttributor=d,n.ColorClass=p,n.ColorStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=function(){function v(g,y){for(var b=0;b<y.length;b++){var _=y[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,y,b){return y&&v(g.prototype,y),b&&v(g,b),g}}(),a=function v(g,y,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,y);if(_===void 0){var m=Object.getPrototypeOf(g);return m===null?void 0:v(m,y,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(6),l=h(o);function h(v){return v&&v.__esModule?v:{default:v}}function c(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function f(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function u(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var d=function(v){u(g,v);function g(){return c(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"format",value:function(b,_){if(b!==this.statics.blotName||!_)return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,b,_);_=this.constructor.sanitize(_),this.domNode.setAttribute("href",_)}}],[{key:"create",value:function(b){var _=a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,b);return b=this.sanitize(b),_.setAttribute("href",b),_.setAttribute("rel","noopener noreferrer"),_.setAttribute("target","_blank"),_}},{key:"formats",value:function(b){return b.getAttribute("href")}},{key:"sanitize",value:function(b){return p(b,this.PROTOCOL_WHITELIST)?b:this.SANITIZED_URL}}]),g}(l.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function p(v,g){var y=document.createElement("a");y.href=v;var b=y.href.slice(0,y.href.indexOf(":"));return g.indexOf(b)>-1}n.default=d,n.sanitize=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},a=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),o=i(23),l=f(o),h=i(107),c=f(h);function f(g){return g&&g.__esModule?g:{default:g}}function u(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}var d=0;function p(g,y){g.setAttribute(y,g.getAttribute(y)!=="true")}var v=function(){function g(y){var b=this;u(this,g),this.select=y,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){b.togglePicker()}),this.label.addEventListener("keydown",function(_){switch(_.keyCode){case l.default.keys.ENTER:b.togglePicker();break;case l.default.keys.ESCAPE:b.escape(),_.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(g,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),p(this.label,"aria-expanded"),p(this.options,"aria-hidden")}},{key:"buildItem",value:function(b){var _=this,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),b.hasAttribute("value")&&m.setAttribute("data-value",b.getAttribute("value")),b.textContent&&m.setAttribute("data-label",b.textContent),m.addEventListener("click",function(){_.selectItem(m,!0)}),m.addEventListener("keydown",function(x){switch(x.keyCode){case l.default.keys.ENTER:_.selectItem(m,!0),x.preventDefault();break;case l.default.keys.ESCAPE:_.escape(),x.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var b=document.createElement("span");return b.classList.add("ql-picker-label"),b.innerHTML=c.default,b.tabIndex="0",b.setAttribute("role","button"),b.setAttribute("aria-expanded","false"),this.container.appendChild(b),b}},{key:"buildOptions",value:function(){var b=this,_=document.createElement("span");_.classList.add("ql-picker-options"),_.setAttribute("aria-hidden","true"),_.tabIndex="-1",_.id="ql-picker-options-"+d,d+=1,this.label.setAttribute("aria-controls",_.id),this.options=_,[].slice.call(this.select.options).forEach(function(m){var x=b.buildItem(m);_.appendChild(x),m.selected===!0&&b.selectItem(x)}),this.container.appendChild(_)}},{key:"buildPicker",value:function(){var b=this;[].slice.call(this.select.attributes).forEach(function(_){b.container.setAttribute(_.name,_.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var b=this;this.close(),setTimeout(function(){return b.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=this.container.querySelector(".ql-selected");if(b!==m&&(m!=null&&m.classList.remove("ql-selected"),b!=null&&(b.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(b.parentNode.children,b),b.hasAttribute("data-value")?this.label.setAttribute("data-value",b.getAttribute("data-value")):this.label.removeAttribute("data-value"),b.hasAttribute("data-label")?this.label.setAttribute("data-label",b.getAttribute("data-label")):this.label.removeAttribute("data-label"),_))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var x=document.createEvent("Event");x.initEvent("change",!0,!0),this.select.dispatchEvent(x)}this.close()}}},{key:"update",value:function(){var b=void 0;if(this.select.selectedIndex>-1){var _=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];b=this.select.options[this.select.selectedIndex],this.selectItem(_)}else this.selectItem(null);var m=b!=null&&b!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),g}();n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=F(s),o=i(5),l=F(o),h=i(4),c=F(h),f=i(16),u=F(f),d=i(25),p=F(d),v=i(24),g=F(v),y=i(35),b=F(y),_=i(6),m=F(_),x=i(22),S=F(x),w=i(7),T=F(w),N=i(55),A=F(N),E=i(42),O=F(E),R=i(23),C=F(R);function F(U){return U&&U.__esModule?U:{default:U}}l.default.register({"blots/block":c.default,"blots/block/embed":h.BlockEmbed,"blots/break":u.default,"blots/container":p.default,"blots/cursor":g.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":S.default,"blots/text":T.default,"modules/clipboard":A.default,"modules/history":O.default,"modules/keyboard":C.default}),a.default.register(c.default,u.default,g.default,m.default,S.default,T.default),n.default=l.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(l){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?h=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?h=document.createElement(l):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},o.prototype.deleteAt=function(l,h){var c=this.isolate(l,h);c.remove()},o.prototype.formatAt=function(l,h,c,f){var u=this.isolate(l,h);if(s.query(c,s.Scope.BLOT)!=null&&f)u.wrap(c,f);else if(s.query(c,s.Scope.ATTRIBUTE)!=null){var d=s.create(this.statics.scope);u.wrap(d),d.format(c,f)}},o.prototype.insertAt=function(l,h,c){var f=c==null?s.create("text",h):s.create(h,c),u=this.split(l);this.parent.insertBefore(f,u)},o.prototype.insertInto=function(l,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var c=null;l.children.insertBefore(this,h),h!=null&&(c=h.domNode),(this.domNode.parentNode!=l.domNode||this.domNode.nextSibling!=c)&&l.domNode.insertBefore(this.domNode,c),this.parent=l,this.attach()},o.prototype.isolate=function(l,h){var c=this.split(l);return c.split(h),c},o.prototype.length=function(){return 1},o.prototype.offset=function(l){return l===void 0&&(l=this.parent),this.parent==null||this==l?0:this.parent.children.offset(this)+this.parent.offset(l)},o.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},o.prototype.replaceWith=function(l,h){var c=typeof l=="string"?s.create(l,h):l;return c.replace(this),c},o.prototype.split=function(l,h){return l===0?this:this.next},o.prototype.update=function(l,h){},o.prototype.wrap=function(l,h){var c=typeof l=="string"?s.create(l,h):l;return this.parent!=null&&this.parent.insertBefore(c,this.next),c.appendChild(this),c},o.blotName="abstract",o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),a=i(32),o=i(33),l=i(1),h=function(){function c(f){this.attributes={},this.domNode=f,this.build()}return c.prototype.attribute=function(f,u){u?f.add(this.domNode,u)&&(f.value(this.domNode)!=null?this.attributes[f.attrName]=f:delete this.attributes[f.attrName]):(f.remove(this.domNode),delete this.attributes[f.attrName])},c.prototype.build=function(){var f=this;this.attributes={};var u=s.default.keys(this.domNode),d=a.default.keys(this.domNode),p=o.default.keys(this.domNode);u.concat(d).concat(p).forEach(function(v){var g=l.query(v,l.Scope.ATTRIBUTE);g instanceof s.default&&(f.attributes[g.attrName]=g)})},c.prototype.copy=function(f){var u=this;Object.keys(this.attributes).forEach(function(d){var p=u.attributes[d].value(u.domNode);f.format(d,p)})},c.prototype.move=function(f){var u=this;this.copy(f),Object.keys(this.attributes).forEach(function(d){u.attributes[d].remove(u.domNode)}),this.attributes={}},c.prototype.values=function(){var f=this;return Object.keys(this.attributes).reduce(function(u,d){return u[d]=f.attributes[d].value(f.domNode),u},{})},c}();n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h,c){var f=h.getAttribute("class")||"";return f.split(/\s+/).filter(function(u){return u.indexOf(c+"-")===0})}var l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(f){return(f.getAttribute("class")||"").split(/\s+/).map(function(u){return u.split("-").slice(0,-1).join("-")})},c.prototype.add=function(f,u){return this.canAdd(f,u)?(this.remove(f),f.classList.add(this.keyName+"-"+u),!0):!1},c.prototype.remove=function(f){var u=o(f,this.keyName);u.forEach(function(d){f.classList.remove(d)}),f.classList.length===0&&f.removeAttribute("class")},c.prototype.value=function(f){var u=o(f,this.keyName)[0]||"",d=u.slice(this.keyName.length+1);return this.canAdd(f,d)?d:""},c}(a.default);n.default=l},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h){var c=h.split("-"),f=c.slice(1).map(function(u){return u[0].toUpperCase()+u.slice(1)}).join("");return c[0]+f}var l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(f){return(f.getAttribute("style")||"").split(";").map(function(u){var d=u.split(":");return d[0].trim()})},c.prototype.add=function(f,u){return this.canAdd(f,u)?(f.style[o(this.keyName)]=u,!0):!1},c.prototype.remove=function(f){f.style[o(this.keyName)]="",f.getAttribute("style")||f.removeAttribute("style")},c.prototype.value=function(f){var u=f.style[o(this.keyName)];return this.canAdd(f,u)?u:""},c}(a.default);n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(h,c){for(var f=0;f<c.length;f++){var u=c[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}return function(h,c,f){return c&&l(h.prototype,c),f&&l(h,f),h}}();function a(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(h,c){a(this,l),this.quill=h,this.options=c,this.modules={}}return s(l,[{key:"init",value:function(){var c=this;Object.keys(this.options.modules).forEach(function(f){c.modules[f]==null&&c.addModule(f)})}},{key:"addModule",value:function(c){var f=this.quill.constructor.import("modules/"+c);return this.modules[c]=new f(this.quill,this.options.modules[c]||{}),this.modules[c]}}]),l}();o.DEFAULTS={modules:{}},o.themes={default:o},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=i(0),l=f(o),h=i(7),c=f(h);function f(y){return y&&y.__esModule?y:{default:y}}function u(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function d(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function p(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var v="\uFEFF",g=function(y){p(b,y);function b(_){u(this,b);var m=d(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(x){m.contentNode.appendChild(x)}),m.leftGuard=document.createTextNode(v),m.rightGuard=document.createTextNode(v),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return s(b,[{key:"index",value:function(m,x){return m===this.leftGuard?0:m===this.rightGuard?1:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,m,x)}},{key:"restore",value:function(m){var x=void 0,S=void 0,w=m.data.split(v).join("");if(m===this.leftGuard)if(this.prev instanceof c.default){var T=this.prev.length();this.prev.insertAt(T,w),x={startNode:this.prev.domNode,startOffset:T+w.length}}else S=document.createTextNode(w),this.parent.insertBefore(l.default.create(S),this),x={startNode:S,startOffset:w.length};else m===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,w),x={startNode:this.next.domNode,startOffset:w.length}):(S=document.createTextNode(w),this.parent.insertBefore(l.default.create(S),this.next),x={startNode:S,startOffset:w.length}));return m.data=v,x}},{key:"update",value:function(m,x){var S=this;m.forEach(function(w){if(w.type==="characterData"&&(w.target===S.leftGuard||w.target===S.rightGuard)){var T=S.restore(w.target);T&&(x.range=T)}})}}]),b}(l.default.Embed);n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}var l={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new a.default.Attributor.Attribute("align","align",l),c=new a.default.Attributor.Class("align","ql-align",l),f=new a.default.Attributor.Style("align","text-align",l);n.AlignAttribute=h,n.AlignClass=c,n.AlignStyle=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var s=i(0),a=l(s),o=i(26);function l(f){return f&&f.__esModule?f:{default:f}}var h=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),c=new o.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});n.BackgroundClass=h,n.BackgroundStyle=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}var l={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},h=new a.default.Attributor.Attribute("direction","dir",l),c=new a.default.Attributor.Class("direction","ql-direction",l),f=new a.default.Attributor.Style("direction","direction",l);n.DirectionAttribute=h,n.DirectionClass=c,n.DirectionStyle=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=function(){function y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=i(0),l=h(o);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function f(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function u(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var d={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},p=new l.default.Attributor.Class("font","ql-font",d),v=function(y){u(b,y);function b(){return c(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"value",value:function(m){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),b}(l.default.Attributor.Style),g=new v("font","font-family",d);n.FontStyle=g,n.FontClass=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var s=i(0),a=o(s);function o(c){return c&&c.__esModule?c:{default:c}}var l=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=l,n.SizeStyle=h},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var s=function(){function _(m,x){for(var S=0;S<x.length;S++){var w=x[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),a=i(0),o=u(a),l=i(5),h=u(l),c=i(9),f=u(c);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,m){if(!(_ instanceof m))throw new TypeError("Cannot call a class as a function")}function p(_,m){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:_}function v(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);_.prototype=Object.create(m&&m.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(_,m):_.__proto__=m)}var g=function(_){v(m,_);function m(x,S){d(this,m);var w=p(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x,S));return w.lastRecorded=0,w.ignoreChange=!1,w.clear(),w.quill.on(h.default.events.EDITOR_CHANGE,function(T,N,A,E){T!==h.default.events.TEXT_CHANGE||w.ignoreChange||(!w.options.userOnly||E===h.default.sources.USER?w.record(N,A):w.transform(N))}),w.quill.keyboard.addBinding({key:"Z",shortKey:!0},w.undo.bind(w)),w.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},w.redo.bind(w)),/Win/i.test(navigator.platform)&&w.quill.keyboard.addBinding({key:"Y",shortKey:!0},w.redo.bind(w)),w}return s(m,[{key:"change",value:function(S,w){if(this.stack[S].length!==0){var T=this.stack[S].pop();this.stack[w].push(T),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(T[S],h.default.sources.USER),this.ignoreChange=!1;var N=b(T[S]);this.quill.setSelection(N)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(S,w){if(S.ops.length!==0){this.stack.redo=[];var T=this.quill.getContents().diff(w),N=Date.now();if(this.lastRecorded+this.options.delay>N&&this.stack.undo.length>0){var A=this.stack.undo.pop();T=T.compose(A.undo),S=A.redo.compose(S)}else this.lastRecorded=N;this.stack.undo.push({redo:S,undo:T}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(S){this.stack.undo.forEach(function(w){w.undo=S.transform(w.undo,!0),w.redo=S.transform(w.redo,!0)}),this.stack.redo.forEach(function(w){w.undo=S.transform(w.undo,!0),w.redo=S.transform(w.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(f.default);g.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(_){var m=_.ops[_.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
581
+ `):m.attributes!=null?Object.keys(m.attributes).some(function(x){return o.default.query(x,o.default.Scope.BLOCK)!=null}):!1}function b(_){var m=_.reduce(function(S,w){return S+=w.delete||0,S},0),x=_.length()-m;return y(_)&&(x-=1),x}n.default=g,n.getLastChangeIndex=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=function(){function P(L,G){for(var $=0;$<G.length;$++){var M=G[$];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(L,M.key,M)}}return function(L,G,$){return G&&P(L.prototype,G),$&&P(L,$),L}}(),a=function P(L,G,$){L===null&&(L=Function.prototype);var M=Object.getOwnPropertyDescriptor(L,G);if(M===void 0){var B=Object.getPrototypeOf(L);return B===null?void 0:P(B,G,$)}else{if("value"in M)return M.value;var q=M.get;return q===void 0?void 0:q.call($)}},o=i(3),l=N(o),h=i(2),c=N(h),f=i(8),u=N(f),d=i(23),p=N(d),v=i(34),g=N(v),y=i(59),b=N(y),_=i(60),m=N(_),x=i(28),S=N(x),w=i(61),T=N(w);function N(P){return P&&P.__esModule?P:{default:P}}function A(P,L){if(!(P instanceof L))throw new TypeError("Cannot call a class as a function")}function E(P,L){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:P}function O(P,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);P.prototype=Object.create(L&&L.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(P,L):P.__proto__=L)}var R=[!1,"center","right","justify"],C=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],F=[!1,"serif","monospace"],U=["1","2","3",!1],D=["small",!1,"large","huge"],z=function(P){O(L,P);function L(G,$){A(this,L);var M=E(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,G,$)),B=function q(H){if(!document.body.contains(G.root))return document.body.removeEventListener("click",q);M.tooltip!=null&&!M.tooltip.root.contains(H.target)&&document.activeElement!==M.tooltip.textbox&&!M.quill.hasFocus()&&M.tooltip.hide(),M.pickers!=null&&M.pickers.forEach(function(X){X.container.contains(H.target)||X.close()})};return G.emitter.listenDOM("click",document.body,B),M}return s(L,[{key:"addModule",value:function($){var M=a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"addModule",this).call(this,$);return $==="toolbar"&&this.extendToolbar(M),M}},{key:"buildButtons",value:function($,M){$.forEach(function(B){var q=B.getAttribute("class")||"";q.split(/\s+/).forEach(function(H){if(H.startsWith("ql-")&&(H=H.slice(3),M[H]!=null))if(H==="direction")B.innerHTML=M[H][""]+M[H].rtl;else if(typeof M[H]=="string")B.innerHTML=M[H];else{var X=B.value||"";X!=null&&M[H][X]&&(B.innerHTML=M[H][X])}})})}},{key:"buildPickers",value:function($,M){var B=this;this.pickers=$.map(function(H){if(H.classList.contains("ql-align"))return H.querySelector("option")==null&&I(H,R),new m.default(H,M.align);if(H.classList.contains("ql-background")||H.classList.contains("ql-color")){var X=H.classList.contains("ql-background")?"background":"color";return H.querySelector("option")==null&&I(H,C,X==="background"?"#ffffff":"#000000"),new b.default(H,M[X])}else return H.querySelector("option")==null&&(H.classList.contains("ql-font")?I(H,F):H.classList.contains("ql-header")?I(H,U):H.classList.contains("ql-size")&&I(H,D)),new S.default(H)});var q=function(){B.pickers.forEach(function(X){X.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,q)}}]),L}(g.default);z.DEFAULTS=(0,l.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var L=this,G=this.container.querySelector("input.ql-image[type=file]");G==null&&(G=document.createElement("input"),G.setAttribute("type","file"),G.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),G.classList.add("ql-image"),G.addEventListener("change",function(){if(G.files!=null&&G.files[0]!=null){var $=new FileReader;$.onload=function(M){var B=L.quill.getSelection(!0);L.quill.updateContents(new c.default().retain(B.index).delete(B.length).insert({image:M.target.result}),u.default.sources.USER),L.quill.setSelection(B.index+1,u.default.sources.SILENT),G.value=""},$.readAsDataURL(G.files[0])}}),this.container.appendChild(G)),G.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(P){O(L,P);function L(G,$){A(this,L);var M=E(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,G,$));return M.textbox=M.root.querySelector('input[type="text"]'),M.listen(),M}return s(L,[{key:"listen",value:function(){var $=this;this.textbox.addEventListener("keydown",function(M){p.default.match(M,"enter")?($.save(),M.preventDefault()):p.default.match(M,"escape")&&($.cancel(),M.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),M!=null?this.textbox.value=M:$!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+$)||""),this.root.setAttribute("data-mode",$)}},{key:"restoreFocus",value:function(){var $=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=$}},{key:"save",value:function(){var $=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var M=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",$,u.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",$,u.default.sources.USER)),this.quill.root.scrollTop=M;break}case"video":$=k($);case"formula":{if(!$)break;var B=this.quill.getSelection(!0);if(B!=null){var q=B.index+B.length;this.quill.insertEmbed(q,this.root.getAttribute("data-mode"),$,u.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(q+1," ",u.default.sources.USER),this.quill.setSelection(q+2,u.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),L}(T.default);function k(P){var L=P.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||P.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=P.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":P}function I(P,L){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;L.forEach(function($){var M=document.createElement("option");$===G?M.setAttribute("selected","selected"):M.setAttribute("value",$),P.appendChild(M)})}n.BaseTooltip=j,n.default=z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},a.prototype.contains=function(o){for(var l,h=this.iterator();l=h();)if(l===o)return!0;return!1},a.prototype.insertBefore=function(o,l){o&&(o.next=l,l!=null?(o.prev=l.prev,l.prev!=null&&(l.prev.next=o),l.prev=o,l===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},a.prototype.offset=function(o){for(var l=0,h=this.head;h!=null;){if(h===o)return l;l+=h.length(),h=h.next}return-1},a.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},a.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var l=o;return o!=null&&(o=o.next),l}},a.prototype.find=function(o,l){l===void 0&&(l=!1);for(var h,c=this.iterator();h=c();){var f=h.length();if(o<f||l&&o===f&&(h.next==null||h.next.length()!==0))return[h,o];o-=f}return[null,0]},a.prototype.forEach=function(o){for(var l,h=this.iterator();l=h();)o(l)},a.prototype.forEachAt=function(o,l,h){if(!(l<=0))for(var c=this.find(o),f=c[0],u=c[1],d,p=o-u,v=this.iterator(f);(d=v())&&p<o+l;){var g=d.length();o>p?h(d,o-p,Math.min(l,p+g-o)):h(d,0,Math.min(g,o+l-p)),p+=g}},a.prototype.map=function(o){return this.reduce(function(l,h){return l.push(o(h)),l},[])},a.prototype.reduce=function(o,l){for(var h,c=this.iterator();h=c();)l=o(l,h);return l},a}();n.default=s},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){f(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,c=function(f){s(u,f);function u(d){var p=f.call(this,d)||this;return p.scroll=p,p.observer=new MutationObserver(function(v){p.update(v)}),p.observer.observe(p.domNode,l),p.attach(),p}return u.prototype.detach=function(){f.prototype.detach.call(this),this.observer.disconnect()},u.prototype.deleteAt=function(d,p){this.update(),d===0&&p===this.length()?this.children.forEach(function(v){v.remove()}):f.prototype.deleteAt.call(this,d,p)},u.prototype.formatAt=function(d,p,v,g){this.update(),f.prototype.formatAt.call(this,d,p,v,g)},u.prototype.insertAt=function(d,p,v){this.update(),f.prototype.insertAt.call(this,d,p,v)},u.prototype.optimize=function(d,p){var v=this;d===void 0&&(d=[]),p===void 0&&(p={}),f.prototype.optimize.call(this,p);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)d.push(g.pop());for(var y=function(x,S){S===void 0&&(S=!0),!(x==null||x===v)&&x.domNode.parentNode!=null&&(x.domNode[o.DATA_KEY].mutations==null&&(x.domNode[o.DATA_KEY].mutations=[]),S&&y(x.parent))},b=function(x){x.domNode[o.DATA_KEY]==null||x.domNode[o.DATA_KEY].mutations==null||(x instanceof a.default&&x.children.forEach(b),x.optimize(p))},_=d,m=0;_.length>0;m+=1){if(m>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(_.forEach(function(x){var S=o.find(x.target,!0);S!=null&&(S.domNode===x.target&&(x.type==="childList"?(y(o.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(w){var T=o.find(w,!1);y(T,!1),T instanceof a.default&&T.children.forEach(function(N){y(N,!1)})})):x.type==="attributes"&&y(S.prev)),y(S))}),this.children.forEach(b),_=[].slice.call(this.observer.takeRecords()),g=_.slice();g.length>0;)d.push(g.pop())}},u.prototype.update=function(d,p){var v=this;p===void 0&&(p={}),d=d||this.observer.takeRecords(),d.map(function(g){var y=o.find(g.target,!0);return y==null?null:y.domNode[o.DATA_KEY].mutations==null?(y.domNode[o.DATA_KEY].mutations=[g],y):(y.domNode[o.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g==null||g===v||g.domNode[o.DATA_KEY]==null||g.update(g.domNode[o.DATA_KEY].mutations||[],p)}),this.domNode[o.DATA_KEY].mutations!=null&&f.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,p),this.optimize(d,p)},u.blotName="scroll",u.defaultChild="block",u.scope=o.Scope.BLOCK_BLOT,u.tagName="DIV",u}(a.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var d in u)u.hasOwnProperty(d)&&(f[d]=u[d])};return function(f,u){c(f,u);function d(){this.constructor=f}f.prototype=u===null?Object.create(u):(d.prototype=u.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1);function l(c,f){if(Object.keys(c).length!==Object.keys(f).length)return!1;for(var u in c)if(c[u]!==f[u])return!1;return!0}var h=function(c){s(f,c);function f(){return c!==null&&c.apply(this,arguments)||this}return f.formats=function(u){if(u.tagName!==f.tagName)return c.formats.call(this,u)},f.prototype.format=function(u,d){var p=this;u===this.statics.blotName&&!d?(this.children.forEach(function(v){v instanceof a.default||(v=v.wrap(f.blotName,!0)),p.attributes.copy(v)}),this.unwrap()):c.prototype.format.call(this,u,d)},f.prototype.formatAt=function(u,d,p,v){if(this.formats()[p]!=null||o.query(p,o.Scope.ATTRIBUTE)){var g=this.isolate(u,d);g.format(p,v)}else c.prototype.formatAt.call(this,u,d,p,v)},f.prototype.optimize=function(u){c.prototype.optimize.call(this,u);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var p=this.next;p instanceof f&&p.prev===this&&l(d,p.formats())&&(p.moveChildren(this),p.remove())},f.blotName="inline",f.scope=o.Scope.INLINE_BLOT,f.tagName="SPAN",f}(a.default);n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1),l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.formats=function(f){var u=o.query(c.blotName).tagName;if(f.tagName!==u)return h.formats.call(this,f)},c.prototype.format=function(f,u){o.query(f,o.Scope.BLOCK)!=null&&(f===this.statics.blotName&&!u?this.replaceWith(c.blotName):h.prototype.format.call(this,f,u))},c.prototype.formatAt=function(f,u,d,p){o.query(d,o.Scope.BLOCK)!=null?this.format(d,p):h.prototype.formatAt.call(this,f,u,d,p)},c.prototype.insertAt=function(f,u,d){if(d==null||o.query(u,o.Scope.INLINE)!=null)h.prototype.insertAt.call(this,f,u,d);else{var p=this.split(f),v=o.create(u,d);p.parent.insertBefore(v,p)}},c.prototype.update=function(f,u){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,f,u)},c.blotName="block",c.scope=o.Scope.BLOCK_BLOT,c.tagName="P",c}(a.default);n.default=l},function(r,n,i){var s=this&&this.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,c){h.__proto__=c}||function(h,c){for(var f in c)c.hasOwnProperty(f)&&(h[f]=c[f])};return function(h,c){l(h,c);function f(){this.constructor=h}h.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=function(l){s(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.formats=function(c){},h.prototype.format=function(c,f){l.prototype.formatAt.call(this,0,this.length(),c,f)},h.prototype.formatAt=function(c,f,u,d){c===0&&f===this.length()?this.format(u,d):l.prototype.formatAt.call(this,c,f,u,d)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h}(a.default);n.default=o},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=i(1),l=function(h){s(c,h);function c(f){var u=h.call(this,f)||this;return u.text=u.statics.value(u.domNode),u}return c.create=function(f){return document.createTextNode(f)},c.value=function(f){var u=f.data;return u.normalize&&(u=u.normalize()),u},c.prototype.deleteAt=function(f,u){this.domNode.data=this.text=this.text.slice(0,f)+this.text.slice(f+u)},c.prototype.index=function(f,u){return this.domNode===f?u:-1},c.prototype.insertAt=function(f,u,d){d==null?(this.text=this.text.slice(0,f)+u+this.text.slice(f),this.domNode.data=this.text):h.prototype.insertAt.call(this,f,u,d)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(f){h.prototype.optimize.call(this,f),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(f,u){return[this.domNode,f]},c.prototype.split=function(f,u){if(u===void 0&&(u=!1),!u){if(f===0)return this;if(f===this.length())return this.next}var d=o.create(this.domNode.splitText(f));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},c.prototype.update=function(f,u){var d=this;f.some(function(p){return p.type==="characterData"&&p.target===d.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=o.Scope.INLINE_BLOT,c}(a.default);n.default=l},function(r,n,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,l){return arguments.length>1&&!this.contains(o)==!l?l:a.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,l){return l=l||0,this.substr(l,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,l){var h=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>h.length)&&(l=h.length),l-=o.length;var c=h.indexOf(o,l);return c!==-1&&c===l}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof l!="function")throw new TypeError("predicate must be a function");for(var h=Object(this),c=h.length>>>0,f=arguments[1],u,d=0;d<c;d++)if(u=h[d],l.call(f,u,d,h))return u}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,s=1,a=0;function o(m,x,S){if(m==x)return m?[[a,m]]:[];(S<0||m.length<S)&&(S=null);var w=f(m,x),T=m.substring(0,w);m=m.substring(w),x=x.substring(w),w=u(m,x);var N=m.substring(m.length-w);m=m.substring(0,m.length-w),x=x.substring(0,x.length-w);var A=l(m,x);return T&&A.unshift([a,T]),N&&A.push([a,N]),p(A),S!=null&&(A=y(A,S)),A=b(A),A}function l(m,x){var S;if(!m)return[[s,x]];if(!x)return[[i,m]];var w=m.length>x.length?m:x,T=m.length>x.length?x:m,N=w.indexOf(T);if(N!=-1)return S=[[s,w.substring(0,N)],[a,T],[s,w.substring(N+T.length)]],m.length>x.length&&(S[0][0]=S[2][0]=i),S;if(T.length==1)return[[i,m],[s,x]];var A=d(m,x);if(A){var E=A[0],O=A[1],R=A[2],C=A[3],F=A[4],U=o(E,R),D=o(O,C);return U.concat([[a,F]],D)}return h(m,x)}function h(m,x){for(var S=m.length,w=x.length,T=Math.ceil((S+w)/2),N=T,A=2*T,E=new Array(A),O=new Array(A),R=0;R<A;R++)E[R]=-1,O[R]=-1;E[N+1]=0,O[N+1]=0;for(var C=S-w,F=C%2!=0,U=0,D=0,z=0,j=0,k=0;k<T;k++){for(var I=-k+U;I<=k-D;I+=2){var P=N+I,L;I==-k||I!=k&&E[P-1]<E[P+1]?L=E[P+1]:L=E[P-1]+1;for(var G=L-I;L<S&&G<w&&m.charAt(L)==x.charAt(G);)L++,G++;if(E[P]=L,L>S)D+=2;else if(G>w)U+=2;else if(F){var $=N+C-I;if($>=0&&$<A&&O[$]!=-1){var M=S-O[$];if(L>=M)return c(m,x,L,G)}}}for(var B=-k+z;B<=k-j;B+=2){var $=N+B,M;B==-k||B!=k&&O[$-1]<O[$+1]?M=O[$+1]:M=O[$-1]+1;for(var q=M-B;M<S&&q<w&&m.charAt(S-M-1)==x.charAt(w-q-1);)M++,q++;if(O[$]=M,M>S)j+=2;else if(q>w)z+=2;else if(!F){var P=N+C-B;if(P>=0&&P<A&&E[P]!=-1){var L=E[P],G=N+L-P;if(M=S-M,L>=M)return c(m,x,L,G)}}}}return[[i,m],[s,x]]}function c(m,x,S,w){var T=m.substring(0,S),N=x.substring(0,w),A=m.substring(S),E=x.substring(w),O=o(T,N),R=o(A,E);return O.concat(R)}function f(m,x){if(!m||!x||m.charAt(0)!=x.charAt(0))return 0;for(var S=0,w=Math.min(m.length,x.length),T=w,N=0;S<T;)m.substring(N,T)==x.substring(N,T)?(S=T,N=S):w=T,T=Math.floor((w-S)/2+S);return T}function u(m,x){if(!m||!x||m.charAt(m.length-1)!=x.charAt(x.length-1))return 0;for(var S=0,w=Math.min(m.length,x.length),T=w,N=0;S<T;)m.substring(m.length-T,m.length-N)==x.substring(x.length-T,x.length-N)?(S=T,N=S):w=T,T=Math.floor((w-S)/2+S);return T}function d(m,x){var S=m.length>x.length?m:x,w=m.length>x.length?x:m;if(S.length<4||w.length*2<S.length)return null;function T(D,z,j){for(var k=D.substring(j,j+Math.floor(D.length/4)),I=-1,P="",L,G,$,M;(I=z.indexOf(k,I+1))!=-1;){var B=f(D.substring(j),z.substring(I)),q=u(D.substring(0,j),z.substring(0,I));P.length<q+B&&(P=z.substring(I-q,I)+z.substring(I,I+B),L=D.substring(0,j-q),G=D.substring(j+B),$=z.substring(0,I-q),M=z.substring(I+B))}return P.length*2>=D.length?[L,G,$,M,P]:null}var N=T(S,w,Math.ceil(S.length/4)),A=T(S,w,Math.ceil(S.length/2)),E;if(!N&&!A)return null;A?N?E=N[4].length>A[4].length?N:A:E=A:E=N;var O,R,C,F;m.length>x.length?(O=E[0],R=E[1],C=E[2],F=E[3]):(C=E[0],F=E[1],O=E[2],R=E[3]);var U=E[4];return[O,R,C,F,U]}function p(m){m.push([a,""]);for(var x=0,S=0,w=0,T="",N="",A;x<m.length;)switch(m[x][0]){case s:w++,N+=m[x][1],x++;break;case i:S++,T+=m[x][1],x++;break;case a:S+w>1?(S!==0&&w!==0&&(A=f(N,T),A!==0&&(x-S-w>0&&m[x-S-w-1][0]==a?m[x-S-w-1][1]+=N.substring(0,A):(m.splice(0,0,[a,N.substring(0,A)]),x++),N=N.substring(A),T=T.substring(A)),A=u(N,T),A!==0&&(m[x][1]=N.substring(N.length-A)+m[x][1],N=N.substring(0,N.length-A),T=T.substring(0,T.length-A))),S===0?m.splice(x-w,S+w,[s,N]):w===0?m.splice(x-S,S+w,[i,T]):m.splice(x-S-w,S+w,[i,T],[s,N]),x=x-S-w+(S?1:0)+(w?1:0)+1):x!==0&&m[x-1][0]==a?(m[x-1][1]+=m[x][1],m.splice(x,1)):x++,w=0,S=0,T="",N="";break}m[m.length-1][1]===""&&m.pop();var E=!1;for(x=1;x<m.length-1;)m[x-1][0]==a&&m[x+1][0]==a&&(m[x][1].substring(m[x][1].length-m[x-1][1].length)==m[x-1][1]?(m[x][1]=m[x-1][1]+m[x][1].substring(0,m[x][1].length-m[x-1][1].length),m[x+1][1]=m[x-1][1]+m[x+1][1],m.splice(x-1,1),E=!0):m[x][1].substring(0,m[x+1][1].length)==m[x+1][1]&&(m[x-1][1]+=m[x+1][1],m[x][1]=m[x][1].substring(m[x+1][1].length)+m[x+1][1],m.splice(x+1,1),E=!0)),x++;E&&p(m)}var v=o;v.INSERT=s,v.DELETE=i,v.EQUAL=a,r.exports=v;function g(m,x){if(x===0)return[a,m];for(var S=0,w=0;w<m.length;w++){var T=m[w];if(T[0]===i||T[0]===a){var N=S+T[1].length;if(x===N)return[w+1,m];if(x<N){m=m.slice();var A=x-S,E=[T[0],T[1].slice(0,A)],O=[T[0],T[1].slice(A)];return m.splice(w,1,E,O),[w+1,m]}else S=N}}throw new Error("cursor_pos is out of bounds!")}function y(m,x){var S=g(m,x),w=S[1],T=S[0],N=w[T],A=w[T+1];if(N==null)return m;if(N[0]!==a)return m;if(A!=null&&N[1]+A[1]===A[1]+N[1])return w.splice(T,2,A,N),_(w,T,2);if(A!=null&&A[1].indexOf(N[1])===0){w.splice(T,2,[A[0],N[1]],[0,N[1]]);var E=A[1].slice(N[1].length);return E.length>0&&w.splice(T+2,0,[A[0],E]),_(w,T,3)}else return m}function b(m){for(var x=!1,S=function(A){return A.charCodeAt(0)>=56320&&A.charCodeAt(0)<=57343},w=function(A){return A.charCodeAt(A.length-1)>=55296&&A.charCodeAt(A.length-1)<=56319},T=2;T<m.length;T+=1)m[T-2][0]===a&&w(m[T-2][1])&&m[T-1][0]===i&&S(m[T-1][1])&&m[T][0]===s&&S(m[T][1])&&(x=!0,m[T-1][1]=m[T-2][1].slice(-1)+m[T-1][1],m[T][1]=m[T-2][1].slice(-1)+m[T][1],m[T-2][1]=m[T-2][1].slice(0,-1));if(!x)return m;for(var N=[],T=0;T<m.length;T+=1)m[T][1].length>0&&N.push(m[T]);return N}function _(m,x,S){for(var w=x+S-1;w>=0&&w>=x-1;w--)if(w+1<m.length){var T=m[w],N=m[w+1];T[0]===N[1]&&m.splice(w,2,[T[0],T[1]+N[1]])}return m}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(s){var a=[];for(var o in s)a.push(o);return a}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?s:a,n.supported=s;function s(o){return Object.prototype.toString.call(o)=="[object Arguments]"}n.unsupported=a;function a(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,s="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(s=!1));function o(h,c,f){this.fn=h,this.context=c,this.once=f||!1}function l(){this._events=new a,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],f,u;if(this._eventsCount===0)return c;for(u in f=this._events)i.call(f,u)&&c.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},l.prototype.listeners=function(c,f){var u=s?s+c:c,d=this._events[u];if(f)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var p=0,v=d.length,g=new Array(v);p<v;p++)g[p]=d[p].fn;return g},l.prototype.emit=function(c,f,u,d,p,v){var g=s?s+c:c;if(!this._events[g])return!1;var y=this._events[g],b=arguments.length,_,m;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),b){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,f),!0;case 3:return y.fn.call(y.context,f,u),!0;case 4:return y.fn.call(y.context,f,u,d),!0;case 5:return y.fn.call(y.context,f,u,d,p),!0;case 6:return y.fn.call(y.context,f,u,d,p,v),!0}for(m=1,_=new Array(b-1);m<b;m++)_[m-1]=arguments[m];y.fn.apply(y.context,_)}else{var x=y.length,S;for(m=0;m<x;m++)switch(y[m].once&&this.removeListener(c,y[m].fn,void 0,!0),b){case 1:y[m].fn.call(y[m].context);break;case 2:y[m].fn.call(y[m].context,f);break;case 3:y[m].fn.call(y[m].context,f,u);break;case 4:y[m].fn.call(y[m].context,f,u,d);break;default:if(!_)for(S=1,_=new Array(b-1);S<b;S++)_[S-1]=arguments[S];y[m].fn.apply(y[m].context,_)}}return!0},l.prototype.on=function(c,f,u){var d=new o(f,u||this),p=s?s+c:c;return this._events[p]?this._events[p].fn?this._events[p]=[this._events[p],d]:this._events[p].push(d):(this._events[p]=d,this._eventsCount++),this},l.prototype.once=function(c,f,u){var d=new o(f,u||this,!0),p=s?s+c:c;return this._events[p]?this._events[p].fn?this._events[p]=[this._events[p],d]:this._events[p].push(d):(this._events[p]=d,this._eventsCount++),this},l.prototype.removeListener=function(c,f,u,d){var p=s?s+c:c;if(!this._events[p])return this;if(!f)return--this._eventsCount===0?this._events=new a:delete this._events[p],this;var v=this._events[p];if(v.fn)v.fn===f&&(!d||v.once)&&(!u||v.context===u)&&(--this._eventsCount===0?this._events=new a:delete this._events[p]);else{for(var g=0,y=[],b=v.length;g<b;g++)(v[g].fn!==f||d&&!v[g].once||u&&v[g].context!==u)&&y.push(v[g]);y.length?this._events[p]=y.length===1?y[0]:y:--this._eventsCount===0?this._events=new a:delete this._events[p]}return this},l.prototype.removeAllListeners=function(c){var f;return c?(f=s?s+c:c,this._events[f]&&(--this._eventsCount===0?this._events=new a:delete this._events[f])):(this._events=new a,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prototype.setMaxListeners=function(){return this},l.prefixed=s,l.EventEmitter=l,typeof r<"u"&&(r.exports=l)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},a=function(){function V(W,Q){var tt=[],Y=!0,ct=!1,Z=void 0;try{for(var at=W[Symbol.iterator](),St;!(Y=(St=at.next()).done)&&(tt.push(St.value),!(Q&&tt.length===Q));Y=!0);}catch(Ht){ct=!0,Z=Ht}finally{try{!Y&&at.return&&at.return()}finally{if(ct)throw Z}}return tt}return function(W,Q){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return V(W,Q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function V(W,Q){for(var tt=0;tt<Q.length;tt++){var Y=Q[tt];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(W,Y.key,Y)}}return function(W,Q,tt){return Q&&V(W.prototype,Q),tt&&V(W,tt),W}}(),l=i(3),h=O(l),c=i(2),f=O(c),u=i(0),d=O(u),p=i(5),v=O(p),g=i(10),y=O(g),b=i(9),_=O(b),m=i(36),x=i(37),S=i(13),w=O(S),T=i(26),N=i(38),A=i(39),E=i(40);function O(V){return V&&V.__esModule?V:{default:V}}function R(V,W,Q){return W in V?Object.defineProperty(V,W,{value:Q,enumerable:!0,configurable:!0,writable:!0}):V[W]=Q,V}function C(V,W){if(!(V instanceof W))throw new TypeError("Cannot call a class as a function")}function F(V,W){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:V}function U(V,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);V.prototype=Object.create(W&&W.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(V,W):V.__proto__=W)}var D=(0,y.default)("quill:clipboard"),z="__ql-matcher",j=[[Node.TEXT_NODE,It],[Node.TEXT_NODE,ot],["br",K],[Node.ELEMENT_NODE,ot],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ht],[Node.ELEMENT_NODE,H],[Node.ELEMENT_NODE,Ct],["li",it],["b",q.bind(q,"bold")],["i",q.bind(q,"italic")],["style",et]],k=[m.AlignAttribute,N.DirectionAttribute].reduce(function(V,W){return V[W.keyName]=W,V},{}),I=[m.AlignStyle,x.BackgroundStyle,T.ColorStyle,N.DirectionStyle,A.FontStyle,E.SizeStyle].reduce(function(V,W){return V[W.keyName]=W,V},{}),P=function(V){U(W,V);function W(Q,tt){C(this,W);var Y=F(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Q,tt));return Y.quill.root.addEventListener("paste",Y.onPaste.bind(Y)),Y.container=Y.quill.addContainer("ql-clipboard"),Y.container.setAttribute("contenteditable",!0),Y.container.setAttribute("tabindex",-1),Y.matchers=[],j.concat(Y.options.matchers).forEach(function(ct){var Z=a(ct,2),at=Z[0],St=Z[1];!tt.matchVisual&&St===ht||Y.addMatcher(at,St)}),Y}return o(W,[{key:"addMatcher",value:function(tt,Y){this.matchers.push([tt,Y])}},{key:"convert",value:function(tt){if(typeof tt=="string")return this.container.innerHTML=tt.replace(/\>\r?\n +\</g,"><"),this.convert();var Y=this.quill.getFormat(this.quill.selection.savedRange.index);if(Y[w.default.blotName]){var ct=this.container.innerText;return this.container.innerHTML="",new f.default().insert(ct,R({},w.default.blotName,Y[w.default.blotName]))}var Z=this.prepareMatching(),at=a(Z,2),St=at[0],Ht=at[1],_t=B(this.container,St,Ht);return $(_t,`
582
+ `)&&_t.ops[_t.ops.length-1].attributes==null&&(_t=_t.compose(new f.default().retain(_t.length()-1).delete(1))),D.log("convert",this.container.innerHTML,_t),this.container.innerHTML="",_t}},{key:"dangerouslyPasteHTML",value:function(tt,Y){var ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof tt=="string")this.quill.setContents(this.convert(tt),Y),this.quill.setSelection(0,v.default.sources.SILENT);else{var Z=this.convert(Y);this.quill.updateContents(new f.default().retain(tt).concat(Z),ct),this.quill.setSelection(tt+Z.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(tt){var Y=this;if(!(tt.defaultPrevented||!this.quill.isEnabled())){var ct=this.quill.getSelection(),Z=new f.default().retain(ct.index),at=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){Z=Z.concat(Y.convert()).delete(ct.length),Y.quill.updateContents(Z,v.default.sources.USER),Y.quill.setSelection(Z.length()-ct.length,v.default.sources.SILENT),Y.quill.scrollingContainer.scrollTop=at,Y.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var tt=this,Y=[],ct=[];return this.matchers.forEach(function(Z){var at=a(Z,2),St=at[0],Ht=at[1];switch(St){case Node.TEXT_NODE:ct.push(Ht);break;case Node.ELEMENT_NODE:Y.push(Ht);break;default:[].forEach.call(tt.container.querySelectorAll(St),function(_t){_t[z]=_t[z]||[],_t[z].push(Ht)});break}}),[Y,ct]}}]),W}(_.default);P.DEFAULTS={matchers:[],matchVisual:!0};function L(V,W,Q){return(typeof W>"u"?"undefined":s(W))==="object"?Object.keys(W).reduce(function(tt,Y){return L(tt,Y,W[Y])},V):V.reduce(function(tt,Y){return Y.attributes&&Y.attributes[W]?tt.push(Y):tt.insert(Y.insert,(0,h.default)({},R({},W,Q),Y.attributes))},new f.default)}function G(V){if(V.nodeType!==Node.ELEMENT_NODE)return{};var W="__ql-computed-style";return V[W]||(V[W]=window.getComputedStyle(V))}function $(V,W){for(var Q="",tt=V.ops.length-1;tt>=0&&Q.length<W.length;--tt){var Y=V.ops[tt];if(typeof Y.insert!="string")break;Q=Y.insert+Q}return Q.slice(-1*W.length)===W}function M(V){if(V.childNodes.length===0)return!1;var W=G(V);return["block","list-item"].indexOf(W.display)>-1}function B(V,W,Q){return V.nodeType===V.TEXT_NODE?Q.reduce(function(tt,Y){return Y(V,tt)},new f.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function(tt,Y){var ct=B(Y,W,Q);return Y.nodeType===V.ELEMENT_NODE&&(ct=W.reduce(function(Z,at){return at(Y,Z)},ct),ct=(Y[z]||[]).reduce(function(Z,at){return at(Y,Z)},ct)),tt.concat(ct)},new f.default):new f.default}function q(V,W,Q){return L(Q,V,!0)}function H(V,W){var Q=d.default.Attributor.Attribute.keys(V),tt=d.default.Attributor.Class.keys(V),Y=d.default.Attributor.Style.keys(V),ct={};return Q.concat(tt).concat(Y).forEach(function(Z){var at=d.default.query(Z,d.default.Scope.ATTRIBUTE);at!=null&&(ct[at.attrName]=at.value(V),ct[at.attrName])||(at=k[Z],at!=null&&(at.attrName===Z||at.keyName===Z)&&(ct[at.attrName]=at.value(V)||void 0),at=I[Z],at!=null&&(at.attrName===Z||at.keyName===Z)&&(at=I[Z],ct[at.attrName]=at.value(V)||void 0))}),Object.keys(ct).length>0&&(W=L(W,ct)),W}function X(V,W){var Q=d.default.query(V);if(Q==null)return W;if(Q.prototype instanceof d.default.Embed){var tt={},Y=Q.value(V);Y!=null&&(tt[Q.blotName]=Y,W=new f.default().insert(tt,Q.formats(V)))}else typeof Q.formats=="function"&&(W=L(W,Q.blotName,Q.formats(V)));return W}function K(V,W){return $(W,`
583
+ `)||W.insert(`
584
+ `),W}function et(){return new f.default}function it(V,W){var Q=d.default.query(V);if(Q==null||Q.blotName!=="list-item"||!$(W,`
585
+ `))return W;for(var tt=-1,Y=V.parentNode;!Y.classList.contains("ql-clipboard");)(d.default.query(Y)||{}).blotName==="list"&&(tt+=1),Y=Y.parentNode;return tt<=0?W:W.compose(new f.default().retain(W.length()-1).retain(1,{indent:tt}))}function ot(V,W){return $(W,`
586
+ `)||(M(V)||W.length()>0&&V.nextSibling&&M(V.nextSibling))&&W.insert(`
587
+ `),W}function ht(V,W){if(M(V)&&V.nextElementSibling!=null&&!$(W,`
588
+
589
+ `)){var Q=V.offsetHeight+parseFloat(G(V).marginTop)+parseFloat(G(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+Q*1.5&&W.insert(`
590
+ `)}return W}function Ct(V,W){var Q={},tt=V.style||{};return tt.fontStyle&&G(V).fontStyle==="italic"&&(Q.italic=!0),tt.fontWeight&&(G(V).fontWeight.startsWith("bold")||parseInt(G(V).fontWeight)>=700)&&(Q.bold=!0),Object.keys(Q).length>0&&(W=L(W,Q)),parseFloat(tt.textIndent||0)>0&&(W=new f.default().insert(" ").concat(W)),W}function It(V,W){var Q=V.data;if(V.parentNode.tagName==="O:P")return W.insert(Q.trim());if(Q.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return W;if(!G(V.parentNode).whiteSpace.startsWith("pre")){var tt=function(ct,Z){return Z=Z.replace(/[^\u00a0]/g,""),Z.length<1&&ct?" ":Z};Q=Q.replace(/\r\n/g," ").replace(/\n/g," "),Q=Q.replace(/\s\s+/g,tt.bind(tt,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Q=Q.replace(/^\s+/,tt.bind(tt,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Q=Q.replace(/\s+$/,tt.bind(tt,!1)))}return W.insert(Q)}n.default=P,n.matchAttributor=H,n.matchBlot=X,n.matchNewline=ot,n.matchSpacing=ht,n.matchText=It},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(6),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"optimize",value:function(y){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,y),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v}(l.default);d.blotName="bold",d.tagName=["STRONG","B"],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=function(){function E(O,R){var C=[],F=!0,U=!1,D=void 0;try{for(var z=O[Symbol.iterator](),j;!(F=(j=z.next()).done)&&(C.push(j.value),!(R&&C.length===R));F=!0);}catch(k){U=!0,D=k}finally{try{!F&&z.return&&z.return()}finally{if(U)throw D}}return C}return function(O,R){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return E(O,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function E(O,R){for(var C=0;C<R.length;C++){var F=R[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(O,F.key,F)}}return function(O,R,C){return R&&E(O.prototype,R),C&&E(O,C),O}}(),o=i(2),l=y(o),h=i(0),c=y(h),f=i(5),u=y(f),d=i(10),p=y(d),v=i(9),g=y(v);function y(E){return E&&E.__esModule?E:{default:E}}function b(E,O,R){return O in E?Object.defineProperty(E,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):E[O]=R,E}function _(E,O){if(!(E instanceof O))throw new TypeError("Cannot call a class as a function")}function m(E,O){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:E}function x(E,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);E.prototype=Object.create(O&&O.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(E,O):E.__proto__=O)}var S=(0,p.default)("quill:toolbar"),w=function(E){x(O,E);function O(R,C){_(this,O);var F=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,C));if(Array.isArray(F.options.container)){var U=document.createElement("div");N(U,F.options.container),R.container.parentNode.insertBefore(U,R.container),F.container=U}else typeof F.options.container=="string"?F.container=document.querySelector(F.options.container):F.container=F.options.container;if(!(F.container instanceof HTMLElement)){var D;return D=S.error("Container required for toolbar",F.options),m(F,D)}return F.container.classList.add("ql-toolbar"),F.controls=[],F.handlers={},Object.keys(F.options.handlers).forEach(function(z){F.addHandler(z,F.options.handlers[z])}),[].forEach.call(F.container.querySelectorAll("button, select"),function(z){F.attach(z)}),F.quill.on(u.default.events.EDITOR_CHANGE,function(z,j){z===u.default.events.SELECTION_CHANGE&&F.update(j)}),F.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var z=F.quill.selection.getRange(),j=s(z,1),k=j[0];F.update(k)}),F}return a(O,[{key:"addHandler",value:function(C,F){this.handlers[C]=F}},{key:"attach",value:function(C){var F=this,U=[].find.call(C.classList,function(z){return z.indexOf("ql-")===0});if(U){if(U=U.slice(3),C.tagName==="BUTTON"&&C.setAttribute("type","button"),this.handlers[U]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[U]==null){S.warn("ignoring attaching to disabled format",U,C);return}if(c.default.query(U)==null){S.warn("ignoring attaching to nonexistent format",U,C);return}}var D=C.tagName==="SELECT"?"change":"click";C.addEventListener(D,function(z){var j=void 0;if(C.tagName==="SELECT"){if(C.selectedIndex<0)return;var k=C.options[C.selectedIndex];k.hasAttribute("selected")?j=!1:j=k.value||!1}else C.classList.contains("ql-active")?j=!1:j=C.value||!C.hasAttribute("value"),z.preventDefault();F.quill.focus();var I=F.quill.selection.getRange(),P=s(I,1),L=P[0];if(F.handlers[U]!=null)F.handlers[U].call(F,j);else if(c.default.query(U).prototype instanceof c.default.Embed){if(j=prompt("Enter "+U),!j)return;F.quill.updateContents(new l.default().retain(L.index).delete(L.length).insert(b({},U,j)),u.default.sources.USER)}else F.quill.format(U,j,u.default.sources.USER);F.update(L)}),this.controls.push([U,C])}}},{key:"update",value:function(C){var F=C==null?{}:this.quill.getFormat(C);this.controls.forEach(function(U){var D=s(U,2),z=D[0],j=D[1];if(j.tagName==="SELECT"){var k=void 0;if(C==null)k=null;else if(F[z]==null)k=j.querySelector("option[selected]");else if(!Array.isArray(F[z])){var I=F[z];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),k=j.querySelector('option[value="'+I+'"]')}k==null?(j.value="",j.selectedIndex=-1):k.selected=!0}else if(C==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var P=F[z]===j.getAttribute("value")||F[z]!=null&&F[z].toString()===j.getAttribute("value")||F[z]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",P)}else j.classList.toggle("ql-active",F[z]!=null)})}}]),O}(g.default);w.DEFAULTS={};function T(E,O,R){var C=document.createElement("button");C.setAttribute("type","button"),C.classList.add("ql-"+O),R!=null&&(C.value=R),E.appendChild(C)}function N(E,O){Array.isArray(O[0])||(O=[O]),O.forEach(function(R){var C=document.createElement("span");C.classList.add("ql-formats"),R.forEach(function(F){if(typeof F=="string")T(C,F);else{var U=Object.keys(F)[0],D=F[U];Array.isArray(D)?A(C,U,D):T(C,U,D)}}),E.appendChild(C)})}function A(E,O,R){var C=document.createElement("select");C.classList.add("ql-"+O),R.forEach(function(F){var U=document.createElement("option");F!==!1?U.setAttribute("value",F):U.setAttribute("selected","selected"),C.appendChild(U)}),E.appendChild(C)}w.DEFAULTS={container:null,handlers:{clean:function(){var O=this,R=this.quill.getSelection();if(R!=null)if(R.length==0){var C=this.quill.getFormat();Object.keys(C).forEach(function(F){c.default.query(F,c.default.Scope.INLINE)!=null&&O.quill.format(F,!1)})}else this.quill.removeFormat(R,u.default.sources.USER)},direction:function(O){var R=this.quill.getFormat().align;O==="rtl"&&R==null?this.quill.format("align","right",u.default.sources.USER):!O&&R==="right"&&this.quill.format("align",!1,u.default.sources.USER),this.quill.format("direction",O,u.default.sources.USER)},indent:function(O){var R=this.quill.getSelection(),C=this.quill.getFormat(R),F=parseInt(C.indent||0);if(O==="+1"||O==="-1"){var U=O==="+1"?1:-1;C.direction==="rtl"&&(U*=-1),this.quill.format("indent",F+U,u.default.sources.USER)}},link:function(O){O===!0&&(O=prompt("Enter link URL:")),this.quill.format("link",O,u.default.sources.USER)},list:function(O){var R=this.quill.getSelection(),C=this.quill.getFormat(R);O==="check"?C.list==="checked"||C.list==="unchecked"?this.quill.format("list",!1,u.default.sources.USER):this.quill.format("list","unchecked",u.default.sources.USER):this.quill.format("list",O,u.default.sources.USER)}}},n.default=w,n.addControls=N},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(28),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(g,y){c(this,v);var b=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.label.innerHTML=y,b.container.classList.add("ql-color-picker"),[].slice.call(b.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(_){_.classList.add("ql-primary")}),b}return s(v,[{key:"buildItem",value:function(y){var b=a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,y);return b.style.backgroundColor=y.getAttribute("value")||"",b}},{key:"selectItem",value:function(y,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,b);var _=this.label.querySelector(".ql-color-label"),m=y&&y.getAttribute("data-value")||"";_&&(_.tagName==="line"?_.style.stroke=m:_.style.fill=m)}}]),v}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(28),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(g,y){c(this,v);var b=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.container.classList.add("ql-icon-picker"),[].forEach.call(b.container.querySelectorAll(".ql-picker-item"),function(_){_.innerHTML=y[_.getAttribute("data-value")||""]}),b.defaultItem=b.container.querySelector(".ql-selected"),b.selectItem(b.defaultItem),b}return s(v,[{key:"selectItem",value:function(y,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,b),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),v}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(h,c){for(var f=0;f<c.length;f++){var u=c[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}return function(h,c,f){return c&&l(h.prototype,c),f&&l(h,f),h}}();function a(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(h,c){var f=this;a(this,l),this.quill=h,this.boundsContainer=c||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){f.root.style.marginTop=-1*f.quill.root.scrollTop+"px"}),this.hide()}return s(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(c){var f=c.left+c.width/2-this.root.offsetWidth/2,u=c.bottom+this.quill.root.scrollTop;this.root.style.left=f+"px",this.root.style.top=u+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),p=this.root.getBoundingClientRect(),v=0;if(p.right>d.right&&(v=d.right-p.right,this.root.style.left=f+v+"px"),p.left<d.left&&(v=d.left-p.left,this.root.style.left=f+v+"px"),p.bottom>d.bottom){var g=p.bottom-p.top,y=c.bottom-c.top+g;this.root.style.top=u-y+"px",this.root.classList.add("ql-flip")}return v}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(E,O){var R=[],C=!0,F=!1,U=void 0;try{for(var D=E[Symbol.iterator](),z;!(C=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));C=!0);}catch(j){F=!0,U=j}finally{try{!C&&D.return&&D.return()}finally{if(F)throw U}}return R}return function(E,O){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return A(E,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function A(E,O,R){E===null&&(E=Function.prototype);var C=Object.getOwnPropertyDescriptor(E,O);if(C===void 0){var F=Object.getPrototypeOf(E);return F===null?void 0:A(F,O,R)}else{if("value"in C)return C.value;var U=C.get;return U===void 0?void 0:U.call(R)}},o=function(){function A(E,O){for(var R=0;R<O.length;R++){var C=O[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(E,C.key,C)}}return function(E,O,R){return O&&A(E.prototype,O),R&&A(E,R),E}}(),l=i(3),h=_(l),c=i(8),f=_(c),u=i(43),d=_(u),p=i(27),v=_(p),g=i(15),y=i(41),b=_(y);function _(A){return A&&A.__esModule?A:{default:A}}function m(A,E){if(!(A instanceof E))throw new TypeError("Cannot call a class as a function")}function x(A,E){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:A}function S(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);A.prototype=Object.create(E&&E.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(A,E):A.__proto__=E)}var w=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],T=function(A){S(E,A);function E(O,R){m(this,E),R.modules.toolbar!=null&&R.modules.toolbar.container==null&&(R.modules.toolbar.container=w);var C=x(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,O,R));return C.quill.container.classList.add("ql-snow"),C}return o(E,[{key:"extendToolbar",value:function(R){R.container.classList.add("ql-snow"),this.buildButtons([].slice.call(R.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(R.container.querySelectorAll("select")),b.default),this.tooltip=new N(this.quill,this.options.bounds),R.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(C,F){R.handlers.link.call(R,!F.format.link)})}}]),E}(d.default);T.DEFAULTS=(0,h.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){if(E){var O=this.quill.getSelection();if(O==null||O.length==0)return;var R=this.quill.getText(O);/^\S+@\S+\.\S+$/.test(R)&&R.indexOf("mailto:")!==0&&(R="mailto:"+R);var C=this.quill.theme.tooltip;C.edit("link",R)}else this.quill.format("link",!1)}}}}});var N=function(A){S(E,A);function E(O,R){m(this,E);var C=x(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,O,R));return C.preview=C.root.querySelector("a.ql-preview"),C}return o(E,[{key:"listen",value:function(){var R=this;a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(C){R.root.classList.contains("ql-editing")?R.save():R.edit("link",R.preview.textContent),C.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(C){if(R.linkRange!=null){var F=R.linkRange;R.restoreFocus(),R.quill.formatText(F,"link",!1,f.default.sources.USER),delete R.linkRange}C.preventDefault(),R.hide()}),this.quill.on(f.default.events.SELECTION_CHANGE,function(C,F,U){if(C!=null){if(C.length===0&&U===f.default.sources.USER){var D=R.quill.scroll.descendant(v.default,C.index),z=s(D,2),j=z[0],k=z[1];if(j!=null){R.linkRange=new g.Range(C.index-k,j.length());var I=v.default.formats(j.domNode);R.preview.textContent=I,R.preview.setAttribute("href",I),R.show(),R.position(R.quill.getBounds(R.linkRange));return}}else delete R.linkRange;R.hide()}})}},{key:"show",value:function(){a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),E}(u.BaseTooltip);N.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=T},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(29),a=Y(s),o=i(36),l=i(38),h=i(64),c=i(65),f=Y(c),u=i(66),d=Y(u),p=i(67),v=Y(p),g=i(37),y=i(26),b=i(39),_=i(40),m=i(56),x=Y(m),S=i(68),w=Y(S),T=i(27),N=Y(T),A=i(69),E=Y(A),O=i(70),R=Y(O),C=i(71),F=Y(C),U=i(72),D=Y(U),z=i(73),j=Y(z),k=i(13),I=Y(k),P=i(74),L=Y(P),G=i(75),$=Y(G),M=i(57),B=Y(M),q=i(41),H=Y(q),X=i(28),K=Y(X),et=i(59),it=Y(et),ot=i(60),ht=Y(ot),Ct=i(61),It=Y(Ct),V=i(108),W=Y(V),Q=i(62),tt=Y(Q);function Y(ct){return ct&&ct.__esModule?ct:{default:ct}}a.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":g.BackgroundClass,"attributors/class/color":y.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":_.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":g.BackgroundStyle,"attributors/style/color":y.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":_.SizeStyle},!0),a.default.register({"formats/align":o.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":h.IndentClass,"formats/background":g.BackgroundStyle,"formats/color":y.ColorStyle,"formats/font":b.FontClass,"formats/size":_.SizeClass,"formats/blockquote":f.default,"formats/code-block":I.default,"formats/header":d.default,"formats/list":v.default,"formats/bold":x.default,"formats/code":k.Code,"formats/italic":w.default,"formats/link":N.default,"formats/script":E.default,"formats/strike":R.default,"formats/underline":F.default,"formats/image":D.default,"formats/video":j.default,"formats/list/item":p.ListItem,"modules/formula":L.default,"modules/syntax":$.default,"modules/toolbar":B.default,"themes/bubble":W.default,"themes/snow":tt.default,"ui/icons":H.default,"ui/picker":K.default,"ui/icon-picker":ht.default,"ui/color-picker":it.default,"ui/tooltip":It.default},!0),n.default=a.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=function(){function v(g,y){for(var b=0;b<y.length;b++){var _=y[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,y,b){return y&&v(g.prototype,y),b&&v(g,b),g}}(),a=function v(g,y,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,y);if(_===void 0){var m=Object.getPrototypeOf(g);return m===null?void 0:v(m,y,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(0),l=h(o);function h(v){return v&&v.__esModule?v:{default:v}}function c(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function f(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function u(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var d=function(v){u(g,v);function g(){return c(this,g),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"add",value:function(b,_){if(_==="+1"||_==="-1"){var m=this.value(b)||0;_=_==="+1"?m+1:m-1}return _===0?(this.remove(b),!0):a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"add",this).call(this,b,_)}},{key:"canAdd",value:function(b,_){return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,_)||a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,parseInt(_))}},{key:"value",value:function(b){return parseInt(a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,b))||void 0}}]),g}(l.default.Attributor.Class),p=new d("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(4),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function h(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="blockquote",f.tagName="blockquote",n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function d(p,v){for(var g=0;g<v.length;g++){var y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}return function(p,v,g){return v&&d(p.prototype,v),g&&d(p,g),p}}(),a=i(4),o=l(a);function l(d){return d&&d.__esModule?d:{default:d}}function h(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")}function c(d,p){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:d}function f(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(d,p):d.__proto__=p)}var u=function(d){f(p,d);function p(){return h(this,p),c(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,null,[{key:"formats",value:function(g){return this.tagName.indexOf(g.tagName)+1}}]),p}(o.default);u.blotName="header",u.tagName=["H1","H2","H3","H4","H5","H6"],n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var s=function(){function m(x,S){for(var w=0;w<S.length;w++){var T=S[w];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(x,T.key,T)}}return function(x,S,w){return S&&m(x.prototype,S),w&&m(x,w),x}}(),a=function m(x,S,w){x===null&&(x=Function.prototype);var T=Object.getOwnPropertyDescriptor(x,S);if(T===void 0){var N=Object.getPrototypeOf(x);return N===null?void 0:m(N,S,w)}else{if("value"in T)return T.value;var A=T.get;return A===void 0?void 0:A.call(w)}},o=i(0),l=d(o),h=i(4),c=d(h),f=i(25),u=d(f);function d(m){return m&&m.__esModule?m:{default:m}}function p(m,x,S){return x in m?Object.defineProperty(m,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[x]=S,m}function v(m,x){if(!(m instanceof x))throw new TypeError("Cannot call a class as a function")}function g(m,x){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:m}function y(m,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);m.prototype=Object.create(x&&x.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(m,x):m.__proto__=x)}var b=function(m){y(x,m);function x(){return v(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(w,T){w===_.blotName&&!T?this.replaceWith(l.default.create(this.statics.scope)):a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,T)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(w,T){return this.parent.isolate(this.offset(this.parent),this.length()),w===this.parent.statics.blotName?(this.parent.replaceWith(w,T),this):(this.parent.unwrap(),a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,w,T))}}],[{key:"formats",value:function(w){return w.tagName===this.tagName?void 0:a(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,w)}}]),x}(c.default);b.blotName="list-item",b.tagName="LI";var _=function(m){y(x,m),s(x,null,[{key:"create",value:function(w){var T=w==="ordered"?"OL":"UL",N=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,T);return(w==="checked"||w==="unchecked")&&N.setAttribute("data-checked",w==="checked"),N}},{key:"formats",value:function(w){if(w.tagName==="OL")return"ordered";if(w.tagName==="UL")return w.hasAttribute("data-checked")?w.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function x(S){v(this,x);var w=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,S)),T=function(A){if(A.target.parentNode===S){var E=w.statics.formats(S),O=l.default.find(A.target);E==="checked"?O.format("list","unchecked"):E==="unchecked"&&O.format("list","checked")}};return S.addEventListener("touchstart",T),S.addEventListener("mousedown",T),w}return s(x,[{key:"format",value:function(w,T){this.children.length>0&&this.children.tail.format(w,T)}},{key:"formats",value:function(){return p({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(w,T){if(w instanceof b)a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,w,T);else{var N=T==null?this.length():T.offset(this),A=this.split(N);A.parent.insertBefore(w,A)}}},{key:"optimize",value:function(w){a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,w);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&T.domNode.tagName===this.domNode.tagName&&T.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(T.moveChildren(this),T.remove())}},{key:"replace",value:function(w){if(w.statics.blotName!==this.statics.blotName){var T=l.default.create(this.statics.defaultChild);w.moveChildren(T),this.appendChild(T)}a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,w)}}]),x}(u.default);_.blotName="list",_.scope=l.default.Scope.BLOCK_BLOT,_.tagName=["OL","UL"],_.defaultChild="list-item",_.allowedChildren=[b],n.ListItem=b,n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(56),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function h(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="italic",f.tagName=["EM","I"],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(6),l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"create",value:function(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.tagName==="SUP")return"super"}}]),v}(l.default);d.blotName="script",d.tagName=["SUB","SUP"],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function h(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="strike",f.tagName="S",n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function h(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="underline",f.tagName="U",n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(0),l=c(o),h=i(27);function c(g){return g&&g.__esModule?g:{default:g}}function f(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function u(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function d(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p=["alt","height","width"],v=function(g){d(y,g);function y(){return f(this,y),u(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"format",value:function(_,m){p.indexOf(_)>-1?m?this.domNode.setAttribute(_,m):this.domNode.removeAttribute(_):a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,_);return typeof _=="string"&&m.setAttribute("src",this.sanitize(_)),m}},{key:"formats",value:function(_){return p.reduce(function(m,x){return _.hasAttribute(x)&&(m[x]=_.getAttribute(x)),m},{})}},{key:"match",value:function(_){return/\.(jpe?g|gif|png)$/.test(_)||/^data:image\/.+;base64/.test(_)}},{key:"sanitize",value:function(_){return(0,h.sanitize)(_,["http","https","data"])?_:"//:0"}},{key:"value",value:function(_){return _.getAttribute("src")}}]),y}(l.default.Embed);v.blotName="image",v.tagName="IMG",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(4),l=i(27),h=c(l);function c(g){return g&&g.__esModule?g:{default:g}}function f(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function u(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function d(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p=["height","width"],v=function(g){d(y,g);function y(){return f(this,y),u(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"format",value:function(_,m){p.indexOf(_)>-1?m?this.domNode.setAttribute(_,m):this.domNode.removeAttribute(_):a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,_);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(_)),m}},{key:"formats",value:function(_){return p.reduce(function(m,x){return _.hasAttribute(x)&&(m[x]=_.getAttribute(x)),m},{})}},{key:"sanitize",value:function(_){return h.default.sanitize(_)}},{key:"value",value:function(_){return _.getAttribute("src")}}]),y}(o.BlockEmbed);v.blotName="video",v.className="ql-video",v.tagName="IFRAME",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var s=function(){function _(m,x){for(var S=0;S<x.length;S++){var w=x[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),a=function _(m,x,S){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var T=Object.getPrototypeOf(m);return T===null?void 0:_(T,x,S)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(S)}},o=i(35),l=d(o),h=i(5),c=d(h),f=i(9),u=d(f);function d(_){return _&&_.__esModule?_:{default:_}}function p(_,m){if(!(_ instanceof m))throw new TypeError("Cannot call a class as a function")}function v(_,m){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:_}function g(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);_.prototype=Object.create(m&&m.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(_,m):_.__proto__=m)}var y=function(_){g(m,_);function m(){return p(this,m),v(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,null,[{key:"create",value:function(S){var w=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,S);return typeof S=="string"&&(window.katex.render(S,w,{throwOnError:!1,errorColor:"#f00"}),w.setAttribute("data-value",S)),w}},{key:"value",value:function(S){return S.getAttribute("data-value")}}]),m}(l.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var b=function(_){g(m,_),s(m,null,[{key:"register",value:function(){c.default.register(y,!0)}}]);function m(){p(this,m);var x=v(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return x}return m}(u.default);n.FormulaBlot=y,n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=function(){function S(w,T){for(var N=0;N<T.length;N++){var A=T[N];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,T,N){return T&&S(w.prototype,T),N&&S(w,N),w}}(),a=function S(w,T,N){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,T);if(A===void 0){var E=Object.getPrototypeOf(w);return E===null?void 0:S(E,T,N)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(N)}},o=i(0),l=v(o),h=i(5),c=v(h),f=i(9),u=v(f),d=i(13),p=v(d);function v(S){return S&&S.__esModule?S:{default:S}}function g(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function y(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function b(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var _=function(S){b(w,S);function w(){return g(this,w),y(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return s(w,[{key:"replaceWith",value:function(N){this.domNode.textContent=this.domNode.textContent,this.attach(),a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replaceWith",this).call(this,N)}},{key:"highlight",value:function(N){var A=this.domNode.textContent;this.cachedText!==A&&((A.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=N(A),this.domNode.normalize(),this.attach()),this.cachedText=A)}}]),w}(p.default);_.className="ql-syntax";var m=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),x=function(S){b(w,S),s(w,null,[{key:"register",value:function(){c.default.register(m,!0),c.default.register(_,!0)}}]);function w(T,N){g(this,w);var A=y(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,T,N));if(typeof A.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var E=null;return A.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(E),E=setTimeout(function(){A.highlight(),E=null},A.options.interval)}),A.highlight(),A}return s(w,[{key:"highlight",value:function(){var N=this;if(!this.quill.selection.composing){this.quill.update(c.default.sources.USER);var A=this.quill.getSelection();this.quill.scroll.descendants(_).forEach(function(E){E.highlight(N.options.highlight)}),this.quill.update(c.default.sources.SILENT),A!=null&&this.quill.setSelection(A,c.default.sources.SILENT)}}}]),w}(u.default);x.DEFAULTS={highlight:function(){return window.hljs==null?null:function(S){var w=window.hljs.highlightAuto(S);return w.value}}(),interval:1e3},n.CodeBlock=_,n.CodeToken=m,n.default=x},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var s=function w(T,N,A){T===null&&(T=Function.prototype);var E=Object.getOwnPropertyDescriptor(T,N);if(E===void 0){var O=Object.getPrototypeOf(T);return O===null?void 0:w(O,N,A)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(A)}},a=function(){function w(T,N){for(var A=0;A<N.length;A++){var E=N[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(T,E.key,E)}}return function(T,N,A){return N&&w(T.prototype,N),A&&w(T,A),T}}(),o=i(3),l=g(o),h=i(8),c=g(h),f=i(43),u=g(f),d=i(15),p=i(41),v=g(p);function g(w){return w&&w.__esModule?w:{default:w}}function y(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function b(w,T){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:w}function _(w,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);w.prototype=Object.create(T&&T.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(w,T):w.__proto__=T)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(w){_(T,w);function T(N,A){y(this,T),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=m);var E=b(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,N,A));return E.quill.container.classList.add("ql-bubble"),E}return a(T,[{key:"extendToolbar",value:function(A){this.tooltip=new S(this.quill,this.options.bounds),this.tooltip.root.appendChild(A.container),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),v.default)}}]),T}(u.default);x.DEFAULTS=(0,l.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){T?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var S=function(w){_(T,w);function T(N,A){y(this,T);var E=b(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,N,A));return E.quill.on(c.default.events.EDITOR_CHANGE,function(O,R,C,F){if(O===c.default.events.SELECTION_CHANGE)if(R!=null&&R.length>0&&F===c.default.sources.USER){E.show(),E.root.style.left="0px",E.root.style.width="",E.root.style.width=E.root.offsetWidth+"px";var U=E.quill.getLines(R.index,R.length);if(U.length===1)E.position(E.quill.getBounds(R));else{var D=U[U.length-1],z=E.quill.getIndex(D),j=Math.min(D.length()-1,R.index+R.length-z),k=E.quill.getBounds(new d.Range(z,j));E.position(k)}}else document.activeElement!==E.textbox&&E.quill.hasFocus()&&E.hide()}),E}return a(T,[{key:"listen",value:function(){var A=this;s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){A.root.classList.remove("ql-editing")}),this.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!A.root.classList.contains("ql-hidden")){var E=A.quill.getSelection();E!=null&&A.position(A.quill.getBounds(E))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(A){var E=s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"position",this).call(this,A),O=this.root.querySelector(".ql-tooltip-arrow");if(O.style.marginLeft="",E===0)return E;O.style.marginLeft=-1*E-O.offsetWidth/2+"px"}}]),T}(f.BaseTooltip);S.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=S,n.default=x},function(r,n,i){r.exports=i(63)}]).default})})(Mh);var kT=Mh.exports;const PT=or(kT),zT="",MT=e=>{const[t,r]=J.useState(!1);console.log("allProps",e);const n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),a=J.useRef(null),o=J.useRef(16),l=J.useRef(null),{uniqueId:h,text:c,locked:f,transformation:u,onTextUpdate:d,pointerdown:p,pointerup:v,mousedown:g,mouseup:y,pointerover:b,mouseover:_,mouseout:m}=e,{scale:x=[1,1],x:S,y:w,rotation:T=1,fontFamily:N="Arial",fontWeight:A="normal",fontStyle:E="normal",fontSize:O=16,fill:R="black",stroke:C,strokeThickness:F,blurRadius:U=0,blurEnabled:D=!1,dropShadowColor:z=null,wordWrapWidth:j=5e7,leading:k=0,letterSpacing:I}=u;lt.useEffect(()=>{o.current=Number(O)},[O]);const P=["italic","oblique"].includes(E)?E:void 0,L=["bold","lighter","100","200","300"].includes(A)?A:void 0,G=Number(I)>0?I:void 0,$=lt.useMemo(()=>new ne.TextStyle({fontFamily:N,fontSize:O,fill:R||"white",stroke:C,strokeThickness:F,...P&&{fontStyle:P},...L&&{fontWeight:L},...G&&{letterSpacing:G},...D&&{dropShadow:!0,dropShadowBlur:Number(U),dropShadowColor:(z==null?void 0:z.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:j||500,leading:k||0}),[D,U,R,N,O,k,P,L,G,z,C,F,j]);lt.useEffect(()=>{l.current={...u}},[u]);const M=B=>{d&&d({text:B,uniqueId:h,droptype:"titles"})};return lt.useEffect(()=>{if(t&&s.current){let q=document.getElementById("note-editor");if(q){q.style.position="absolute",q.style.zIndex="10",q.style.left=S+"px",q.style.top=w+"px",q.style.backgroundColor="var(--chakra-color-darkShark)",q.style.transform="scale(1.5)",q.style.width="300px",q.style.height="100px",q.style.color="#fff",q.style.fontSize="20px",q.style.border="1px solid #CBCEE0";const H={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var B=new PT("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...H}}},placeholder:"Compose your text here...",theme:"snow"});B.on("text-change",function(){M(B.root.innerText)}),B.setText(c),B.focus(),B.off("text-change",()=>{console.log("removed")}),B.hasFocus()||(q.style.display="none")}}},[S,w,t]),ft.jsx(Ea,{...e,children:ft.jsxs(yt.Container,{ref:n,children:[t&&ft.jsx(yt.Container,{ref:s}),ft.jsx(yt.Container,{alpha:t?0:1,ref:a,children:ft.jsx(yt.Text,{style:$,x:S,y:w,rotation:T,anchor:.5,text:c,...!t&&!f&&{interactive:!0,buttonMode:!0,pointerdown:p,pointerout:m,pointerover:b,pointerup:v,mousedown:g,mouseup:y,mouseover:_},ref:i,scale:x})})]})})},LT=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:Zs,matrix:ne.filters.ColorMatrixFilter}),FT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],BT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},DT=e=>{const[t,r]=lt.useState(!1),[,n]=J.useState(!1),[,i]=lt.useState({isWaiting:!1,isStalled:!1}),[s,a]=lt.useState(),[o,l]=J.useState(!1),h=J.useRef(null),c=J.useRef(null),f=J.useRef(null),u=J.useRef(null),d=J.useRef(null),p=J.useRef(null),v=J.useRef(BT),{tl:g,playerTimeRef:y,isDragging:b}=J.useContext(Mr),{uniqueId:_,mute:m=!1,locked:x=!1,src:S,startAt:w,endAt:T,frameStartAt:N,frameEndAt:A,initialAlpha:E,transformation:{x:O,y:R,width:C,height:F,scale:U,rotation:D,animation:z,colorCorrection:j,effect:k},pointerdown:I,pointerup:P,mousedown:L,mouseup:G,pointerover:$,mouseover:M,mouseout:B,applyTransformer:q,onAnchorTransformationEnd:H}=e,X=S||"",{contrast:K=1,saturation:et=1,exposure:it=1,blurRadius:ot=0,alpha:ht=1}=j||{},Ct={brightness:it,contrast:K,saturation:et,alpha:ht},It=lt.useCallback(()=>{l(!0)},[]),V=lt.useCallback(Z=>{console.log("changeEnd",Z),H&&(console.log("running onAnchorTransformationEnd"),H(Z))},[]),W=lt.useMemo(()=>{const Z=document.createElement("video");return Z.src=S,Z.crossOrigin="Anonymus",Z.autoplay=!1,Z.currentTime=1e-4,Z},[S]);un(je.PAUSE,Z=>{if(console.log("pause event",Z),p.current){const at=p.current;at.currentTime>0&&!at.paused&&!at.ended&&at.readyState>at.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}}),lt.useEffect(()=>{console.log("current",p.current,b),p.current&&(b?(p.current.pause(),v.current.isPlaying=!1,v.current.isDragging=!0):v.current.isDragging=!1)},[b]);const Q=Z=>{p.current&&(console.log("video gsapOnStart",y.current,b),y.current>=Z&&y.current<=T&&!b&&(p.current.currentTime=Number(N)||Number(Z),p.current.play(),v.current.isPlaying=!0))},tt=()=>{if(console.log("onComplete triggered"),p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}},Y=()=>{},ct=()=>{if(p.current){Math.abs(p.current.currentTime-y.current);const Z=p.current,at=Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA;v.current.isDragging?(console.log("video updating",y.current),p.current.currentTime=y.current,p.current.play(),setTimeout(()=>{v.current.isPlaying=!1,p.current&&p.current.pause()},55),v.current.isPlaying=!1):v.current.isPlaying||(at||p.current.play(),v.current.isPlaying=!0)}};return J.useEffect(()=>{let Z=ye.context(()=>{});if(c.current&&g.current){const at={duration:Number(T)-Number(w),onStart:Q,onComplete:tt,onStartParams:[w],onCompleteParams:[],onInterrupt:Y,onUpdate:ct,onUpdateParams:[]},St=ha(z||"None");Z=ye.context(()=>{var Ht,_t;ee(St.from)?ee(St.to)?ee(St.fromTo)?g.current.to(c.current,{alpha:1,duration:.01},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.1},Number(T)-.1):g.current.fromTo(c.current,(Ht=St.fromTo)==null?void 0:Ht.from,(_t=St.fromTo)==null?void 0:_t.to,w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},T-.2):g.current.to(c.current,{alpha:1,duration:.2,...St.to},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},T-.2):g.current.from(c.current,{...St.from},w).to(u.current,{alpha:1,duration:.2},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},T-.2)})}return()=>Z.revert()},[z,w,T]),lt.useEffect(()=>{c.current&&r(!0)},[]),lt.useEffect(()=>{p.current&&(p.current.muted=m)},[m]),lt.useEffect(()=>{if(p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&(o||b)&&(p.current.pause(),v.current.isPlaying=!1)}},[o,b]),lt.useEffect(()=>{const Z=Math.round((Number(N)+Number.EPSILON)*100)/100,at=function(){p.current&&(p.current.currentTime=Z)},St=function(){if(p.current){const zt=p.current;zt.currentTime>0&&!zt.paused&&!zt.ended&&zt.readyState>zt.HAVE_CURRENT_DATA&&p.current.pause()}i({isWaiting:!1,isStalled:!1})},Ht=function(){p.current&&p.current.pause(),i({isWaiting:!0,isStalled:!1})},_t=function(){i({isWaiting:!1,isStalled:!1})},Et=function(){i({isWaiting:!1,isStalled:!0})},Tt=Math.round((Number(N)+Number.EPSILON)*100)/100,Bt=Math.round((Number(A)+Number.EPSILON)*100)/100,pe=`${X}#t=${Tt},${Bt}`;return console.log("urlTimestap",pe),ne.Texture.fromLoader(W,pe,_,{pixiIdPrefix:_,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(zt=>{zt&&(a(zt),console.log(zt.baseTexture.resource.source),p.current=zt.baseTexture.resource.source,p.current.id=_,p.current.addEventListener("loadedmetadata",at),p.current.addEventListener("ended",St),p.current.addEventListener("loadstart",Ht),p.current.addEventListener("canplaythrough",_t),p.current.addEventListener("stalled",Et))}),()=>{p.current.removeEventListener("loadedmetadata",at),p.current.removeEventListener("ended",St),p.current.removeEventListener("loadstart",Ht),p.current.removeEventListener("canplaythrough",_t),p.current.removeEventListener("stalled",Et)}},[X,_,N,A,W]),ft.jsxs(yt.Container,{ref:f,children:[ft.jsx(yt.Container,{ref:c,alpha:E,position:[O,R],pivot:[O,R],width:C,height:F,children:ft.jsx(LT,{scale:1,blur:{blur:ot,quality:4},adjust:Ct,apply:({matrix:Z})=>{k==="BlackAndWhite"?Z.desaturate():k==="Sepia"?Z.sepia():k==="RetroVintage"||k==="NightVision"?Z.negative():k==="Normal"&&Z.reset()},matrix:{enabled:!0,matrix:FT},children:ft.jsx(yt.Container,{ref:u,children:s&&ft.jsx(yt.Sprite,{texture:s,width:C,height:F,anchor:.5,x:O,y:R,...!x&&!o&&{interactive:!0,buttonMode:!0,pointerdown:I,pointerover:$,pointerout:B,mousedown:L,mouseover:M,mouseout:B,mouseup:G,pointerup:P},ref:h,scale:U,rotation:D})})})}),q&&ft.jsx(la,{pixiTransformerRef:d,imageRef:c,isMounted:t,transformCommit:V,transformChange:It,mouseoverEvent:n,uniqueId:_})]})};var Lh=(e=>(e.FADE_IN="FADE_IN",e.FADE_OUT="FADE_OUT",e.FADE_IN_OUT="FADE_IN_OUT",e.SLIDE_IN_LEFT="SLIDE_IN_LEFT",e.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",e.SLIDE_IN_TOP="SLIDE_IN_TOP",e.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",e.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",e.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",e.SLIDE_OUT_TOP="SLIDE_OUT_TOP",e.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e.ZOOM_IN_OUT="ZOOM_IN_OUT",e.BOUNCE_IN="BOUNCE_IN",e.BOUNCE_OUT="BOUNCE_OUT",e.BOUNCE_IN_OUT="BOUNCE_IN_OUT",e.ELASTIC_IN="ELASTIC_IN",e.ELASTIC_OUT="ELASTIC_OUT",e.ELASTIC_IN_OUT="ELASTIC_IN_OUT",e.BACK_IN="BACK_IN",e.BACK_OUT="BACK_OUT",e.BACK_IN_OUT="BACK_IN_OUT",e.CIRCULAR_IN="CIRCULAR_IN",e.CIRCULAR_OUT="CIRCULAR_OUT",e.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",e.EXPO_IN="EXPO_IN",e.EXPO_OUT="EXPO_OUT",e.EXPO_IN_OUT="EXPO_IN_OUT",e.SINE_IN="SINE_IN",e.SINE_OUT="SINE_OUT",e.SINE_IN_OUT="SINE_IN_OUT",e.BOUNCE="BOUNCE",e.ELASTIC="ELASTIC",e.BACK="BACK",e.CIRCULAR="CIRCULAR",e.EXPO="EXPO",e.SINE="SINE",e))(Lh||{}),Fh=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e))(Fh||{});Lt.Animations=Lh,Lt.BlendModes=Fh,Lt.Events=je,Lt.GsapPixieContext=Mr,Lt.GsapPixieContextProvider=Gy,Lt.PixiAnimatedSprite=Ph,Lt.PixiAudioSprite=q0,Lt.PixiGifSprite=CT,Lt.PixiImageSprite=Dg,Lt.PixiSvgPathSprite=$0,Lt.PixiTextSprite=MT,Lt.PixiVideoSprite=DT,Object.defineProperty(Lt,Symbol.toStringTag,{value:"Module"})});