@drincs/pixi-vn 1.8.25 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/{ContainerMemory-D2HtgX7w.d.cts → ContainerMemory-BpDgacyr.d.cts} +2 -15
- package/dist/{ContainerMemory-D2HtgX7w.d.ts → ContainerMemory-BpDgacyr.d.ts} +2 -15
- package/dist/{HistoryChoiceMenuOption-DVMD78W7.d.cts → HistoryChoiceMenuOption-BxMSXnyI.d.cts} +1 -1
- package/dist/{HistoryChoiceMenuOption-B8RfQz5H.d.ts → HistoryChoiceMenuOption-hSI4SHV-.d.ts} +1 -1
- package/dist/{HistoryGameState-CmjUtlkV.d.ts → HistoryGameState-C8ATx9K6.d.ts} +1 -1
- package/dist/{HistoryGameState-C28NcKKl.d.cts → HistoryGameState-CGfvq5iL.d.cts} +1 -1
- package/dist/{HistoryStep-G9dUn0Lf.d.cts → HistoryStep-WGB6nA4N.d.cts} +5 -0
- package/dist/{HistoryStep-G9dUn0Lf.d.ts → HistoryStep-WGB6nA4N.d.ts} +5 -0
- package/dist/{OpenedLabel-DLfFuZgk.d.ts → OpenedLabel-CmRdzTXP.d.ts} +1 -1
- package/dist/{OpenedLabel-BxfL31aQ.d.cts → OpenedLabel-Cmd675NI.d.cts} +1 -1
- package/dist/SoundGameState-C_6ZsQX6.d.cts +186 -0
- package/dist/SoundGameState-C_6ZsQX6.d.ts +186 -0
- package/dist/{StorageGameState-CtjNJpvE.d.cts → StorageGameState-C3PGrFPr.d.cts} +2 -2
- package/dist/{StorageGameState-BJy57o6K.d.ts → StorageGameState-jAexrJLj.d.ts} +2 -2
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +265 -24
- package/dist/canvas.d.ts +265 -24
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/chunk-HD353M4B.mjs +1 -0
- package/dist/chunk-I7DOUH5V.mjs +1 -0
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +38 -15
- package/dist/history.d.ts +38 -15
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +32 -34
- package/dist/index.d.ts +32 -34
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +196 -52
- package/dist/narration.d.ts +196 -52
- package/dist/narration.mjs +2 -2
- package/dist/pixi/browser.js +115 -115
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +313 -6
- package/dist/sound.d.ts +313 -6
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +50 -3
- package/dist/storage.d.ts +50 -3
- package/dist/storage.mjs +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.mjs +2 -2
- package/package.json +2 -1
- package/dist/SoundManagerInterface-Dd0b88_N.d.cts +0 -436
- package/dist/SoundManagerInterface-Dd0b88_N.d.ts +0 -436
- package/dist/chunk-GIYMPXBT.mjs +0 -1
- package/dist/chunk-IWAXXFXE.mjs +0 -1
package/dist/pixi/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var nw=Object.create;var Sp=Object.defineProperty;var ow=Object.getOwnPropertyDescriptor;var aw=Object.getOwnPropertyNames;var uw=Object.getPrototypeOf,lw=Object.prototype.hasOwnProperty;var x=(r,t)=>()=>(r&&(t=r(r=0)),t);var hi=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ec=(r,t)=>{for(var e in t)Sp(r,e,{get:t[e],enumerable:!0})},cw=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of aw(t))!lw.call(r,i)&&i!==e&&Sp(r,i,{get:()=>t[i],enumerable:!(s=ow(t,i))||s.enumerable});return r};var O1=(r,t,e)=>(e=r!=null?nw(uw(r)):{},cw(t||!r||!r.__esModule?Sp(e,"default",{value:r,enumerable:!0}):e,r));var m,Ep,Oa,O,C=x(()=>{"use strict";m=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.TextureUploaderWebGL="texture-uploader-webgl",r.TextureUploaderWebGPU="texture-uploader-webgpu",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(m||{}),Ep=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Oa=(r,t)=>Ep(r).priority??t,O={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Ep).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...r){return r.map(Ep).forEach(t=>{t.type.forEach(e=>{let s=this._addHandlers,i=this._queue;s[e]?s[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))})}),this},handle(r,t,e){let s=this._addHandlers,i=this._removeHandlers;if(s[r]||i[r])throw new Error(`Extension type ${r} already has a handler`);s[r]=t,i[r]=e;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>t(o)),delete n[r]),this},handleByMap(r,t){return this.handle(r,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(r,t,e=-1){return this.handle(r,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>Oa(o.value,e)-Oa(n.value,e)))},s=>{let i=t.findIndex(n=>n.name===s.name);i!==-1&&t.splice(i,1)})},handleByList(r,t,e=-1){return this.handle(r,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((i,n)=>Oa(n,e)-Oa(i,e)))},s=>{let i=t.indexOf(s.ref);i!==-1&&t.splice(i,1)})},mixin(r,...t){for(let e of t)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(e))}}});var N1=hi((bD,Cp)=>{"use strict";var hw=Object.prototype.hasOwnProperty,Ge="~";function La(){}Object.create&&(La.prototype=Object.create(null),new La().__proto__||(Ge=!1));function dw(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function L1(r,t,e,s,i){if(typeof e!="function")throw new TypeError("The listener must be a function");var n=new dw(e,s||r,i),o=Ge?Ge+t:t;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Cc(r,t){--r._eventsCount===0?r._events=new La:delete r._events[t]}function ve(){this._events=new La,this._eventsCount=0}ve.prototype.eventNames=function(){var t=[],e,s;if(this._eventsCount===0)return t;for(s in e=this._events)hw.call(e,s)&&t.push(Ge?s.slice(1):s);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};ve.prototype.listeners=function(t){var e=Ge?Ge+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,n=s.length,o=new Array(n);i<n;i++)o[i]=s[i].fn;return o};ve.prototype.listenerCount=function(t){var e=Ge?Ge+t:t,s=this._events[e];return s?s.fn?1:s.length:0};ve.prototype.emit=function(t,e,s,i,n,o){var a=Ge?Ge+t:t;if(!this._events[a])return!1;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,s),!0;case 4:return u.fn.call(u.context,e,s,i),!0;case 5:return u.fn.call(u.context,e,s,i,n),!0;case 6:return u.fn.call(u.context,e,s,i,n,o),!0}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c)}else{var d=u.length,f;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,s);break;case 4:u[h].fn.call(u[h].context,e,s,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];u[h].fn.apply(u[h].context,c)}}return!0};ve.prototype.on=function(t,e,s){return L1(this,t,e,s,!1)};ve.prototype.once=function(t,e,s){return L1(this,t,e,s,!0)};ve.prototype.removeListener=function(t,e,s,i){var n=Ge?Ge+t:t;if(!this._events[n])return this;if(!e)return Cc(this,n),this;var o=this._events[n];if(o.fn)o.fn===e&&(!i||o.once)&&(!s||o.context===s)&&Cc(this,n);else{for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==e||i&&!o[a].once||s&&o[a].context!==s)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Cc(this,n)}return this};ve.prototype.removeAllListeners=function(t){var e;return t?(e=Ge?Ge+t:t,this._events[e]&&Cc(this,e)):(this._events=new La,this._eventsCount=0),this};ve.prototype.off=ve.prototype.removeListener;ve.prototype.addListener=ve.prototype.on;ve.prefixed=Ge;ve.EventEmitter=ve;typeof Cp<"u"&&(Cp.exports=ve)});var H1,St,le=x(()=>{"use strict";H1=O1(N1(),1),St=H1.default});var fw,es,ce,ar,q1,W1,Ap,pw,Ac,K1,Z1,V1,z1,X1,Na,mw,gw,xw,_w,Bp,$1,bw,wp,Pp,Y1,Rp,gr,j1,Q1,J1=x(()=>{"use strict";fw={grad:.9,turn:360,rad:360/(2*Math.PI)},es=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},ce=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},ar=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},q1=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},W1=function(r){return{r:ar(r.r,0,255),g:ar(r.g,0,255),b:ar(r.b,0,255),a:ar(r.a)}},Ap=function(r){return{r:ce(r.r),g:ce(r.g),b:ce(r.b),a:ce(r.a,3)}},pw=/^#([0-9a-f]{3,8})$/i,Ac=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},K1=function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=Math.max(t,e,s),o=n-Math.min(t,e,s),a=o?n===t?(e-s)/o:n===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:i}},Z1=function(r){var t=r.h,e=r.s,s=r.v,i=r.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),o=s*(1-e),a=s*(1-(t-n)*e),u=s*(1-(1-t+n)*e),l=n%6;return{r:255*[s,a,o,o,u,s][l],g:255*[u,s,s,a,o,o][l],b:255*[o,o,u,s,s,a][l],a:i}},V1=function(r){return{h:q1(r.h),s:ar(r.s,0,100),l:ar(r.l,0,100),a:ar(r.a)}},z1=function(r){return{h:ce(r.h),s:ce(r.s),l:ce(r.l),a:ce(r.a,3)}},X1=function(r){return Z1((e=(t=r).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Na=function(r){return{h:(t=K1(r)).h,s:(i=(200-(e=t.s))*(s=t.v)/100)>0&&i<200?e*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,s,i},mw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xw=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_w=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bp={string:[[function(r){var t=pw.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?ce(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?ce(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=xw.exec(r)||_w.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:W1({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(r){var t=mw.exec(r)||gw.exec(r);if(!t)return null;var e,s,i=V1({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(fw[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return X1(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=i===void 0?1:i;return es(t)&&es(e)&&es(s)?W1({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(r){var t=r.h,e=r.s,s=r.l,i=r.a,n=i===void 0?1:i;if(!es(t)||!es(e)||!es(s))return null;var o=V1({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return X1(o)},"hsl"],[function(r){var t=r.h,e=r.s,s=r.v,i=r.a,n=i===void 0?1:i;if(!es(t)||!es(e)||!es(s))return null;var o=(function(a){return{h:q1(a.h),s:ar(a.s,0,100),v:ar(a.v,0,100),a:ar(a.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return Z1(o)},"hsv"]]},$1=function(r,t){for(var e=0;e<t.length;e++){var s=t[e][0](r);if(s)return[s,t[e][1]]}return[null,void 0]},bw=function(r){return typeof r=="string"?$1(r.trim(),Bp.string):typeof r=="object"&&r!==null?$1(r,Bp.object):[null,void 0]},wp=function(r,t){var e=Na(r);return{h:e.h,s:ar(e.s+100*t,0,100),l:e.l,a:e.a}},Pp=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Y1=function(r,t){var e=Na(r);return{h:e.h,s:e.s,l:ar(e.l+100*t,0,100),a:e.a}},Rp=(function(){function r(t){this.parsed=bw(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return ce(Pp(this.rgba),2)},r.prototype.isDark=function(){return Pp(this.rgba)<.5},r.prototype.isLight=function(){return Pp(this.rgba)>=.5},r.prototype.toHex=function(){return t=Ap(this.rgba),e=t.r,s=t.g,i=t.b,o=(n=t.a)<1?Ac(ce(255*n)):"","#"+Ac(e)+Ac(s)+Ac(i)+o;var t,e,s,i,n,o},r.prototype.toRgb=function(){return Ap(this.rgba)},r.prototype.toRgbString=function(){return t=Ap(this.rgba),e=t.r,s=t.g,i=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+i+", "+n+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,n},r.prototype.toHsl=function(){return z1(Na(this.rgba))},r.prototype.toHslString=function(){return t=z1(Na(this.rgba)),e=t.h,s=t.s,i=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+n+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,n},r.prototype.toHsv=function(){return t=K1(this.rgba),{h:ce(t.h),s:ce(t.s),v:ce(t.v),a:ce(t.a,3)};var t},r.prototype.invert=function(){return gr({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),gr(wp(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),gr(wp(this.rgba,-t))},r.prototype.grayscale=function(){return gr(wp(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),gr(Y1(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),gr(Y1(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?gr({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ce(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Na(this.rgba);return typeof t=="number"?gr({h:t,s:e.s,l:e.l,a:e.a}):ce(e.h)},r.prototype.isEqual=function(t){return this.toHex()===gr(t).toHex()},r})(),gr=function(r){return r instanceof Rp?r:new Rp(r)},j1=[],Q1=function(r){r.forEach(function(t){j1.indexOf(t)<0&&(t(Rp,Bp),j1.push(t))})}});function tT(r,t){var e={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"},s={};for(var i in e)s[e[i]]=i;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,u,l=s[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var f in e)n[f]=new r(e[f]).toRgb();for(var p in e){var g=(a=c,u=n[p],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));g<h&&(h=g,d=p)}return d}},t.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":e[a];return u?new r(u).toRgb():null},"name"])}var eT=x(()=>{"use strict"});var Tn,X,It=x(()=>{"use strict";J1();eT();Q1([tT]);Tn=class Ha{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}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(t){return this.value=t,this}set value(t){if(t instanceof Ha)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){let s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>n===e[o]);if(t!==null&&e!==null){let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){let[t,e,s,i]=this._components;return{r:t,g:e,b:s,a:i}}toRgb(){let[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){let[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){let[e,s,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(i*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);let[e,s,i,n]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);let[e,s,i]=this._components;return t[0]=e,t[1]=s,t[2]=i,t}toNumber(){return this._int}toBgrNumber(){let[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){let t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){let[e,s,i,n]=Ha._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,i=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,i=i*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(i<<8)+n}toHex(){let t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let e,s,i,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){let o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,i=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,i,n=255]=t,e/=255,s/=255,i/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){let a=Ha.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}let o=gr(t);o.isValid()&&({r:e,g:s,b:i,a:n}=o.rgba,e/=255,s/=255,i/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=i,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ha||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Tn.shared=new Tn;Tn._temp=new Tn;Tn.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;X=Tn});var Mp,Dp=x(()=>{"use strict";Mp={cullArea:null,cullable:!1,cullableChildren:!0}});var Fp,Gp,Up,wc=x(()=>{"use strict";Fp=Math.PI*2,Gp=180/Math.PI,Up=Math.PI/180});var nt,Ip,Ue=x(()=>{"use strict";nt=class r{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new r(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,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Ip.x=0,Ip.y=0,Ip}},Ip=new nt});var F,yw,vw,ot=x(()=>{"use strict";wc();Ue();F=class r{constructor(t=1,e=0,s=0,i=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o}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,e,s,i,n,o){return this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));let s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new nt;let s=t.x,i=t.y;return e.x=this.a*s+this.c*i+this.tx,e.y=this.b*s+this.d*i+this.ty,e}applyInverse(t,e){e=e||new nt;let s=this.a,i=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(s*o+n*-i),c=t.x,h=t.y;return e.x=o*l*c+-n*l*h+(u*n-a*o)*l,e.y=s*l*h+-i*l*c+(-u*s+a*i)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){let e=Math.cos(t),s=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*s,this.b=i*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){let e=this.a,s=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}appendFrom(t,e){let s=t.a,i=t.b,n=t.c,o=t.d,a=t.tx,u=t.ty,l=e.a,c=e.b,h=e.c,d=e.d;return this.a=s*l+i*h,this.b=s*c+i*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+e.tx,this.ty=a*c+u*d+e.ty,this}setTransform(t,e,s,i,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=t-(s*this.a+i*this.c),this.ty=e-(s*this.b+i*this.d),this}prepend(t){let e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){let s=this.a,i=this.c;this.a=s*t.a+this.b*t.c,this.b=s*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=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){let e=this.a,s=this.b,i=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-i,n),u=Math.atan2(s,e),l=Math.abs(a+u);return l<1e-5||Math.abs(Fp-l)<1e-5?(t.rotation=u,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=u),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){let t=this.a,e=this.b,s=this.c,i=this.d,n=this.tx,o=t*i-e*s;return this.a=i/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new r;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}equals(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}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return vw.identity()}static get shared(){return yw.identity()}},yw=new F,vw=new F});var Et,Gs=x(()=>{"use strict";Et=class r{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new r(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),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.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}});function et(r="default"){return Wa[r]===void 0&&(Wa[r]=-1),++Wa[r]}function Tw(){for(let r in Wa)delete Wa[r]}var Wa,Yt=x(()=>{"use strict";Wa={default:-1}});var rT,V,kp,Sn,I,xt=x(()=>{"use strict";rT=new Set,V="8.0.0",kp="8.3.4",Sn={quiet:!1,noColor:!1},I=((r,t,e=3)=>{if(Sn.quiet||rT.has(t))return;let s=new Error().stack,i=`${t}
|
|
2
|
-
Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!
|
|
1
|
+
var ow=Object.create;var Ep=Object.defineProperty;var aw=Object.getOwnPropertyDescriptor;var uw=Object.getOwnPropertyNames;var lw=Object.getPrototypeOf,cw=Object.prototype.hasOwnProperty;var x=(r,t)=>()=>(r&&(t=r(r=0)),t);var fi=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ec=(r,t)=>{for(var e in t)Ep(r,e,{get:t[e],enumerable:!0})},hw=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uw(t))!cw.call(r,i)&&i!==e&&Ep(r,i,{get:()=>t[i],enumerable:!(s=aw(t,i))||s.enumerable});return r};var N1=(r,t,e)=>(e=r!=null?ow(lw(r)):{},hw(t||!r||!r.__esModule?Ep(e,"default",{value:r,enumerable:!0}):e,r));var m,Cp,La,O,C=x(()=>{"use strict";m=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.TextureUploaderWebGL="texture-uploader-webgl",r.TextureUploaderWebGPU="texture-uploader-webgpu",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(m||{}),Cp=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},La=(r,t)=>Cp(r).priority??t,O={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Cp).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...r){return r.map(Cp).forEach(t=>{t.type.forEach(e=>{let s=this._addHandlers,i=this._queue;s[e]?s[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))})}),this},handle(r,t,e){let s=this._addHandlers,i=this._removeHandlers;if(s[r]||i[r])throw new Error(`Extension type ${r} already has a handler`);s[r]=t,i[r]=e;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>t(o)),delete n[r]),this},handleByMap(r,t){return this.handle(r,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(r,t,e=-1){return this.handle(r,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>La(o.value,e)-La(n.value,e)))},s=>{let i=t.findIndex(n=>n.name===s.name);i!==-1&&t.splice(i,1)})},handleByList(r,t,e=-1){return this.handle(r,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((i,n)=>La(n,e)-La(i,e)))},s=>{let i=t.indexOf(s.ref);i!==-1&&t.splice(i,1)})},mixin(r,...t){for(let e of t)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(e))}}});var W1=fi((vD,Ap)=>{"use strict";var dw=Object.prototype.hasOwnProperty,Ge="~";function Na(){}Object.create&&(Na.prototype=Object.create(null),new Na().__proto__||(Ge=!1));function fw(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function H1(r,t,e,s,i){if(typeof e!="function")throw new TypeError("The listener must be a function");var n=new fw(e,s||r,i),o=Ge?Ge+t:t;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Cc(r,t){--r._eventsCount===0?r._events=new Na:delete r._events[t]}function ve(){this._events=new Na,this._eventsCount=0}ve.prototype.eventNames=function(){var t=[],e,s;if(this._eventsCount===0)return t;for(s in e=this._events)dw.call(e,s)&&t.push(Ge?s.slice(1):s);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};ve.prototype.listeners=function(t){var e=Ge?Ge+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,n=s.length,o=new Array(n);i<n;i++)o[i]=s[i].fn;return o};ve.prototype.listenerCount=function(t){var e=Ge?Ge+t:t,s=this._events[e];return s?s.fn?1:s.length:0};ve.prototype.emit=function(t,e,s,i,n,o){var a=Ge?Ge+t:t;if(!this._events[a])return!1;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,s),!0;case 4:return u.fn.call(u.context,e,s,i),!0;case 5:return u.fn.call(u.context,e,s,i,n),!0;case 6:return u.fn.call(u.context,e,s,i,n,o),!0}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c)}else{var d=u.length,f;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,s);break;case 4:u[h].fn.call(u[h].context,e,s,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];u[h].fn.apply(u[h].context,c)}}return!0};ve.prototype.on=function(t,e,s){return H1(this,t,e,s,!1)};ve.prototype.once=function(t,e,s){return H1(this,t,e,s,!0)};ve.prototype.removeListener=function(t,e,s,i){var n=Ge?Ge+t:t;if(!this._events[n])return this;if(!e)return Cc(this,n),this;var o=this._events[n];if(o.fn)o.fn===e&&(!i||o.once)&&(!s||o.context===s)&&Cc(this,n);else{for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==e||i&&!o[a].once||s&&o[a].context!==s)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Cc(this,n)}return this};ve.prototype.removeAllListeners=function(t){var e;return t?(e=Ge?Ge+t:t,this._events[e]&&Cc(this,e)):(this._events=new Na,this._eventsCount=0),this};ve.prototype.off=ve.prototype.removeListener;ve.prototype.addListener=ve.prototype.on;ve.prefixed=Ge;ve.EventEmitter=ve;typeof Ap<"u"&&(Ap.exports=ve)});var V1,St,le=x(()=>{"use strict";V1=N1(W1(),1),St=V1.default});var pw,es,ce,ar,Z1,z1,wp,mw,Ac,Q1,J1,X1,$1,Y1,Ha,gw,xw,_w,bw,Rp,j1,yw,Pp,Bp,q1,Mp,gr,K1,tT,eT=x(()=>{"use strict";pw={grad:.9,turn:360,rad:360/(2*Math.PI)},es=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},ce=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},ar=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},Z1=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},z1=function(r){return{r:ar(r.r,0,255),g:ar(r.g,0,255),b:ar(r.b,0,255),a:ar(r.a)}},wp=function(r){return{r:ce(r.r),g:ce(r.g),b:ce(r.b),a:ce(r.a,3)}},mw=/^#([0-9a-f]{3,8})$/i,Ac=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},Q1=function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=Math.max(t,e,s),o=n-Math.min(t,e,s),a=o?n===t?(e-s)/o:n===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:i}},J1=function(r){var t=r.h,e=r.s,s=r.v,i=r.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),o=s*(1-e),a=s*(1-(t-n)*e),u=s*(1-(1-t+n)*e),l=n%6;return{r:255*[s,a,o,o,u,s][l],g:255*[u,s,s,a,o,o][l],b:255*[o,o,u,s,s,a][l],a:i}},X1=function(r){return{h:Z1(r.h),s:ar(r.s,0,100),l:ar(r.l,0,100),a:ar(r.a)}},$1=function(r){return{h:ce(r.h),s:ce(r.s),l:ce(r.l),a:ce(r.a,3)}},Y1=function(r){return J1((e=(t=r).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Ha=function(r){return{h:(t=Q1(r)).h,s:(i=(200-(e=t.s))*(s=t.v)/100)>0&&i<200?e*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,s,i},gw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_w=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bw=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rp={string:[[function(r){var t=mw.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?ce(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?ce(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=_w.exec(r)||bw.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:z1({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(r){var t=gw.exec(r)||xw.exec(r);if(!t)return null;var e,s,i=X1({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(pw[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Y1(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=i===void 0?1:i;return es(t)&&es(e)&&es(s)?z1({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(r){var t=r.h,e=r.s,s=r.l,i=r.a,n=i===void 0?1:i;if(!es(t)||!es(e)||!es(s))return null;var o=X1({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return Y1(o)},"hsl"],[function(r){var t=r.h,e=r.s,s=r.v,i=r.a,n=i===void 0?1:i;if(!es(t)||!es(e)||!es(s))return null;var o=(function(a){return{h:Z1(a.h),s:ar(a.s,0,100),v:ar(a.v,0,100),a:ar(a.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return J1(o)},"hsv"]]},j1=function(r,t){for(var e=0;e<t.length;e++){var s=t[e][0](r);if(s)return[s,t[e][1]]}return[null,void 0]},yw=function(r){return typeof r=="string"?j1(r.trim(),Rp.string):typeof r=="object"&&r!==null?j1(r,Rp.object):[null,void 0]},Pp=function(r,t){var e=Ha(r);return{h:e.h,s:ar(e.s+100*t,0,100),l:e.l,a:e.a}},Bp=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},q1=function(r,t){var e=Ha(r);return{h:e.h,s:e.s,l:ar(e.l+100*t,0,100),a:e.a}},Mp=(function(){function r(t){this.parsed=yw(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return ce(Bp(this.rgba),2)},r.prototype.isDark=function(){return Bp(this.rgba)<.5},r.prototype.isLight=function(){return Bp(this.rgba)>=.5},r.prototype.toHex=function(){return t=wp(this.rgba),e=t.r,s=t.g,i=t.b,o=(n=t.a)<1?Ac(ce(255*n)):"","#"+Ac(e)+Ac(s)+Ac(i)+o;var t,e,s,i,n,o},r.prototype.toRgb=function(){return wp(this.rgba)},r.prototype.toRgbString=function(){return t=wp(this.rgba),e=t.r,s=t.g,i=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+i+", "+n+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,n},r.prototype.toHsl=function(){return $1(Ha(this.rgba))},r.prototype.toHslString=function(){return t=$1(Ha(this.rgba)),e=t.h,s=t.s,i=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+n+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,n},r.prototype.toHsv=function(){return t=Q1(this.rgba),{h:ce(t.h),s:ce(t.s),v:ce(t.v),a:ce(t.a,3)};var t},r.prototype.invert=function(){return gr({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),gr(Pp(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),gr(Pp(this.rgba,-t))},r.prototype.grayscale=function(){return gr(Pp(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),gr(q1(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),gr(q1(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?gr({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ce(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Ha(this.rgba);return typeof t=="number"?gr({h:t,s:e.s,l:e.l,a:e.a}):ce(e.h)},r.prototype.isEqual=function(t){return this.toHex()===gr(t).toHex()},r})(),gr=function(r){return r instanceof Mp?r:new Mp(r)},K1=[],tT=function(r){r.forEach(function(t){K1.indexOf(t)<0&&(t(Mp,Rp),K1.push(t))})}});function rT(r,t){var e={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"},s={};for(var i in e)s[e[i]]=i;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,u,l=s[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var f in e)n[f]=new r(e[f]).toRgb();for(var p in e){var g=(a=c,u=n[p],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));g<h&&(h=g,d=p)}return d}},t.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":e[a];return u?new r(u).toRgb():null},"name"])}var sT=x(()=>{"use strict"});var En,X,It=x(()=>{"use strict";eT();sT();tT([rT]);En=class Wa{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}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(t){return this.value=t,this}set value(t){if(t instanceof Wa)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){let s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>n===e[o]);if(t!==null&&e!==null){let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){let[t,e,s,i]=this._components;return{r:t,g:e,b:s,a:i}}toRgb(){let[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){let[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){let[e,s,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(i*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);let[e,s,i,n]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);let[e,s,i]=this._components;return t[0]=e,t[1]=s,t[2]=i,t}toNumber(){return this._int}toBgrNumber(){let[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){let t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){let[e,s,i,n]=Wa._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,i=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,i=i*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(i<<8)+n}toHex(){let t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let e,s,i,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){let o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,i=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,i,n=255]=t,e/=255,s/=255,i/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){let a=Wa.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}let o=gr(t);o.isValid()&&({r:e,g:s,b:i,a:n}=o.rgba,e/=255,s/=255,i/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=i,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Wa||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};En.shared=new En;En._temp=new En;En.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;X=En});var Dp,Fp=x(()=>{"use strict";Dp={cullArea:null,cullable:!1,cullableChildren:!0}});var Gp,Up,Ip,wc=x(()=>{"use strict";Gp=Math.PI*2,Up=180/Math.PI,Ip=Math.PI/180});var nt,kp,Ue=x(()=>{"use strict";nt=class r{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new r(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,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return kp.x=0,kp.y=0,kp}},kp=new nt});var F,vw,Tw,ot=x(()=>{"use strict";wc();Ue();F=class r{constructor(t=1,e=0,s=0,i=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o}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,e,s,i,n,o){return this.a=t,this.b=e,this.c=s,this.d=i,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));let s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new nt;let s=t.x,i=t.y;return e.x=this.a*s+this.c*i+this.tx,e.y=this.b*s+this.d*i+this.ty,e}applyInverse(t,e){e=e||new nt;let s=this.a,i=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(s*o+n*-i),c=t.x,h=t.y;return e.x=o*l*c+-n*l*h+(u*n-a*o)*l,e.y=s*l*h+-i*l*c+(-u*s+a*i)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){let e=Math.cos(t),s=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*s,this.b=i*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){let e=this.a,s=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}appendFrom(t,e){let s=t.a,i=t.b,n=t.c,o=t.d,a=t.tx,u=t.ty,l=e.a,c=e.b,h=e.c,d=e.d;return this.a=s*l+i*h,this.b=s*c+i*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+e.tx,this.ty=a*c+u*d+e.ty,this}setTransform(t,e,s,i,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=t-(s*this.a+i*this.c),this.ty=e-(s*this.b+i*this.d),this}prepend(t){let e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){let s=this.a,i=this.c;this.a=s*t.a+this.b*t.c,this.b=s*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=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){let e=this.a,s=this.b,i=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-i,n),u=Math.atan2(s,e),l=Math.abs(a+u);return l<1e-5||Math.abs(Gp-l)<1e-5?(t.rotation=u,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=u),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){let t=this.a,e=this.b,s=this.c,i=this.d,n=this.tx,o=t*i-e*s;return this.a=i/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new r;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}equals(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}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Tw.identity()}static get shared(){return vw.identity()}},vw=new F,Tw=new F});var Et,Us=x(()=>{"use strict";Et=class r{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new r(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),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.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}});function et(r="default"){return Va[r]===void 0&&(Va[r]=-1),++Va[r]}function Sw(){for(let r in Va)delete Va[r]}var Va,Yt=x(()=>{"use strict";Va={default:-1}});var iT,V,Op,Cn,I,xt=x(()=>{"use strict";iT=new Set,V="8.0.0",Op="8.3.4",Cn={quiet:!1,noColor:!1},I=((r,t,e=3)=>{if(Cn.quiet||iT.has(t))return;let s=new Error().stack,i=`${t}
|
|
2
|
+
Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!Cn.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",i):(s=s.split(`
|
|
3
3
|
`).splice(e).join(`
|
|
4
|
-
`),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(s))),rT.add(t)});Object.defineProperties(I,{quiet:{get:()=>Sn.quiet,set:r=>{Sn.quiet=r},enumerable:!0,configurable:!1},noColor:{get:()=>Sn.noColor,set:r=>{Sn.noColor=r},enumerable:!0,configurable:!1}})});function k(...r){Op!==sT&&(Op++,Op===sT?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r))}var Op,sT,pt=x(()=>{"use strict";Op=0,sT=500});var rr,Us=x(()=>{"use strict";rr={_registeredResources:new Set,register(r){this._registeredResources.add(r)},unregister(r){this._registeredResources.delete(r)},release(){this._registeredResources.forEach(r=>r.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(r){return this._registeredResources.has(r)},reset(){this._registeredResources.clear()}}});var Va,Lp=x(()=>{"use strict";Va=class{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}});var Pc,Ct,xr=x(()=>{"use strict";Us();Lp();Pc=class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Va(t)),this._poolsByClass.get(t)}stats(){let t={};return this._poolsByClass.forEach(e=>{let s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}},Ct=new Pc;rr.register(Ct)});var Np,Hp=x(()=>{"use strict";xt();Np={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===!0?{}:r))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){I("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r)}}});function za(r,t,e){let s=r.length,i;if(t>=s||e===0)return;e=t+e>s?s-t:e;let n=s-e;for(i=t;i<n;++i)r[i]=r[i+e];r.length=n}var Bc=x(()=>{"use strict"});var Wp,Vp=x(()=>{"use strict";Bc();xt();Wp={allowChildren:!0,removeChildren(r=0,t){let e=t??this.children.length,s=e-r,i=[];if(s>0&&s<=e){for(let o=e-1;o>=r;o--){let a=this.children[o];a&&(i.push(a),a.parent=null)}za(this.children,r,e);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(i);for(let o=0;o<i.length;++o){let a=i[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),i[o].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}else if(s===0&&this.children.length===0)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let t=this.getChildAt(r);return this.removeChild(t)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,t)},getChildIndex(r){let t=this.children.indexOf(r);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(r,t){this.allowChildren||I(V,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:e}=this;if(t<0||t>e.length)throw new Error(`${r}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);let s=r.parent===this;if(r.parent){let n=r.parent.children.indexOf(r);if(s){if(n===t)return r;r.parent.children.splice(n,1)}else r.removeFromParent()}t===e.length?e.push(r):e.splice(t,0,r),r.parent=this,r.didChange=!0,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",r,this,t),r.emit("added",this)),r},swapChildren(r,t){if(r===t)return;let e=this.getChildIndex(r),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=r;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(t=>this.reparentChildAt(t,this.children.length)),r[0])},reparentChildAt(r,t){if(r.parent===this)return this.setChildIndex(r,t),r;let e=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,t);let s=this.worldTransform.clone();return s.invert(),e.prepend(s),r.setFromMatrix(e),r},replaceChild(r,t){r.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(r)),t.setFromMatrix(r.localTransform),t.updateLocalTransform(),this.removeChild(r)}}});var zp,Xp=x(()=>{"use strict";zp={collectRenderables(r,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,t,e))},collectRenderablesSimple(r,t,e){let s=this.children,i=s.length;for(let n=0;n<i;n++)s[n].collectRenderables(r,t,e)},collectRenderablesWithEffects(r,t,e){let{renderPipes:s}=t;for(let i=0;i<this.effects.length;i++){let n=this.effects[i];s[n.pipe].push(n,this,r)}this.collectRenderablesSimple(r,t,e);for(let i=this.effects.length-1;i>=0;i--){let n=this.effects[i];s[n.pipe].pop(n,this,r)}}}});var Ur,Xa=x(()=>{"use strict";Ur=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}});var Rc,$a,$p=x(()=>{"use strict";C();xr();Rc=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){let s=this._tests[e];if(s.test(t))return Ct.get(s.maskClass,t)}return t}returnMaskEffect(t){Ct.return(t)}},$a=new Rc;O.handleByList(m.MaskEffect,$a._effectClasses)});var Yp,jp=x(()=>{"use strict";Xa();$p();Yp={_maskEffect:null,_maskOptions:{inverse:!1,channel:"red"},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0)},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((e,s)=>e.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(r){let t=this.effects.indexOf(r);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(r){let t=this._maskEffect;t?.mask!==r&&(t&&(this.removeEffect(t),$a.returnMaskEffect(t),this._maskEffect=null),r!=null&&(this._maskEffect=$a.getMaskEffect(r),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged()},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let t=this._filterEffect||(this._filterEffect=new Ur);r=r;let e=r?.length>0,s=t.filters?.length>0,i=e!==s;r=Array.isArray(r)?r.slice(0):r,t.filters=Object.freeze(r),i&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=r??null))},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new Ur),this._filterEffect.filterArea=r},get filterArea(){return this._filterEffect?.filterArea}}});var qp,Kp=x(()=>{"use strict";xt();qp={label:null,get name(){return I(V,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){I(V,"Container.name property has been removed, use Container.label instead"),this.label=r},getChildByName(r,t=!1){return this.getChildByLabel(r,t)},getChildByLabel(r,t=!1){let e=this.children;for(let s=0;s<e.length;s++){let i=e[s];if(i.label===r||r instanceof RegExp&&r.test(i.label))return i}if(t)for(let s=0;s<e.length;s++){let n=e[s].getChildByLabel(r,!0);if(n)return n}return null},getChildrenByLabel(r,t=!1,e=[]){let s=this.children;for(let i=0;i<s.length;i++){let n=s[i];(n.label===r||r instanceof RegExp&&r.test(n.label))&&e.push(n)}if(t)for(let i=0;i<s.length;i++)s[i].getChildrenByLabel(r,!0,e);return e}}});var Mc,J,jt=x(()=>{"use strict";Ue();Mc=[new nt,new nt,new nt,new nt],J=class r{constructor(t=0,e=0,s=0,i=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,i=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return!1;let a=this.x,u=this.y,l=s*(1-i),c=s-l,h=a-l,d=a+n+l,f=u-l,p=u+o+l,g=a+c,_=a+n-c,b=u+c,y=u+o-c;return t>=h&&t<=d&&e>=f&&e<=p&&!(t>g&&t<_&&e>b&&e<y)}intersects(t,e){if(!e){let M=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=M)return!1;let R=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>R}let s=this.left,i=this.right,n=this.top,o=this.bottom;if(i<=s||o<=n)return!1;let a=Mc[0].set(t.left,t.top),u=Mc[1].set(t.left,t.bottom),l=Mc[2].set(t.right,t.top),c=Mc[3].set(t.right,t.bottom);if(l.x<=a.x||u.y<=a.y)return!1;let h=Math.sign(e.a*e.d-e.b*e.c);if(h===0||(e.apply(a,a),e.apply(u,u),e.apply(l,l),e.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=s||Math.min(a.x,u.x,l.x,c.x)>=i||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return!1;let d=h*(u.y-a.y),f=h*(a.x-u.x),p=d*s+f*n,g=d*i+f*n,_=d*s+f*o,b=d*i+f*o;if(Math.max(p,g,_,b)<=d*a.x+f*a.y||Math.min(p,g,_,b)>=d*c.x+f*c.y)return!1;let y=h*(a.y-l.y),v=h*(l.x-a.x),T=y*s+v*n,S=y*i+v*n,E=y*s+v*o,w=y*i+v*o;return!(Math.max(T,S,E,w)<=y*a.x+v*a.y||Math.min(T,S,E,w)>=y*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){let e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(t=1,e=.001){let s=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=i-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){let e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=n-i,this}getBounds(t){return t||(t=new r),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;let e=t.x,s=t.y,i=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&i>=this.x&&i<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}});var iT,_t,he=x(()=>{"use strict";ot();jt();iT=new F,_t=class r{constructor(t=1/0,e=1/0,s=-1/0,i=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iT,this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new J);let t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iT,this}set(t,e,s,i){this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}addFrame(t,e,s,i,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,f=this.minY,p=this.maxX,g=this.maxY,_=o*t+u*e+c,b=a*t+l*e+h;_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*s+u*e+c,b=a*s+l*e+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*t+u*i+c,b=a*t+l*i+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*s+u*i+c,b=a*s+l*i+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),this.minX=d,this.minY=f,this.maxX=p,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){let e=this.minX,s=this.minY,i=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=t,d=o*e+u*s+c,f=a*e+l*s+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*i+u*s+c,f=a*i+l*s+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*e+u*n+c,f=a*e+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*i+u*n+c,f=a*i+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,i){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>i&&(this.maxY=i),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){let e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){let e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,i){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;i||(i=this.matrix);let l=i.a,c=i.b,h=i.c,d=i.d,f=i.tx,p=i.ty;for(let g=e;g<s;g+=2){let _=t[g],b=t[g+1],y=l*_+h*b+f,v=c*_+d*b+p;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v:u}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}});var Zt,$e,Is=x(()=>{"use strict";ot();xr();he();Zt=Ct.getPool(F),$e=Ct.getPool(_t)});var Sw,Zp,Qp=x(()=>{"use strict";ot();he();Is();Sw=new F,Zp={getFastGlobalBounds(r,t){t||(t=new _t),t.clear(),this._getGlobalBoundsRecursive(!!r,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(r,t,e){let s=t;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;let i=!!this.effects.length;if((this.renderGroup||i)&&(s=$e.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let o=this.bounds;s.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,s,e)}if(i){let n=!1,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=!0,s.applyMatrix(o.worldTransform)),this.effects[a].addBounds(s,!0));n&&s.applyMatrix(o.worldTransform.copyTo(Sw).invert()),t.addBounds(s),$e.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),$e.return(s))}}});function rs(r,t,e){e.clear();let s,i;return r.parent?t?s=r.parent.worldTransform:(i=Zt.get().identity(),s=Ya(r,i)):s=F.IDENTITY,nT(r,e,s,t),i&&Zt.return(i),e.isValid||e.set(0,0,0,0),e}function nT(r,t,e,s){if(!r.visible||!r.measurable)return;let i;s?i=r.worldTransform:(r.updateLocalTransform(),i=Zt.get(),i.appendFrom(r.localTransform,e));let n=t,o=!!r.effects.length;if(o&&(t=$e.get().clear()),r.boundsArea)t.addRect(r.boundsArea,i);else{let a=r.bounds;a&&!a.isEmpty()&&(t.matrix=i,t.addBounds(a));for(let u=0;u<r.children.length;u++)nT(r.children[u],t,i,s)}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(t);n.addBounds(t,F.IDENTITY),$e.return(t)}s||Zt.return(i)}function Ya(r,t){let e=r.parent;return e&&(Ya(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}var di=x(()=>{"use strict";ot();Is()});function Ie(r,t){if(r===16777215||!t)return t;if(t===16777215||!r)return r;let e=r>>16&255,s=r>>8&255,i=r&255,n=t>>16&255,o=t>>8&255,a=t&255,u=e*n/255|0,l=s*o/255|0,c=i*a/255|0;return(u<<16)+(l<<8)+c}var ks=x(()=>{"use strict"});function fi(r,t){return r===oT?t:t===oT?r:Ie(r,t)}var oT,Dc=x(()=>{"use strict";ks();oT=16777215});function Te(r){return((r&255)<<16)+(r&65280)+(r>>16&255)}var Jp,Os=x(()=>{"use strict";ot();di();Is();Dc();Jp={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(r=new F,t){if(t)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let e=Ya(this,Zt.get().identity());return r.appendFrom(this.localTransform,e),Zt.return(e),r},getGlobalTint(r){if(r)return this.renderGroup?Te(this.renderGroup.worldColor):this.parentRenderGroup?Te(fi(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=fi(t,e.localColor),e=e.parent;return Te(t)}}});function pi(r,t,e){return t.clear(),e||(e=F.IDENTITY),aT(r,t,e,r,!0),t.isValid||t.set(0,0,0,0),t}function aT(r,t,e,s,i){let n;if(i)n=Zt.get(),n=e.copyTo(n);else{if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=Zt.get(),n.appendFrom(u,e)}let o=t,a=!!r.effects.length;if(a&&(t=$e.get().clear()),r.boundsArea)t.addRect(r.boundsArea,n);else{r.renderPipeId&&(t.matrix=n,t.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)aT(u[l],t,n,s,!1)}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(t,s);o.addBounds(t,F.IDENTITY),$e.return(t)}Zt.return(n)}var ja=x(()=>{"use strict";ot();Is()});function Fc(r,t){let e=r.children;for(let s=0;s<e.length;s++){let i=e[s],n=i.uid,o=(i._didViewChangeTick&65535)<<16|i._didContainerChangeTick&65535,a=t.index;(t.data[a]!==n||t.data[a+1]!==o)&&(t.data[t.index]=n,t.data[t.index+1]=o,t.didChange=!0),t.index=a+2,i.children.length&&Fc(i,t)}return t.didChange}var tm=x(()=>{"use strict"});var Ew,em,rm=x(()=>{"use strict";ot();he();di();ja();tm();Ew=new F,em={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,t){let e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=r/t*e:this.scale.x=e},_setHeight(r,t){let e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=r/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new _t});let r=this._localBoundsCacheData;return r.index=1,r.didChange=!1,r.data[0]!==this._didViewChangeTick&&(r.didChange=!0,r.data[0]=this._didViewChangeTick),Fc(this,r),r.didChange&&pi(this,r.localBounds,Ew),r.localBounds},getBounds(r,t){return rs(this,r,t||new _t)}}});var sm,im=x(()=>{"use strict";sm={_onRender:null,set onRender(r){let t=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=r},get onRender(){return this._onRender}}});function Cw(r,t){return r._zIndex-t._zIndex}var nm,om=x(()=>{"use strict";nm={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Cw))}}});var am,um=x(()=>{"use strict";Ue();Is();am={getGlobalPosition(r=new nt,t=!1){return this.parent?this.parent.toGlobal(this._position,r,t):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,t,e=!1){let s=this.getGlobalTransform(Zt.get(),e);return t=s.apply(r,t),Zt.return(s),t},toLocal(r,t,e,s){t&&(r=t.toGlobal(r,e,s));let i=this.getGlobalTransform(Zt.get(),s);return e=i.applyInverse(r,e),Zt.return(i),e}}});var ss,qa=x(()=>{"use strict";Yt();ss=class{constructor(){this.uid=et("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}});function Ir(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Gc(r){return!(r&r-1)&&!!r}function Aw(r){let t=(r>65535?1:0)<<4;r>>>=t;let e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}var En=x(()=>{"use strict"});function xe(r){let t={};for(let e in r)r[e]!==void 0&&(t[e]=r[e]);return t}var Ls=x(()=>{"use strict"});function ww(r){let t=uT[r];return t===void 0&&(uT[r]=et("resource")),t}var uT,lT,Qt,kr=x(()=>{"use strict";le();Yt();xt();uT=Object.create(null);lT=class cT extends St{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...cT.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){I(V,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){let t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=ww(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};lT.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};Qt=lT});var hT,st,Wt=x(()=>{"use strict";le();En();Ls();Yt();kr();hT=class dT extends St{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=et("textureSource"),this._resourceType="textureSource",this._resourceId=et("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this.transient=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...dT.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.transient=t.transient??!1,this.alphaMode=t.alphaMode,this.style=new Qt(xe(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){let t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=et("resource"),this.emit("change",this),this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){let{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){let{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);let i=Math.round(t*s),n=Math.round(e*s);return this.width=i/s,this.height=n/s,this._resolution=s,this.pixelWidth===i&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit("resize",this),this._resourceId=et("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Gc(this.pixelWidth)&&Gc(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};hT.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};st=hT});function Pw(){for(let r=0;r<16;r++){let t=[];lm.push(t);for(let e=0;e<16;e++){let s=Uc(mi[r]*mi[e]+xi[r]*gi[e]),i=Uc(gi[r]*mi[e]+_i[r]*gi[e]),n=Uc(mi[r]*xi[e]+xi[r]*_i[e]),o=Uc(gi[r]*xi[e]+_i[r]*_i[e]);for(let a=0;a<16;a++)if(mi[a]===s&&gi[a]===i&&xi[a]===n&&_i[a]===o){t.push(a);break}}}for(let r=0;r<16;r++){let t=new F;t.set(mi[r],gi[r],xi[r],_i[r],0,0),fT.push(t)}}var mi,gi,xi,_i,lm,fT,Uc,q,Ns=x(()=>{"use strict";ot();mi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],gi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],xi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],_i=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],lm=[],fT=[],Uc=Math.sign;Pw();q={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:r=>mi[r],uY:r=>gi[r],vX:r=>xi[r],vY:r=>_i[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>lm[r][t],sub:(r,t)=>lm[r][q.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?q.S:q.N:Math.abs(t)*2<=Math.abs(r)?r>0?q.E:q.W:t>0?r>0?q.SE:q.SW:r>0?q.NE:q.NW,matrixAppendRotationInv:(r,t,e=0,s=0,i=0,n=0)=>{let o=fT[q.inv(t)],a=o.a,u=o.b,l=o.c,c=o.d,h=e-Math.min(0,a*i,l*n,a*i+l*n),d=s-Math.min(0,u*i,c*n,u*i+c*n),f=r.a,p=r.b,g=r.c,_=r.d;r.a=a*f+u*g,r.b=a*p+u*_,r.c=l*f+c*g,r.d=l*p+c*_,r.tx=h*f+d*g+r.tx,r.ty=h*p+d*_+r.ty},transformRectCoords:(r,t,e,s)=>{let{x:i,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=t;return e===q.E?(s.set(i+u,n+l,o,a),s):e===q.S?s.set(c-n-a+u,i+l,a,o):e===q.W?s.set(c-i-o+u,h-n-a+l,o,a):e===q.N?s.set(n+u,h-i-o+l,a,o):s.set(i+u,n+l,o,a)}}});var Ic,cm=x(()=>{"use strict";Ic=()=>{}});var Hs,kc=x(()=>{"use strict";C();Wt();Hs=class extends st{constructor(t){let e=t.resource||new Float32Array(t.width*t.height*4),s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}};Hs.extension=m.TextureSource});var pT,bi,Oc=x(()=>{"use strict";ot();pT=new F,bi=class{constructor(t,e){this.mapCoord=new F,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this)),this.update()}multiplyUvs(t,e){e===void 0&&(e=t);let s=this.mapCoord;for(let i=0;i<t.length;i+=2){let n=t[i],o=t[i+1];e[i]=n*s.a+o*s.c+s.tx,e[i+1]=n*s.b+o*s.d+s.ty}return e}update(){let t=this._texture;this._updateID++;let e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);let s=t.orig,i=t.trim;i&&(pT.set(s.width/i.width,0,0,s.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(pT));let n=t.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(t.frame.x+a+u)/n.width,o[1]=(t.frame.y+a+u)/n.height,o[2]=(t.frame.x+t.frame.width-a+u)/n.width,o[3]=(t.frame.y+t.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}}});var D,ht=x(()=>{"use strict";le();Ns();jt();Yt();xt();cm();kc();Wt();Oc();D=class extends St{constructor({source:t,label:e,frame:s,orig:i,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=et("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new J,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new st,this.noFrame=!s,s)this.frame.copyFrom(s);else{let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h}this.orig=i||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=l||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new bi(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:t,frame:e}=this,{width:s,height:i}=this._source,n=e.x/s,o=e.y/i,a=e.width/s,u=e.height/i,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,f=o+h;l=q.add(l,q.NW),t.x0=d+c*q.uX(l),t.y0=f+h*q.uY(l),l=q.add(l,2),t.x1=d+c*q.uX(l),t.y1=f+h*q.uY(l),l=q.add(l,2),t.x2=d+c*q.uX(l),t.y2=f+h*q.uY(l),l=q.add(l,2),t.x3=d+c*q.uX(l),t.y3=f+h*q.uY(l)}else t.x0=n,t.y0=o,t.x1=n+a,t.y1=o,t.x2=n+a,t.y2=o+u,t.x3=n,t.y3=o+u}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return I(V,"Texture.baseTexture is now Texture.source"),this._source}};D.EMPTY=new D({label:"EMPTY",source:new st({label:"EMPTY"})});D.EMPTY.destroy=Ic;D.WHITE=new D({source:new Hs({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});D.WHITE.destroy=Ic});var Bw,Lc,yt,_r=x(()=>{"use strict";En();Us();Wt();ht();kr();Bw=0,Lc=class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Qt(this.textureOptions)}createTexture(t,e,s,i){let n=new st({...this.textureOptions,width:t,height:e,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:i});return new D({source:n,label:`texturePool_${Bw++}`})}getOptimalTexture(t,e,s=1,i,n=!1){let o=Math.ceil(t*s-1e-6),a=Math.ceil(e*s-1e-6);o=Ir(o),a=Ir(a);let u=i?1:0,l=n?1:0,c=(o<<17)+(a<<2)+(l<<1)+u;this._texturePool[c]||(this._texturePool[c]=[]);let h=this._texturePool[c].pop();return h||(h=this.createTexture(o,a,i,n)),h.source._resolution=s,h.source.width=o/s,h.source.height=a/s,h.source.pixelWidth=o,h.source.pixelHeight=a,h.frame.x=0,h.frame.y=0,h.frame.width=t,h.frame.height=e,h.updateUvs(),this._poolKeyHash[h.uid]=c,h}getSameSizeTexture(t,e=!1){let s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,e)}returnTexture(t,e=!1){let s=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(let e in this._texturePool){let s=this._texturePool[e];if(s)for(let i=0;i<s.length;i++)s[i].destroy(!0)}this._texturePool={}}},yt=new Lc;rr.register(yt)});var Ws,Nc=x(()=>{"use strict";ot();qa();_r();Ws=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new F,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new ss,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;let e=t.children;for(let s=0;s<e.length;s++){let i=e[s];i._updateFlags=15,this.addChild(i)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(yt.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let t in this.childrenToUpdate){let e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){let e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);let e=t.children;for(let s=0;s<e.length;s++)this.addChild(e[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}let e=t.children;for(let s=0;s<e.length;s++)this.removeChild(e[s])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){let e=this.root.children;for(let s=0;s<e.length;s++)this._getChildren(e[s],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;let s=t.children;for(let i=0;i<s.length;i++)this._getChildren(s[i],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new F),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new F),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new F),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}});function Cn(r,t,e={}){for(let s in t)!e[s]&&t[s]!==void 0&&(r[s]=t[s])}var Hc=x(()=>{"use strict"});var hm,Wc,dm,Vc,An,Ka,yi,Rw,lt,_e=x(()=>{"use strict";le();It();Dp();C();ot();wc();Gs();Yt();xt();pt();xr();Hp();Vp();Xp();jp();Kp();Qp();Os();rm();im();om();um();Nc();Hc();hm=new Et(null),Wc=new Et(null),dm=new Et(null,1,1),Vc=new Et(null),An=1,Ka=2,yi=4,Rw=8,lt=class r extends St{constructor(t={}){super(),this.uid=et("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new F,this.relativeGroupTransform=new F,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Et(this,0,0),this._scale=dm,this._pivot=Wc,this._origin=Vc,this._skew=hm,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Cn(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),t.parent?.addChild(this)}static mixin(t){I("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),O.mixin(r,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||I(V,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let i=0;i<t.length;i++)this.addChild(t[i]);return t[0]}let e=t[0],s=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),s&&(s.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,s&&s.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let i=0;i<t.length;i++)this.removeChild(t[i]);return t[0]}let e=t[0],s=this.children.indexOf(e);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=Ct.get(Ws,this),this.groupTransform=F.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),Ct.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new F),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Gp}set angle(t){this.rotation=t*Up}get pivot(){return this._pivot===Wc&&(this._pivot=new Et(this,0,0)),this._pivot}set pivot(t){this._pivot===Wc&&(this._pivot=new Et(this,0,0),this._origin!==Vc&&k("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===hm&&(this._skew=new Et(this,0,0)),this._skew}set skew(t){this._skew===hm&&(this._skew=new Et(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===dm&&(this._scale=new Et(this,1,1)),this._scale}set scale(t){this._scale===dm&&(this._scale=new Et(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Vc&&(this._origin=new Et(this,0,0)),this._origin}set origin(t){this._origin===Vc&&(this._origin=new Et(this,0,0),this._pivot!==Wc&&k("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){let e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){let e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});let e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){let s=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,s.width),e!==void 0&&this._setHeight(e,s.height)}_updateSkew(){let t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX:this.scale.x,typeof t.scaleY=="number"?t.scaleY:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){let t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;let e=this.localTransform,s=this._scale,i=this._pivot,n=this._origin,o=this._position,a=s._x,u=s._y,l=i._x,c=i._y,h=-n._x,d=-n._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*u,e.d=this._sy*u,e.tx=o._x-(l*e.a+c*e.c)+(h*e.a+d*e.c)-h,e.ty=o._y-(l*e.b+c*e.d)+(h*e.b+d*e.d)-d}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=An,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){let s=X.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=An,this._onUpdate())}get tint(){return Te(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ka,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){let e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yi,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){let e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yi,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){let e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=yi,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let i=0;i<e.length;++i)e[i].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}};O.mixin(lt,Wp,Zp,am,sm,em,Yp,qp,nm,Mp,Np,Jp,zp)});var Se,Vs=x(()=>{"use strict";Se=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Se||{})});var vi,fm=x(()=>{"use strict";vi=class{constructor(t,e=null,s=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=i}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));let e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}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);let e=this.next;return this.next=t?null:e,this.previous=null,e}}});var mT,Gt,is=x(()=>{"use strict";Vs();fm();mT=class sr{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 vi(null,null,1/0),this.deltaMS=1/sr.targetFPMS,this.elapsedMS=1/sr.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,e,s=Se.NORMAL){return this._addListener(new vi(t,e,s))}addOnce(t,e,s=Se.NORMAL){return this._addListener(new vi(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){let n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*sr.targetFPMS;let s=this._head,i=s.next;for(;i;)i=i.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let e=Math.min(Math.max(0,t)/1e3,sr.targetFPMS);this._maxElapsedMS=1/e,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!sr._shared){let t=sr._shared=new sr;t.autoStart=!0,t._protected=!0}return sr._shared}static get system(){if(!sr._system){let t=sr._system=new sr;t.autoStart=!0,t._protected=!0}return sr._system}};mT.targetFPMS=.06;Gt=mT});var Ti,zc=x(()=>{"use strict";Vs();is();Ti=class{constructor(t){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),s=this._canvas.width,i=this._canvas.height,n=e.width/s*this._renderer.resolution,o=e.height/i*this._renderer.resolution,a=e.left,u=e.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l)},this._domElement=t.domElement,this._renderer=t.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(t=>{for(let e of t){if(e.target!==this._canvas)continue;let s=this.canvas.width,i=this.canvas.height,n=e.contentRect.width/s*this._renderer.resolution,o=e.contentRect.height/i*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||Gt.shared.add(this.updateTranslation,this,Se.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&Gt.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}});var ns,Za=x(()=>{"use strict";Ue();ns=class r{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=r.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new nt,this.page=new nt,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,s){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,s,i,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}});function Mw(r){return function(t){return t.test(r)}}function Qa(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,s=e.split("[FBAN");typeof s[1]<"u"&&(e=s[0]),s=e.split("Twitter"),typeof s[1]<"u"&&(e=s[0]);var i=Mw(e),n={apple:{phone:i(pm)&&!i(os),ipod:i(gT),tablet:!i(pm)&&(i(xT)||AT(t))&&!i(os),universal:i(_T),device:(i(pm)||i(gT)||i(xT)||i(_T)||AT(t))&&!i(os)},amazon:{phone:i(wn),tablet:!i(wn)&&i(Xc),device:i(wn)||i(Xc)},android:{phone:!i(os)&&i(wn)||!i(os)&&i(mm),tablet:!i(os)&&!i(wn)&&!i(mm)&&(i(Xc)||i(bT)),device:!i(os)&&(i(wn)||i(Xc)||i(mm)||i(bT))||i(/\bokhttp\b/i)},windows:{phone:i(os),tablet:i(yT),device:i(os)||i(yT)},other:{blackberry:i(vT),blackberry10:i(TT),opera:i(ST),firefox:i(CT),chrome:i(ET),device:i(vT)||i(TT)||i(ST)||i(CT)||i(ET)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var pm,gT,xT,_T,mm,bT,wn,Xc,os,yT,vT,TT,ST,ET,CT,AT,gm=x(()=>{"use strict";pm=/iPhone/i,gT=/iPod/i,xT=/iPad/i,_T=/\biOS-universal(?:.+)Mac\b/i,mm=/\bAndroid(?:.+)Mobile\b/i,bT=/Android/i,wn=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Xc=/Silk/i,os=/Windows Phone/i,yT=/\bWindows(?:.+)ARM\b/i,vT=/BlackBerry/i,TT=/BB10/i,ST=/Opera Mini/i,ET=/\b(CriOS|Chrome)(?:.+)Mobile/i,CT=/Mobile(?:.+)Firefox\b/i,AT=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"}});var wT=x(()=>{"use strict";gm();gm()});var Dw,xm,_m=x(()=>{"use strict";wT();Dw=Qa.default??Qa,xm=Dw(globalThis.navigator)});var Fw,PT,Gw,Uw,BT,RT,Iw,kw,Ow,bm,ym,vm=x(()=>{"use strict";zc();Za();C();_m();Bc();Fw=9,PT=100,Gw=0,Uw=0,BT=2,RT=1,Iw=-1e3,kw=-1e3,Ow=2,bm=class MT{constructor(t,e=xm){this._mobileInfo=e,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(e.tablet||e.phone)&&this._createTouchHook(),this._renderer=t}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let t=document.createElement("button");t.style.width=`${RT}px`,t.style.height=`${RT}px`,t.style.position="absolute",t.style.top=`${Iw}px`,t.style.left=`${kw}px`,t.style.zIndex=Ow.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${Gw}px`,this._div.style.left=`${Uw}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=BT.toString(),this._canvasObserver=new Ti({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);let t=this._renderer.view.canvas;if(t.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let e=new MutationObserver(()=>{t.parentNode&&(e.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});e.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let t of this._children)t._accessibleDiv?.parentNode&&(t._accessibleDiv.parentNode.removeChild(t._accessibleDiv),t._accessibleDiv=null),t._accessibleActive=!1;for(let t in this._pools)this._pools[t].forEach(s=>{s.parentNode&&s.parentNode.removeChild(s)}),delete this._pools[t];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&(t._accessibleActive||this._addChild(t),t._renderId=this._renderId);let e=t.children;if(e)for(let s=0;s<e.length;s++)this._updateAccessibleObjects(e[s])}init(t){let s={accessibilityOptions:{...MT.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=s.accessibilityOptions.debug,this._activateOnTab=s.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=s.accessibilityOptions.deactivateOnMouseMove,s.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let t=performance.now();if(this._mobileInfo.android.device&&t<this._androidUpdateCount||(this._androidUpdateCount=t+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let e=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let s of this._children)s._renderId===this._renderId&&e.add(this._children.indexOf(s))}for(let s=this._children.length-1;s>=0;s--){let i=this._children[s];e.has(s)||(i._accessibleDiv&&i._accessibleDiv.parentNode&&(i._accessibleDiv.parentNode.removeChild(i._accessibleDiv),this._getPool(i.accessibleType).push(i._accessibleDiv),i._accessibleDiv=null),i._accessibleActive=!1,za(this._children,s,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let s=0;s<this._children.length;s++){let i=this._children[s];if(!i._accessibleActive||!i._accessibleDiv)continue;let n=i._accessibleDiv,o=i.hitArea||i.getBounds().rectangle;if(i.hitArea){let a=i.worldTransform;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}_capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);let{width:e,height:s}=this._renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}_addChild(t){let s=this._getPool(t.accessibleType).pop();s?(s.innerHTML="",s.removeAttribute("title"),s.removeAttribute("aria-label"),s.tabIndex=0):(t.accessibleType==="button"?s=document.createElement("button"):(s=document.createElement(t.accessibleType),s.style.cssText=`
|
|
4
|
+
`),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(s))),iT.add(t)});Object.defineProperties(I,{quiet:{get:()=>Cn.quiet,set:r=>{Cn.quiet=r},enumerable:!0,configurable:!1},noColor:{get:()=>Cn.noColor,set:r=>{Cn.noColor=r},enumerable:!0,configurable:!1}})});function k(...r){Lp!==nT&&(Lp++,Lp===nT?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r))}var Lp,nT,pt=x(()=>{"use strict";Lp=0,nT=500});var rr,Is=x(()=>{"use strict";rr={_registeredResources:new Set,register(r){this._registeredResources.add(r)},unregister(r){this._registeredResources.delete(r)},release(){this._registeredResources.forEach(r=>r.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(r){return this._registeredResources.has(r)},reset(){this._registeredResources.clear()}}});var za,Np=x(()=>{"use strict";za=class{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}});var Pc,Ct,xr=x(()=>{"use strict";Is();Np();Pc=class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new za(t)),this._poolsByClass.get(t)}stats(){let t={};return this._poolsByClass.forEach(e=>{let s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}},Ct=new Pc;rr.register(Ct)});var Hp,Wp=x(()=>{"use strict";xt();Hp={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===!0?{}:r))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){I("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r)}}});function Xa(r,t,e){let s=r.length,i;if(t>=s||e===0)return;e=t+e>s?s-t:e;let n=s-e;for(i=t;i<n;++i)r[i]=r[i+e];r.length=n}var Bc=x(()=>{"use strict"});var Vp,zp=x(()=>{"use strict";Bc();xt();Vp={allowChildren:!0,removeChildren(r=0,t){let e=t??this.children.length,s=e-r,i=[];if(s>0&&s<=e){for(let o=e-1;o>=r;o--){let a=this.children[o];a&&(i.push(a),a.parent=null)}Xa(this.children,r,e);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(i);for(let o=0;o<i.length;++o){let a=i[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),i[o].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}else if(s===0&&this.children.length===0)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let t=this.getChildAt(r);return this.removeChild(t)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,t)},getChildIndex(r){let t=this.children.indexOf(r);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(r,t){this.allowChildren||I(V,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:e}=this;if(t<0||t>e.length)throw new Error(`${r}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);let s=r.parent===this;if(r.parent){let n=r.parent.children.indexOf(r);if(s){if(n===t)return r;r.parent.children.splice(n,1)}else r.removeFromParent()}t===e.length?e.push(r):e.splice(t,0,r),r.parent=this,r.didChange=!0,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",r,this,t),r.emit("added",this)),r},swapChildren(r,t){if(r===t)return;let e=this.getChildIndex(r),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=r;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(t=>this.reparentChildAt(t,this.children.length)),r[0])},reparentChildAt(r,t){if(r.parent===this)return this.setChildIndex(r,t),r;let e=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,t);let s=this.worldTransform.clone();return s.invert(),e.prepend(s),r.setFromMatrix(e),r},replaceChild(r,t){r.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(r)),t.setFromMatrix(r.localTransform),t.updateLocalTransform(),this.removeChild(r)}}});var Xp,$p=x(()=>{"use strict";Xp={collectRenderables(r,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,t,e))},collectRenderablesSimple(r,t,e){let s=this.children,i=s.length;for(let n=0;n<i;n++)s[n].collectRenderables(r,t,e)},collectRenderablesWithEffects(r,t,e){let{renderPipes:s}=t;for(let i=0;i<this.effects.length;i++){let n=this.effects[i];s[n.pipe].push(n,this,r)}this.collectRenderablesSimple(r,t,e);for(let i=this.effects.length-1;i>=0;i--){let n=this.effects[i];s[n.pipe].pop(n,this,r)}}}});var Ur,$a=x(()=>{"use strict";Ur=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}});var Rc,Ya,Yp=x(()=>{"use strict";C();xr();Rc=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){let s=this._tests[e];if(s.test(t))return Ct.get(s.maskClass,t)}return t}returnMaskEffect(t){Ct.return(t)}},Ya=new Rc;O.handleByList(m.MaskEffect,Ya._effectClasses)});var jp,qp=x(()=>{"use strict";$a();Yp();jp={_maskEffect:null,_maskOptions:{inverse:!1,channel:"red"},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0)},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((e,s)=>e.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(r){let t=this.effects.indexOf(r);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(r){let t=this._maskEffect;t?.mask!==r&&(t&&(this.removeEffect(t),Ya.returnMaskEffect(t),this._maskEffect=null),r!=null&&(this._maskEffect=Ya.getMaskEffect(r),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged()},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let t=this._filterEffect||(this._filterEffect=new Ur);r=r;let e=r?.length>0,s=t.filters?.length>0,i=e!==s;r=Array.isArray(r)?r.slice(0):r,t.filters=Object.freeze(r),i&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=r??null))},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new Ur),this._filterEffect.filterArea=r},get filterArea(){return this._filterEffect?.filterArea}}});var Kp,Zp=x(()=>{"use strict";xt();Kp={label:null,get name(){return I(V,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){I(V,"Container.name property has been removed, use Container.label instead"),this.label=r},getChildByName(r,t=!1){return this.getChildByLabel(r,t)},getChildByLabel(r,t=!1){let e=this.children;for(let s=0;s<e.length;s++){let i=e[s];if(i.label===r||r instanceof RegExp&&r.test(i.label))return i}if(t)for(let s=0;s<e.length;s++){let n=e[s].getChildByLabel(r,!0);if(n)return n}return null},getChildrenByLabel(r,t=!1,e=[]){let s=this.children;for(let i=0;i<s.length;i++){let n=s[i];(n.label===r||r instanceof RegExp&&r.test(n.label))&&e.push(n)}if(t)for(let i=0;i<s.length;i++)s[i].getChildrenByLabel(r,!0,e);return e}}});var Mc,J,jt=x(()=>{"use strict";Ue();Mc=[new nt,new nt,new nt,new nt],J=class r{constructor(t=0,e=0,s=0,i=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,i=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return!1;let a=this.x,u=this.y,l=s*(1-i),c=s-l,h=a-l,d=a+n+l,f=u-l,p=u+o+l,g=a+c,_=a+n-c,b=u+c,y=u+o-c;return t>=h&&t<=d&&e>=f&&e<=p&&!(t>g&&t<_&&e>b&&e<y)}intersects(t,e){if(!e){let M=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=M)return!1;let R=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>R}let s=this.left,i=this.right,n=this.top,o=this.bottom;if(i<=s||o<=n)return!1;let a=Mc[0].set(t.left,t.top),u=Mc[1].set(t.left,t.bottom),l=Mc[2].set(t.right,t.top),c=Mc[3].set(t.right,t.bottom);if(l.x<=a.x||u.y<=a.y)return!1;let h=Math.sign(e.a*e.d-e.b*e.c);if(h===0||(e.apply(a,a),e.apply(u,u),e.apply(l,l),e.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=s||Math.min(a.x,u.x,l.x,c.x)>=i||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return!1;let d=h*(u.y-a.y),f=h*(a.x-u.x),p=d*s+f*n,g=d*i+f*n,_=d*s+f*o,b=d*i+f*o;if(Math.max(p,g,_,b)<=d*a.x+f*a.y||Math.min(p,g,_,b)>=d*c.x+f*c.y)return!1;let y=h*(a.y-l.y),v=h*(l.x-a.x),T=y*s+v*n,S=y*i+v*n,E=y*s+v*o,w=y*i+v*o;return!(Math.max(T,S,E,w)<=y*a.x+v*a.y||Math.min(T,S,E,w)>=y*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){let e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(t=1,e=.001){let s=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=i-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){let e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=n-i,this}getBounds(t){return t||(t=new r),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;let e=t.x,s=t.y,i=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&i>=this.x&&i<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(t,e,s,i){return this.x=t,this.y=e,this.width=s,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}});var oT,_t,he=x(()=>{"use strict";ot();jt();oT=new F,_t=class r{constructor(t=1/0,e=1/0,s=-1/0,i=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=oT,this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new J);let t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=oT,this}set(t,e,s,i){this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}addFrame(t,e,s,i,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,f=this.minY,p=this.maxX,g=this.maxY,_=o*t+u*e+c,b=a*t+l*e+h;_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*s+u*e+c,b=a*s+l*e+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*t+u*i+c,b=a*t+l*i+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),_=o*s+u*i+c,b=a*s+l*i+h,_<d&&(d=_),b<f&&(f=b),_>p&&(p=_),b>g&&(g=b),this.minX=d,this.minY=f,this.maxX=p,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){let e=this.minX,s=this.minY,i=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=t,d=o*e+u*s+c,f=a*e+l*s+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*i+u*s+c,f=a*i+l*s+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*e+u*n+c,f=a*e+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*i+u*n+c,f=a*i+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,i){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>i&&(this.maxY=i),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){let e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){let e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,i){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;i||(i=this.matrix);let l=i.a,c=i.b,h=i.c,d=i.d,f=i.tx,p=i.ty;for(let g=e;g<s;g+=2){let _=t[g],b=t[g+1],y=l*_+h*b+f,v=c*_+d*b+p;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v:u}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}});var Zt,$e,ks=x(()=>{"use strict";ot();xr();he();Zt=Ct.getPool(F),$e=Ct.getPool(_t)});var Ew,Qp,Jp=x(()=>{"use strict";ot();he();ks();Ew=new F,Qp={getFastGlobalBounds(r,t){t||(t=new _t),t.clear(),this._getGlobalBoundsRecursive(!!r,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(r,t,e){let s=t;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;let i=!!this.effects.length;if((this.renderGroup||i)&&(s=$e.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let o=this.bounds;s.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,s,e)}if(i){let n=!1,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=!0,s.applyMatrix(o.worldTransform)),this.effects[a].addBounds(s,!0));n&&s.applyMatrix(o.worldTransform.copyTo(Ew).invert()),t.addBounds(s),$e.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),$e.return(s))}}});function rs(r,t,e){e.clear();let s,i;return r.parent?t?s=r.parent.worldTransform:(i=Zt.get().identity(),s=ja(r,i)):s=F.IDENTITY,aT(r,e,s,t),i&&Zt.return(i),e.isValid||e.set(0,0,0,0),e}function aT(r,t,e,s){if(!r.visible||!r.measurable)return;let i;s?i=r.worldTransform:(r.updateLocalTransform(),i=Zt.get(),i.appendFrom(r.localTransform,e));let n=t,o=!!r.effects.length;if(o&&(t=$e.get().clear()),r.boundsArea)t.addRect(r.boundsArea,i);else{let a=r.bounds;a&&!a.isEmpty()&&(t.matrix=i,t.addBounds(a));for(let u=0;u<r.children.length;u++)aT(r.children[u],t,i,s)}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(t);n.addBounds(t,F.IDENTITY),$e.return(t)}s||Zt.return(i)}function ja(r,t){let e=r.parent;return e&&(ja(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}var pi=x(()=>{"use strict";ot();ks()});function Ie(r,t){if(r===16777215||!t)return t;if(t===16777215||!r)return r;let e=r>>16&255,s=r>>8&255,i=r&255,n=t>>16&255,o=t>>8&255,a=t&255,u=e*n/255|0,l=s*o/255|0,c=i*a/255|0;return(u<<16)+(l<<8)+c}var Os=x(()=>{"use strict"});function mi(r,t){return r===uT?t:t===uT?r:Ie(r,t)}var uT,Dc=x(()=>{"use strict";Os();uT=16777215});function Te(r){return((r&255)<<16)+(r&65280)+(r>>16&255)}var tm,Ls=x(()=>{"use strict";ot();pi();ks();Dc();tm={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(r=new F,t){if(t)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let e=ja(this,Zt.get().identity());return r.appendFrom(this.localTransform,e),Zt.return(e),r},getGlobalTint(r){if(r)return this.renderGroup?Te(this.renderGroup.worldColor):this.parentRenderGroup?Te(mi(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=mi(t,e.localColor),e=e.parent;return Te(t)}}});function gi(r,t,e){return t.clear(),e||(e=F.IDENTITY),lT(r,t,e,r,!0),t.isValid||t.set(0,0,0,0),t}function lT(r,t,e,s,i){let n;if(i)n=Zt.get(),n=e.copyTo(n);else{if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=Zt.get(),n.appendFrom(u,e)}let o=t,a=!!r.effects.length;if(a&&(t=$e.get().clear()),r.boundsArea)t.addRect(r.boundsArea,n);else{r.renderPipeId&&(t.matrix=n,t.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)lT(u[l],t,n,s,!1)}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(t,s);o.addBounds(t,F.IDENTITY),$e.return(t)}Zt.return(n)}var qa=x(()=>{"use strict";ot();ks()});function Fc(r,t){let e=r.children;for(let s=0;s<e.length;s++){let i=e[s],n=i.uid,o=(i._didViewChangeTick&65535)<<16|i._didContainerChangeTick&65535,a=t.index;(t.data[a]!==n||t.data[a+1]!==o)&&(t.data[t.index]=n,t.data[t.index+1]=o,t.didChange=!0),t.index=a+2,i.children.length&&Fc(i,t)}return t.didChange}var em=x(()=>{"use strict"});var Cw,rm,sm=x(()=>{"use strict";ot();he();pi();qa();em();Cw=new F,rm={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,t){let e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=r/t*e:this.scale.x=e},_setHeight(r,t){let e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=r/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new _t});let r=this._localBoundsCacheData;return r.index=1,r.didChange=!1,r.data[0]!==this._didViewChangeTick&&(r.didChange=!0,r.data[0]=this._didViewChangeTick),Fc(this,r),r.didChange&&gi(this,r.localBounds,Cw),r.localBounds},getBounds(r,t){return rs(this,r,t||new _t)}}});var im,nm=x(()=>{"use strict";im={_onRender:null,set onRender(r){let t=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=r},get onRender(){return this._onRender}}});function Aw(r,t){return r._zIndex-t._zIndex}var om,am=x(()=>{"use strict";om={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Aw))}}});var um,lm=x(()=>{"use strict";Ue();ks();um={getGlobalPosition(r=new nt,t=!1){return this.parent?this.parent.toGlobal(this._position,r,t):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,t,e=!1){let s=this.getGlobalTransform(Zt.get(),e);return t=s.apply(r,t),Zt.return(s),t},toLocal(r,t,e,s){t&&(r=t.toGlobal(r,e,s));let i=this.getGlobalTransform(Zt.get(),s);return e=i.applyInverse(r,e),Zt.return(i),e}}});var ss,Ka=x(()=>{"use strict";Yt();ss=class{constructor(){this.uid=et("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}});function Ir(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Gc(r){return!(r&r-1)&&!!r}function ww(r){let t=(r>65535?1:0)<<4;r>>>=t;let e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}var An=x(()=>{"use strict"});function xe(r){let t={};for(let e in r)r[e]!==void 0&&(t[e]=r[e]);return t}var Ns=x(()=>{"use strict"});function Pw(r){let t=cT[r];return t===void 0&&(cT[r]=et("resource")),t}var cT,hT,Qt,kr=x(()=>{"use strict";le();Yt();xt();cT=Object.create(null);hT=class dT extends St{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...dT.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){I(V,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){let t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Pw(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};hT.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};Qt=hT});var fT,st,Wt=x(()=>{"use strict";le();An();Ns();Yt();kr();fT=class pT extends St{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=et("textureSource"),this._resourceType="textureSource",this._resourceId=et("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this.transient=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...pT.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.transient=t.transient??!1,this.alphaMode=t.alphaMode,this.style=new Qt(xe(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){let t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=et("resource"),this.emit("change",this),this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){let{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){let{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);let i=Math.round(t*s),n=Math.round(e*s);return this.width=i/s,this.height=n/s,this._resolution=s,this.pixelWidth===i&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit("resize",this),this._resourceId=et("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Gc(this.pixelWidth)&&Gc(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};fT.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};st=fT});function Bw(){for(let r=0;r<16;r++){let t=[];cm.push(t);for(let e=0;e<16;e++){let s=Uc(xi[r]*xi[e]+bi[r]*_i[e]),i=Uc(_i[r]*xi[e]+yi[r]*_i[e]),n=Uc(xi[r]*bi[e]+bi[r]*yi[e]),o=Uc(_i[r]*bi[e]+yi[r]*yi[e]);for(let a=0;a<16;a++)if(xi[a]===s&&_i[a]===i&&bi[a]===n&&yi[a]===o){t.push(a);break}}}for(let r=0;r<16;r++){let t=new F;t.set(xi[r],_i[r],bi[r],yi[r],0,0),mT.push(t)}}var xi,_i,bi,yi,cm,mT,Uc,q,Hs=x(()=>{"use strict";ot();xi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],_i=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],bi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],yi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],cm=[],mT=[],Uc=Math.sign;Bw();q={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:r=>xi[r],uY:r=>_i[r],vX:r=>bi[r],vY:r=>yi[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>cm[r][t],sub:(r,t)=>cm[r][q.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?q.S:q.N:Math.abs(t)*2<=Math.abs(r)?r>0?q.E:q.W:t>0?r>0?q.SE:q.SW:r>0?q.NE:q.NW,matrixAppendRotationInv:(r,t,e=0,s=0,i=0,n=0)=>{let o=mT[q.inv(t)],a=o.a,u=o.b,l=o.c,c=o.d,h=e-Math.min(0,a*i,l*n,a*i+l*n),d=s-Math.min(0,u*i,c*n,u*i+c*n),f=r.a,p=r.b,g=r.c,_=r.d;r.a=a*f+u*g,r.b=a*p+u*_,r.c=l*f+c*g,r.d=l*p+c*_,r.tx=h*f+d*g+r.tx,r.ty=h*p+d*_+r.ty},transformRectCoords:(r,t,e,s)=>{let{x:i,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=t;return e===q.E?(s.set(i+u,n+l,o,a),s):e===q.S?s.set(c-n-a+u,i+l,a,o):e===q.W?s.set(c-i-o+u,h-n-a+l,o,a):e===q.N?s.set(n+u,h-i-o+l,a,o):s.set(i+u,n+l,o,a)}}});var Ic,hm=x(()=>{"use strict";Ic=()=>{}});var Ws,kc=x(()=>{"use strict";C();Wt();Ws=class extends st{constructor(t){let e=t.resource||new Float32Array(t.width*t.height*4),s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}};Ws.extension=m.TextureSource});var gT,vi,Oc=x(()=>{"use strict";ot();gT=new F,vi=class{constructor(t,e){this.mapCoord=new F,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this)),this.update()}multiplyUvs(t,e){e===void 0&&(e=t);let s=this.mapCoord;for(let i=0;i<t.length;i+=2){let n=t[i],o=t[i+1];e[i]=n*s.a+o*s.c+s.tx,e[i+1]=n*s.b+o*s.d+s.ty}return e}update(){let t=this._texture;this._updateID++;let e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);let s=t.orig,i=t.trim;i&&(gT.set(s.width/i.width,0,0,s.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(gT));let n=t.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(t.frame.x+a+u)/n.width,o[1]=(t.frame.y+a+u)/n.height,o[2]=(t.frame.x+t.frame.width-a+u)/n.width,o[3]=(t.frame.y+t.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}}});var D,ht=x(()=>{"use strict";le();Hs();jt();Yt();xt();hm();kc();Wt();Oc();D=class extends St{constructor({source:t,label:e,frame:s,orig:i,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=et("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new J,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new st,this.noFrame=!s,s)this.frame.copyFrom(s);else{let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h}this.orig=i||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=l||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new vi(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:t,frame:e}=this,{width:s,height:i}=this._source,n=e.x/s,o=e.y/i,a=e.width/s,u=e.height/i,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,f=o+h;l=q.add(l,q.NW),t.x0=d+c*q.uX(l),t.y0=f+h*q.uY(l),l=q.add(l,2),t.x1=d+c*q.uX(l),t.y1=f+h*q.uY(l),l=q.add(l,2),t.x2=d+c*q.uX(l),t.y2=f+h*q.uY(l),l=q.add(l,2),t.x3=d+c*q.uX(l),t.y3=f+h*q.uY(l)}else t.x0=n,t.y0=o,t.x1=n+a,t.y1=o,t.x2=n+a,t.y2=o+u,t.x3=n,t.y3=o+u}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return I(V,"Texture.baseTexture is now Texture.source"),this._source}};D.EMPTY=new D({label:"EMPTY",source:new st({label:"EMPTY"})});D.EMPTY.destroy=Ic;D.WHITE=new D({source:new Ws({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});D.WHITE.destroy=Ic});var Rw,Lc,yt,_r=x(()=>{"use strict";An();Is();Wt();ht();kr();Rw=0,Lc=class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Qt(this.textureOptions)}createTexture(t,e,s,i){let n=new st({...this.textureOptions,width:t,height:e,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:i});return new D({source:n,label:`texturePool_${Rw++}`})}getOptimalTexture(t,e,s=1,i,n=!1){let o=Math.ceil(t*s-1e-6),a=Math.ceil(e*s-1e-6);o=Ir(o),a=Ir(a);let u=i?1:0,l=n?1:0,c=(o<<17)+(a<<2)+(l<<1)+u;this._texturePool[c]||(this._texturePool[c]=[]);let h=this._texturePool[c].pop();return h||(h=this.createTexture(o,a,i,n)),h.source._resolution=s,h.source.width=o/s,h.source.height=a/s,h.source.pixelWidth=o,h.source.pixelHeight=a,h.frame.x=0,h.frame.y=0,h.frame.width=t,h.frame.height=e,h.updateUvs(),this._poolKeyHash[h.uid]=c,h}getSameSizeTexture(t,e=!1){let s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,e)}returnTexture(t,e=!1){let s=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(let e in this._texturePool){let s=this._texturePool[e];if(s)for(let i=0;i<s.length;i++)s[i].destroy(!0)}this._texturePool={}}},yt=new Lc;rr.register(yt)});var Vs,Nc=x(()=>{"use strict";ot();Ka();_r();Vs=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new F,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new ss,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;let e=t.children;for(let s=0;s<e.length;s++){let i=e[s];i._updateFlags=15,this.addChild(i)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(yt.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let t in this.childrenToUpdate){let e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){let e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);let e=t.children;for(let s=0;s<e.length;s++)this.addChild(e[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}let e=t.children;for(let s=0;s<e.length;s++)this.removeChild(e[s])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){let e=this.root.children;for(let s=0;s<e.length;s++)this._getChildren(e[s],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;let s=t.children;for(let i=0;i<s.length;i++)this._getChildren(s[i],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new F),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new F),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new F),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}});function wn(r,t,e={}){for(let s in t)!e[s]&&t[s]!==void 0&&(r[s]=t[s])}var Hc=x(()=>{"use strict"});var dm,Wc,fm,Vc,Pn,Za,Ti,Mw,lt,_e=x(()=>{"use strict";le();It();Fp();C();ot();wc();Us();Yt();xt();pt();xr();Wp();zp();$p();qp();Zp();Jp();Ls();sm();nm();am();lm();Nc();Hc();dm=new Et(null),Wc=new Et(null),fm=new Et(null,1,1),Vc=new Et(null),Pn=1,Za=2,Ti=4,Mw=8,lt=class r extends St{constructor(t={}){super(),this.uid=et("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new F,this.relativeGroupTransform=new F,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Et(this,0,0),this._scale=fm,this._pivot=Wc,this._origin=Vc,this._skew=dm,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],wn(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),t.parent?.addChild(this)}static mixin(t){I("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),O.mixin(r,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||I(V,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let i=0;i<t.length;i++)this.addChild(t[i]);return t[0]}let e=t[0],s=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),s&&(s.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,s&&s.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let i=0;i<t.length;i++)this.removeChild(t[i]);return t[0]}let e=t[0],s=this.children.indexOf(e);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=Ct.get(Vs,this),this.groupTransform=F.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),Ct.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new F),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Up}set angle(t){this.rotation=t*Ip}get pivot(){return this._pivot===Wc&&(this._pivot=new Et(this,0,0)),this._pivot}set pivot(t){this._pivot===Wc&&(this._pivot=new Et(this,0,0),this._origin!==Vc&&k("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===dm&&(this._skew=new Et(this,0,0)),this._skew}set skew(t){this._skew===dm&&(this._skew=new Et(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===fm&&(this._scale=new Et(this,1,1)),this._scale}set scale(t){this._scale===fm&&(this._scale=new Et(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Vc&&(this._origin=new Et(this,0,0)),this._origin}set origin(t){this._origin===Vc&&(this._origin=new Et(this,0,0),this._pivot!==Wc&&k("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){let e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){let e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});let e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){let s=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,s.width),e!==void 0&&this._setHeight(e,s.height)}_updateSkew(){let t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX:this.scale.x,typeof t.scaleY=="number"?t.scaleY:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){let t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;let e=this.localTransform,s=this._scale,i=this._pivot,n=this._origin,o=this._position,a=s._x,u=s._y,l=i._x,c=i._y,h=-n._x,d=-n._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*u,e.d=this._sy*u,e.tx=o._x-(l*e.a+c*e.c)+(h*e.a+d*e.c)-h,e.ty=o._y-(l*e.b+c*e.d)+(h*e.b+d*e.d)-d}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Pn,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){let s=X.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=Pn,this._onUpdate())}get tint(){return Te(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Za,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){let e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ti,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){let e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ti,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){let e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Ti,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let i=0;i<e.length;++i)e[i].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}};O.mixin(lt,Vp,Qp,um,im,rm,jp,Kp,om,Dp,Hp,tm,Xp)});var Se,zs=x(()=>{"use strict";Se=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Se||{})});var Si,pm=x(()=>{"use strict";Si=class{constructor(t,e=null,s=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=i}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));let e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}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);let e=this.next;return this.next=t?null:e,this.previous=null,e}}});var xT,Gt,is=x(()=>{"use strict";zs();pm();xT=class sr{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 Si(null,null,1/0),this.deltaMS=1/sr.targetFPMS,this.elapsedMS=1/sr.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,e,s=Se.NORMAL){return this._addListener(new Si(t,e,s))}addOnce(t,e,s=Se.NORMAL){return this._addListener(new Si(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){let n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*sr.targetFPMS;let s=this._head,i=s.next;for(;i;)i=i.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let e=Math.min(Math.max(0,t)/1e3,sr.targetFPMS);this._maxElapsedMS=1/e,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!sr._shared){let t=sr._shared=new sr;t.autoStart=!0,t._protected=!0}return sr._shared}static get system(){if(!sr._system){let t=sr._system=new sr;t.autoStart=!0,t._protected=!0}return sr._system}};xT.targetFPMS=.06;Gt=xT});var Ei,zc=x(()=>{"use strict";zs();is();Ei=class{constructor(t){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),s=this._canvas.width,i=this._canvas.height,n=e.width/s*this._renderer.resolution,o=e.height/i*this._renderer.resolution,a=e.left,u=e.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l)},this._domElement=t.domElement,this._renderer=t.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(t=>{for(let e of t){if(e.target!==this._canvas)continue;let s=this.canvas.width,i=this.canvas.height,n=e.contentRect.width/s*this._renderer.resolution,o=e.contentRect.height/i*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||Gt.shared.add(this.updateTranslation,this,Se.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&Gt.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}});var ns,Qa=x(()=>{"use strict";Ue();ns=class r{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=r.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new nt,this.page=new nt,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,s){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,s,i,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}});function Dw(r){return function(t){return t.test(r)}}function Ja(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,s=e.split("[FBAN");typeof s[1]<"u"&&(e=s[0]),s=e.split("Twitter"),typeof s[1]<"u"&&(e=s[0]);var i=Dw(e),n={apple:{phone:i(mm)&&!i(os),ipod:i(_T),tablet:!i(mm)&&(i(bT)||PT(t))&&!i(os),universal:i(yT),device:(i(mm)||i(_T)||i(bT)||i(yT)||PT(t))&&!i(os)},amazon:{phone:i(Bn),tablet:!i(Bn)&&i(Xc),device:i(Bn)||i(Xc)},android:{phone:!i(os)&&i(Bn)||!i(os)&&i(gm),tablet:!i(os)&&!i(Bn)&&!i(gm)&&(i(Xc)||i(vT)),device:!i(os)&&(i(Bn)||i(Xc)||i(gm)||i(vT))||i(/\bokhttp\b/i)},windows:{phone:i(os),tablet:i(TT),device:i(os)||i(TT)},other:{blackberry:i(ST),blackberry10:i(ET),opera:i(CT),firefox:i(wT),chrome:i(AT),device:i(ST)||i(ET)||i(CT)||i(wT)||i(AT)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var mm,_T,bT,yT,gm,vT,Bn,Xc,os,TT,ST,ET,CT,AT,wT,PT,xm=x(()=>{"use strict";mm=/iPhone/i,_T=/iPod/i,bT=/iPad/i,yT=/\biOS-universal(?:.+)Mac\b/i,gm=/\bAndroid(?:.+)Mobile\b/i,vT=/Android/i,Bn=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Xc=/Silk/i,os=/Windows Phone/i,TT=/\bWindows(?:.+)ARM\b/i,ST=/BlackBerry/i,ET=/BB10/i,CT=/Opera Mini/i,AT=/\b(CriOS|Chrome)(?:.+)Mobile/i,wT=/Mobile(?:.+)Firefox\b/i,PT=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"}});var BT=x(()=>{"use strict";xm();xm()});var Fw,_m,bm=x(()=>{"use strict";BT();Fw=Ja.default??Ja,_m=Fw(globalThis.navigator)});var Gw,RT,Uw,Iw,MT,DT,kw,Ow,Lw,ym,vm,Tm=x(()=>{"use strict";zc();Qa();C();bm();Bc();Gw=9,RT=100,Uw=0,Iw=0,MT=2,DT=1,kw=-1e3,Ow=-1e3,Lw=2,ym=class FT{constructor(t,e=_m){this._mobileInfo=e,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(e.tablet||e.phone)&&this._createTouchHook(),this._renderer=t}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let t=document.createElement("button");t.style.width=`${DT}px`,t.style.height=`${DT}px`,t.style.position="absolute",t.style.top=`${kw}px`,t.style.left=`${Ow}px`,t.style.zIndex=Lw.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${Uw}px`,this._div.style.left=`${Iw}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=MT.toString(),this._canvasObserver=new Ei({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);let t=this._renderer.view.canvas;if(t.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let e=new MutationObserver(()=>{t.parentNode&&(e.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});e.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let t of this._children)t._accessibleDiv?.parentNode&&(t._accessibleDiv.parentNode.removeChild(t._accessibleDiv),t._accessibleDiv=null),t._accessibleActive=!1;for(let t in this._pools)this._pools[t].forEach(s=>{s.parentNode&&s.parentNode.removeChild(s)}),delete this._pools[t];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&(t._accessibleActive||this._addChild(t),t._renderId=this._renderId);let e=t.children;if(e)for(let s=0;s<e.length;s++)this._updateAccessibleObjects(e[s])}init(t){let s={accessibilityOptions:{...FT.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=s.accessibilityOptions.debug,this._activateOnTab=s.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=s.accessibilityOptions.deactivateOnMouseMove,s.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let t=performance.now();if(this._mobileInfo.android.device&&t<this._androidUpdateCount||(this._androidUpdateCount=t+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let e=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let s of this._children)s._renderId===this._renderId&&e.add(this._children.indexOf(s))}for(let s=this._children.length-1;s>=0;s--){let i=this._children[s];e.has(s)||(i._accessibleDiv&&i._accessibleDiv.parentNode&&(i._accessibleDiv.parentNode.removeChild(i._accessibleDiv),this._getPool(i.accessibleType).push(i._accessibleDiv),i._accessibleDiv=null),i._accessibleActive=!1,Xa(this._children,s,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let s=0;s<this._children.length;s++){let i=this._children[s];if(!i._accessibleActive||!i._accessibleDiv)continue;let n=i._accessibleDiv,o=i.hitArea||i.getBounds().rectangle;if(i.hitArea){let a=i.worldTransform;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}_capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);let{width:e,height:s}=this._renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}_addChild(t){let s=this._getPool(t.accessibleType).pop();s?(s.innerHTML="",s.removeAttribute("title"),s.removeAttribute("aria-label"),s.tabIndex=0):(t.accessibleType==="button"?s=document.createElement("button"):(s=document.createElement(t.accessibleType),s.style.cssText=`
|
|
5
5
|
color: transparent;
|
|
6
6
|
pointer-events: none;
|
|
7
7
|
padding: 0;
|
|
@@ -14,7 +14,7 @@ Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!Sn.noColor
|
|
|
14
14
|
-webkit-user-select: none;
|
|
15
15
|
-moz-user-select: none;
|
|
16
16
|
-ms-user-select: none;
|
|
17
|
-
`,t.accessibleText&&(s.innerText=t.accessibleText)),s.style.width=`${PT}px`,s.style.height=`${PT}px`,s.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",s.style.position="absolute",s.style.zIndex=BT.toString(),s.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?s.setAttribute("aria-live","off"):s.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?s.setAttribute("aria-relevant","additions"):s.setAttribute("aria-relevant","text"),s.addEventListener("click",this._onClick.bind(this)),s.addEventListener("focus",this._onFocus.bind(this)),s.addEventListener("focusout",this._onFocusOut.bind(this))),s.style.pointerEvents=t.accessiblePointerEvents,s.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?s.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(s.title=`container ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&s.setAttribute("aria-label",t.accessibleHint),t.interactive?s.tabIndex=t.tabIndex:s.tabIndex=0,this.debug&&this._updateDebugHTML(s),t._accessibleActive=!0,t._accessibleDiv=s,s.container=t,this._children.push(t),this._div.appendChild(t._accessibleDiv)}_dispatchEvent(t,e){let{container:s}=t.target,i=this._renderer.events.rootBoundary,n=Object.assign(new ns(i),{target:s});i.rootTarget=this._renderer.lastObjectRendered,e.forEach(o=>i.dispatchEvent(n,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode!==Fw||!this._activateOnTab||this._activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(t){t?this._activate():this._deactivate()}_getPool(t){return this._pools[t]||(this._pools[t]=[]),this._pools[t]}};bm.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"accessibility"};bm.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};ym=bm});var Tm,Sm=x(()=>{"use strict";Tm={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1}});var DT=x(()=>{"use strict";C();_e();vm();Sm();O.add(ym);O.mixin(lt,Tm)});var Pn,Em=x(()=>{"use strict";C();zc();Pn=class{constructor(t){this._attachedDomElements=[],this._renderer=t,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new Ti({domElement:this._domElement,renderer:this._renderer})}addRenderable(t,e){this._attachedDomElements.includes(t)||this._attachedDomElements.push(t)}updateRenderable(t){}validateRenderable(t){return!0}postrender(){let t=this._attachedDomElements;if(t.length===0){this._domElement.remove();return}this._canvasObserver.ensureAttached();for(let e=0;e<t.length;e++){let s=t[e],i=s.element;if(!s.parent||s.globalDisplayStatus<7)i?.remove(),t.splice(e,1),e--;else{this._domElement.contains(i)||(i.style.position="absolute",i.style.pointerEvents="auto",this._domElement.appendChild(i));let n=s.worldTransform,o=s._anchor,a=s.width*o.x,u=s.height*o.y;i.style.transformOrigin=`${a}px ${u}px`,i.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, ${n.tx-a}, ${n.ty-u})`,i.style.opacity=s.groupAlpha.toString()}}}destroy(){this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++)this._attachedDomElements[t].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}};Pn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"dom"}});var Jt,br=x(()=>{"use strict";he();_e();Jt=class extends lt{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new _t(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){let e=this.bounds,{x:s,y:i}=t;return s>=e.minX&&s<=e.maxX&&i>=e.minY&&i<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,s){let{renderPipes:i}=e;i.blendMode.pushBlendMode(this,this.groupBlendMode,t);let o=i[this.renderPipeId];o?.addRenderable&&o.addRenderable(this,t),this.didViewUpdate=!1;let a=this.children,u=a.length;for(let l=0;l<u;l++)a[l].collectRenderables(t,e,s);i.blendMode.popBlendMode(t)}}});var Cm,FT=x(()=>{"use strict";Ue();br();Cm=class extends Jt{constructor(t={}){let{element:e,anchor:s,...i}=t;super({label:"DOMContainer",...i}),this.renderPipeId="dom",this.batched=!1,this._anchor=new nt(0,0),s&&(this.anchor=s),this.element=t.element||document.createElement("div")}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set element(t){this._element!==t&&(this._element=t,this.onViewUpdate())}get element(){return this._element}updateBounds(){let t=this._bounds,e=this._element;if(!e){t.minX=0,t.minY=0,t.maxX=0,t.maxY=0;return}let{offsetWidth:s,offsetHeight:i}=e;t.minX=0,t.maxX=s,t.minY=0,t.maxY=i}destroy(t=!1){super.destroy(t),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null}}});var GT=x(()=>{"use strict";C();Em();O.add(Pn)});var Am,ur,$c=x(()=>{"use strict";Vs();is();Am=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this._tickerAdded||!this.domElement||(Gt.system.add(this._tickerUpdate,this,Se.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(Gt.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}):new MouseEvent("mousemove",{clientX:t.clientX,clientY:t.clientY}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},ur=new Am});var Or,Ja=x(()=>{"use strict";Ue();Za();Or=class extends ns{constructor(){super(...arguments),this.client=new nt,this.movement=new nt,this.offset=new nt,this.global=new nt,this.screen=new nt}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,s){return t.worldTransform.applyInverse(s||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,s,i,n,o,a,u,l,c,h,d,f,p,g){throw new Error("Method not implemented.")}}});var Ee,Yc=x(()=>{"use strict";Ja();Ee=class extends Or{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}});var yr,jc=x(()=>{"use strict";Ja();yr=class extends Or{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};yr.DOM_DELTA_PIXEL=0;yr.DOM_DELTA_LINE=1;yr.DOM_DELTA_PAGE=2});var Lw,Nw,tu,eu,wm=x(()=>{"use strict";le();Ue();pt();$c();Ja();Yc();jc();Lw=2048,Nw=new nt,tu=new nt,eu=class{constructor(t){this.dispatch=new St,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((s,i)=>s.priority-i.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;let e=this.mappingTable[t.type];if(e)for(let s=0,i=e.length;s<i;s++)e[s].fn(t);else k(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){ur.pauseUpdate=!0;let i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[i](this.rootTarget,this.rootTarget.eventMode,Nw.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;let s=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,n=s.length-1;i<n;i++)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!(t.propagationStopped||t.propagationImmediatelyStopped)){t.eventPhase=t.BUBBLING_PHASE;for(let i=s.length-2;i>=0;i--)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;let i=Array.isArray(e)?e:[e];for(let n=s.length-1;n>=0;n--)i.forEach(o=>{t.currentTarget=s[n],this.notifyTarget(t,o)})}propagationPath(t){let e=[t];for(let s=0;s<Lw&&t!==this.rootTarget&&t.parent;s++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,s,i,n,o=!1){let a=!1;if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ur.pauseUpdate=!1),t.interactiveChildren&&t.children){let c=t.children;for(let h=c.length-1;h>=0;h--){let d=c[h],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,s,i,n,o||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;let p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}let u=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(t,s)&&i(t,s)?l?[t]:[]:null}hitTestRecursive(t,e,s,i,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ur.pauseUpdate=!1),t.interactiveChildren&&t.children){let u=t.children,l=s;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(e)?e:h.eventMode,l,i,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let f=t.isInteractive();return(d.length>0||f)&&d.push(t),d}}}let o=this._isInteractive(e),a=t.isInteractive();return o&&i(t,s)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!t||!t.visible||!t.renderable||!t.measurable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,tu),!t.hitArea.contains(tu.x,tu.y)))return!0;if(t.effects&&t.effects.length)for(let s=0;s<t.effects.length;s++){let i=t.effects[s];if(i.containsPoint&&!i.containsPoint(e,this.hitTestFn))return!0}return!1}hitTestFn(t,e){return t.hitArea?!0:t?.containsPoint?(t.worldTransform.applyInverse(e,tu),t.containsPoint(tu)):!1}notifyTarget(t,e){if(!t.currentTarget.isInteractive())return;e??(e=t.type);let s=`on${e}`;t.currentTarget[s]?.(t);let i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){let i=e.button===2;this.dispatchEvent(e,i?"rightdown":"mousedown")}let s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;let s=e.pointerType==="mouse"||e.pointerType==="pen",i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.overTargets);if(i.overTargets?.length>0&&n!==e.target){let u=t.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(t,u,n);if(this.dispatchEvent(l,"pointerout"),s&&this.dispatchEvent(l,"mouseout"),!e.composedPath().includes(n)){let c=this.createPointerEvent(t,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),s&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c)}this.freeEvent(l)}if(n!==e.target){let u=t.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(e,u);this.dispatchEvent(l,"pointerover"),s&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==e.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),s&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(l)}let o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&o.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&o.push("globaltouchmove")),s&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&o.push("globalmousemove"),this.cursor=e.target?.cursor),o.length>0&&this.all(e,o),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId),s=this.createPointerEvent(t),i=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),i&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=s.target?.cursor);let n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),i&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;e.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId);if(e.overTargets){let s=t.pointerType==="mouse"||t.pointerType==="pen",i=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(t,"pointerleave",i);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),s&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;e.overTargets=null,this.freeEvent(n),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){let a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}let i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),o=n;if(n&&!s.composedPath().includes(n)){let a=n;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){let u=s.button===2;this.notifyTarget(s,u?"rightupoutside":"mouseupoutside")}a=a.parent}delete i.pressTargetsByButton[t.button],o=a}if(o){let a=this.clonePointerEvent(s,"click");a.target=o,a.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:e});let u=i.clicksByButton[t.button];if(u.target===a.target&&e-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=e,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(s){let n=s;for(;n;)i.currentTarget=n,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch"?this.notifyTarget(i,"touchendoutside"):(i.pointerType==="mouse"||i.pointerType==="pen")&&this.notifyTarget(i,i.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof yr)){k("EventBoundary cannot map a non-wheel event as a wheel event");return}let e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s<t.length&&t[s].parent===e;s++)e=t[s];return e}createPointerEvent(t,e,s){let i=this.allocateEvent(Ee);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=s??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],typeof e=="string"&&(i.type=e),i}createWheelEvent(t){let e=this.allocateEvent(yr);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){let s=this.allocateEvent(Ee);return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=e??s.type,s}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Ee&&e instanceof Ee&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Or&&e instanceof Or&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);let e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){let s=t.currentTarget._events[e];if(s)if("fn"in s)s.once&&t.currentTarget.removeListener(e,s.fn,void 0,!0),s.fn.call(s.context,t);else for(let i=0,n=s.length;i<n&&!t.propagationImmediatelyStopped;i++)s[i].once&&t.currentTarget.removeListener(e,s[i].fn,void 0,!0),s[i].fn.call(s[i].context,t)}}});var Hw,Ww,Bm,ru,qc=x(()=>{"use strict";C();wm();$c();Yc();jc();Hw=1,Ww={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Bm=class Pm{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new eu(null),ur.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Ee(null),this._rootWheelEvent=new yr(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Pm.defaultEventFeatures},{set:(e,s,i)=>(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=i),e[s]=i,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:e,resolution:s}=this.renderer;this.setTargetElement(e),this.resolution=s,Pm._defaultEventMode=t.eventMode??"passive",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){ur.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;let s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=this._normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let s=0,i=e.length;s<i;s++){let n=e[s],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,ur.pointerMoved();let e=this._normalizeToPointerData(t);for(let s=0,i=e.length;s<i;s++){let n=this._bootstrapEvent(this._rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);let s=e!==this.domElement?"outside":"",i=this._normalizeToPointerData(t);for(let n=0,o=i.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,i[n]);a.type+=s,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=this._normalizeToPointerData(t);for(let s=0,i=e.length;s<i;s++){let n=this._bootstrapEvent(this._rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;let e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,ur.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;ur.addTickerListener();let t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;ur.removeTickerListener();let t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,s){let i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*n,t.y=(s-i.top)*(this.domElement.height/i.height)*n}_normalizeToPointerData(t){let e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,i=t.changedTouches.length;s<i;s++){let n=t.changedTouches[s];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,n.altKey??(n.altKey=t.altKey),n.ctrlKey??(n.ctrlKey=t.ctrlKey),n.metaKey??(n.metaKey=t.metaKey),n.shiftKey??(n.shiftKey=t.shiftKey),e.push(n)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){let s=t;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=Hw),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e}normalizeWheelEvent(t){let e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ww[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Bm.extension={name:"events",type:[m.WebGLSystem,m.CanvasSystem,m.WebGPUSystem],priority:-1};Bm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};ru=Bm});var Rm,Mm=x(()=>{"use strict";qc();Za();Rm={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??ru.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,t,e){let s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,i=typeof e=="object"?e.signal:void 0,n=typeof e=="object"?e.once===!0:!1,o=typeof t=="function"?void 0:t;r=s?`${r}capture`:r;let a=typeof t=="function"?t:t.handleEvent,u=this;i&&i.addEventListener("abort",()=>{u.off(r,a,o)}),n?u.once(r,a,o):u.on(r,a,o)},removeEventListener(r,t,e){let s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,i=typeof t=="function"?void 0:t;r=s?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.off(r,t,i)},dispatchEvent(r){if(!(r instanceof ns))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}}});var UT=x(()=>{"use strict";C();_e();qc();Mm();O.add(ru);O.mixin(lt,Rm)});var Lt,ir=x(()=>{"use strict";Lt=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Lt||{})});var Dm,Fm=x(()=>{"use strict";Dm={createCanvas:(r,t)=>{let e=document.createElement("canvas");return e.width=r,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")}});var IT,N,mt=x(()=>{"use strict";Fm();IT=Dm,N={get(){return IT},set(r){IT=r}}});function vr(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function su(r){return r.split("?")[0].split("#")[0]}function Vw(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zw(r,t,e){return r.replace(new RegExp(Vw(t),"g"),e)}function Xw(r,t){let e="",s=0,i=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||n===1))if(i!==a-1&&n===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){let u=e.lastIndexOf("/");if(u!==e.length-1){u===-1?(e="",s=0):(e=e.slice(0,u),s=e.length-1-e.lastIndexOf("/")),i=a,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,i=a,n=0;continue}}t&&(e.length>0?e+="/..":e="..",s=2)}else e.length>0?e+=`/${r.slice(i+1,a)}`:e=r.slice(i+1,a),s=a-i-1;i=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}var ee,zs=x(()=>{"use strict";mt();ee={toPosix(r){return zw(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){vr(r),r=this.toPosix(r);let t=/^file:\/\/\//.exec(r);if(t)return t[0];let e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(vr(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let s=su(this.toPosix(t??N.get().getBaseUrl())),i=su(this.toPosix(e??this.rootname(s)));return r=this.toPosix(r),r.startsWith("/")?ee.join(i,r.slice(1)):this.isAbsolute(r)?r:this.join(s,r)},normalize(r){if(vr(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="",e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));let s=r.endsWith("/");return r=Xw(r,!1),r.length>0&&s&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return vr(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e<r.length;++e){let s=r[e];if(vr(s),s.length>0)if(t===void 0)t=s;else{let i=r[e-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(vr(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0),e=t===47,s=-1,i=!0,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(t=r.charCodeAt(a),t===47){if(!i){s=a;break}}else i=!1;return s===-1?e?"/":this.isUrl(o)?n+r:n:e&&s===1?"//":n+r.slice(0,s)},rootname(r){vr(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){let e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){vr(r),t&&vr(t),r=su(this.toPosix(r));let e=0,s=-1,i=!0,n;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!i){e=n+1;break}}else a===-1&&(i=!1,a=n+1),o>=0&&(u===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return e===s?s=a:s===-1&&(s=r.length),r.slice(e,s)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!i){e=n+1;break}}else s===-1&&(i=!1,s=n+1);return s===-1?"":r.slice(e,s)},extname(r){vr(r),r=su(this.toPosix(r));let t=-1,e=0,s=-1,i=!0,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!i){e=o+1;break}continue}s===-1&&(i=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":r.slice(t,s)},parse(r){vr(r);let t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=su(this.toPosix(r));let e=r.charCodeAt(0),s=this.isAbsolute(r),i,n="";t.root=this.rootname(r),s||this.hasProtocol(r)?i=1:i=0;let o=-1,a=0,u=-1,l=!0,c=r.length-1,h=0;for(;c>=i;--c){if(e=r.charCodeAt(c),e===47){if(!l){a=c+1;break}continue}u===-1&&(l=!1,u=c+1),e===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&s?t.base=t.name=r.slice(1,u):t.base=t.name=r.slice(a,u)):(a===0&&s?(t.name=r.slice(1,o),t.base=r.slice(1,u)):(t.name=r.slice(a,o),t.base=r.slice(a,u)),t.ext=r.slice(o,u)),t.dir=this.dirname(r),n&&(t.dir=n+t.dir),t},sep:"/",delimiter:":",joinExtensions:[".html"]}});var Ce,Bn=x(()=>{"use strict";Ce=(r,t,e=!1)=>(Array.isArray(r)||(r=[r]),t?r.map(s=>typeof s=="string"||e?t(s):s):r)});function kT(r,t,e,s,i){let n=t[e];for(let o=0;o<n.length;o++){let a=n[o];e<t.length-1?kT(r.replace(s[e],a),t,e+1,s,i):i.push(r.replace(s[e],a))}}function Gm(r){let t=/\{(.*?)\}/g,e=r.match(t),s=[];if(e){let i=[];e.forEach(n=>{let o=n.substring(1,n.length-1).split(",");i.push(o)}),kT(r,i,0,e,s)}else s.push(r);return s}var Um=x(()=>{"use strict"});var Xs,iu=x(()=>{"use strict";Xs=r=>!Array.isArray(r)});function OT(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Ae,$s=x(()=>{"use strict";pt();zs();Bn();Um();iu();Ae=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{let e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){let{alias:e,src:s}=t;return Ce(e||s,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&k("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){let s=[],i=e;Array.isArray(e)||(i=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),i.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(t,a);s.push(l),u=[a,l]}else{let l=a.map(c=>this._createBundleAssetId(t,c));s.push(...l),u=[...a,...l]}this.add({...n,alias:u,src:o})}),this._bundles[t]=s}add(t){let e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&k(`[Resolver] already has key: ${n} overwriting`)},Ce(e).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l,parser:c}=n,h=Ce(o).map(g=>typeof g=="string"?Gm(g):Array.isArray(g)?g:[g]),d=this.getAlias(n);Array.isArray(d)?d.forEach(s):s(d);let f=[],p=g=>{let _=this._parsers.find(b=>b.test(g));return{src:g,..._?.parse(g)}};h.forEach(g=>{g.forEach(_=>{let b={};if(typeof _!="object"?b=p(_):(a=_.data??a,u=_.format??u,(_.loadParser||_.parser)&&(l=_.loadParser??l,c=_.parser??c),b={...p(_.src),..._}),!d)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:d,data:a,format:u,loadParser:l,parser:c,progressSize:n.progressSize}),f.push(b)})}),d.forEach(g=>{this._assetMap[g]=f})})}resolveBundle(t){let e=Xs(t);t=Ce(t);let s={};return t.forEach(i=>{let n=this._bundles[i];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(i,u)]=l}s[i]=a}}),e?s[t[0]]:s}resolveUrl(t){let e=this.resolve(t);if(typeof t!="string"){let s={};for(let i in e)s[i]=e[i].src;return s}return e.src}resolve(t){let e=Xs(t);t=Ce(t);let s={};return t.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let n=this._assetMap[i],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:!1);l.length&&(n=l)})}),this._resolverHash[i]=n[0]}else this._resolverHash[i]=this._buildResolvedAsset({alias:[i],src:i},{});s[i]=this._resolverHash[i]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){let s=t[e],i=this._preferredOrder.find(n=>n.params.format.includes(s.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;let e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){let{aliases:s,data:i,loadParser:n,parser:o,format:a,progressSize:u}=e;return(this._basePath||this._rootPath)&&(t.src=ee.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=n??t.loadParser,t.parser=o??t.parser,t.format=a??t.format??OT(t.src),u!==void 0&&(t.progressSize=u),t}};Ae.RETINA_PREFIX=/@([0-9\.]+)x/});var Rn,Kc=x(()=>{"use strict";Rn=(r,t)=>{let e=t.split("?")[1];return e&&(r+=`?${e}`),r}});var LT,Zc,Im=x(()=>{"use strict";jt();Wt();ht();LT=class nu{constructor(t,e){this.linkedSheets=[];let s=t;t?.source instanceof st&&(s={texture:t,data:e});let{texture:i,data:n,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=i instanceof D?i:null,this.textureSource=i.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,i.source.resolution=this.resolution):this.resolution=i.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=nu.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,e=!1){let s=t,i=e?1/0:nu.BATCH_SIZE;for(;s-t<i&&s<this._frameKeys.length;){let n=this._frameKeys[s],o=this._frames[n],a=o.frame;if(a){let u=null,l=null,c=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,h=new J(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);o.rotated?u=new J(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):u=new J(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(l=new J(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[n]=new D({source:this.textureSource,frame:u,orig:h,trim:l,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:n.toString()})}s++}}_processAnimations(){let t=this.data.animations||{};for(let e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){let i=t[e][s];this.animations[e].push(this.textures[i])}}}_parseComplete(){let t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*nu.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*nu.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};LT.BATCH_SIZE=1e3;Zc=LT});function NT(r,t,e){let s={};if(r.forEach(i=>{s[i]=t}),Object.keys(t.textures).forEach(i=>{s[`${t.cachePrefix}${i}`]=t.textures[i]}),!e){let i=ee.dirname(r[0]);t.linkedSheets.forEach((n,o)=>{let a=NT([`${i}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}var $w,km,Om=x(()=>{"use strict";ir();$s();Kc();C();ht();zs();Im();$w=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];km={extension:m.Asset,cache:{test:r=>r instanceof Zc,getCacheableAssets:(r,t)=>NT(r,t,!1)},resolver:{extension:{type:m.ResolveParser,name:"resolveSpritesheet"},test:r=>{let e=r.split("?")[0].split("."),s=e.pop(),i=e.pop();return s==="json"&&$w.includes(i)},parse:r=>{let t=r.split(".");return{resolution:parseFloat(Ae.RETINA_PREFIX.exec(r)?.[1]??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:m.LoadParser,priority:Lt.Normal,name:"spritesheetLoader"},async testParse(r,t){return ee.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){let{texture:s,imageFilename:i,textureOptions:n,cachePrefix:o}=t?.data??{},a=ee.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(s instanceof D)u=s;else{let h=Rn(a+(i??r.meta.image),t.src);u=(await e.load([{src:h,data:n}]))[h]}let l=new Zc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let f of c){if(typeof f!="string")continue;let p=a+f;t.data?.ignoreMultiPack||(p=Rn(p,t.src),h.push(e.load({src:p,data:{textureOptions:n,ignoreMultiPack:!0}})))}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[l].concat(l.linkedSheets.filter(p=>p!==f))})}return l},async unload(r,t,e){await e.unload(r.textureSource._sourceOrigin),r.destroy(!1)}}}});var Qc=x(()=>{"use strict";C();Om();O.add(km)});function ou(r,t,e){let{width:s,height:i}=e.orig,n=e.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-t._x*s,r.maxX=r.minX+o,r.minY=n.y-t._y*i,r.maxY=r.minY+a}else r.minX=-t._x*s,r.maxX=r.minX+s,r.minY=-t._y*i,r.maxY=r.minY+i}var Jc=x(()=>{"use strict"});var we,Ys=x(()=>{"use strict";Gs();ht();Jc();xt();br();we=class r extends Jt{constructor(t=D.EMPTY){t instanceof D&&(t={texture:t});let{texture:e=D.EMPTY,anchor:s,roundPixels:i,width:n,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=i??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof D?new r(t):new r(D.from(t,e))}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return ou(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return I("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let t=this._anchor,e=this._texture,s=this._bounds,{width:i,height:n}=e.orig;s.minX=-t._x*i,s.maxX=s.minX+i,s.minY=-t._y*n,s.maxY=s.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}});function Si(r,t,e){let s=Yw;r.measurable=!0,rs(r,e,s),t.addBoundsMask(s),r.measurable=!1}var Yw,au=x(()=>{"use strict";he();di();Yw=new _t});function Ei(r,t,e){let s=$e.get();r.measurable=!0;let i=Zt.get().identity(),n=HT(r,e,i);pi(r,s,n),r.measurable=!1,t.addBoundsMask(s),Zt.return(i),$e.return(s)}function HT(r,t,e){return r?(r!==t&&(HT(r.parent,t,e),r.updateLocalTransform(),e.append(r.localTransform)),e):(k("Mask bounds, renderable is not inside the root container"),e)}var uu=x(()=>{"use strict";ja();Is();pt()});var Mn,Lm=x(()=>{"use strict";C();Ys();au();uu();Mn=class{constructor(t){this.priority=0,this.inverse=!1,this.channel="red",this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof we),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||Si(this.mask,t,e)}addLocalBounds(t,e){Ei(this.mask,t,e)}containsPoint(t,e){let s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof we}};Mn.extension=m.MaskEffect});var Dn,Nm=x(()=>{"use strict";C();Dn=class{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}};Dn.extension=m.MaskEffect});var Fn,Hm=x(()=>{"use strict";C();_e();au();uu();Fn=class{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){Si(this.mask,t,e)}addLocalBounds(t,e){Ei(this.mask,t,e)}containsPoint(t,e){let s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof lt}};Fn.extension=m.MaskEffect});var ne,js=x(()=>{"use strict";mt();C();Wt();ne=class extends st{constructor(t){t.resource||(t.resource=N.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){let i=super.resize(t,e,s);return i&&this.resizeCanvas(),i}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};ne.extension=m.TextureSource});var ke,Ci=x(()=>{"use strict";C();Wt();ke=class extends st{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}};ke.extension=m.TextureSource});async function lu(){return Wm??(Wm=(async()=>{let t=N.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";let e=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";let s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);let i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);let n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Wm}var Wm,th=x(()=>{"use strict";mt()});var eh,qs,rh=x(()=>{"use strict";C();is();th();Wt();eh=class WT extends st{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...WT.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let t=Gt.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.isValid||t.addEventListener("loadedmetadata",this._onLoadedMetadata),this.alphaMode=await lu(),this._load=new Promise((s,i)=>{this.isValid?s(this):(this._resolve=s,this._reject=i,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){let t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlayThrough),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){let t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("loadedmetadata",this._onLoadedMetadata),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Gt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Gt.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Gt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};eh.extension=m.TextureSource;eh.defaultOptions={...st.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};eh.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};qs=eh});var Vm,at,Tr=x(()=>{"use strict";pt();Bn();Vm=class{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){let e=this._cache.get(t);return e||k(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){let s=Ce(t),i;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(e)){i=l.getCacheableAssets(s,e);break}}let n=new Map(Object.entries(i||{}));i||s.forEach(u=>{n.set(u,e)});let o=[...n.keys()],a={cacheKeys:o,keys:s};s.forEach(u=>{this._cacheMap.set(u,a)}),o.forEach(u=>{let l=i?i[u]:e;this._cache.has(u)&&this._cache.get(u)!==l&&k("[Cache] already has key:",u),this._cache.set(u,n.get(u))})}remove(t){if(!this._cacheMap.has(t)){k(`[Assets] Asset id ${t} was not found in the Cache`);return}let e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}},at=new Vm});function jw(r={}){return Xm(r)}function Xm(r={}){let t=r&&r.resource,e=t?r.resource:r,s=t?r:{resource:r};for(let i=0;i<zm.length;i++){let n=zm[i];if(n.test(e))return new n(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function VT(r={},t=!1){let e=r&&r.resource,s=e?r.resource:r,i=e?r:{resource:r};if(!t&&at.has(s))return at.get(s);let n=new D({source:Xm(i)});return n.on("destroy",()=>{at.has(s)&&at.remove(s)}),t||at.set(s,n),n}function zT(r,t=!1){return typeof r=="string"?at.get(r):r instanceof st?new D({source:r}):VT(r,t)}var zm,$m=x(()=>{"use strict";Tr();C();Wt();ht();zm=[];O.handleByList(m.TextureSource,zm);D.from=zT;st.from=Xm});var sh=x(()=>{"use strict";C();Lm();Nm();Hm();kc();js();Ci();rh();$m();O.add(Mn,Dn,Fn,qs,ke,ne,Hs)});function XT(r){let t=N.get().createCanvas(6,1),e=t.getContext("2d");return e.fillStyle=r,e.fillRect(0,0,6,1),t}function cu(){if(Gn!==void 0)return Gn;try{let r=XT("#ff00ff"),t=XT("#ffff00"),s=N.get().createCanvas(6,1).getContext("2d");s.globalCompositeOperation="multiply",s.drawImage(r,0,0),s.drawImage(t,2,0);let i=s.getImageData(2,0,1,1);if(!i)Gn=!1;else{let n=i.data;Gn=n[0]===255&&n[1]===0&&n[2]===0}}catch{Gn=!1}return Gn}var Gn,ih=x(()=>{"use strict";mt()});var Z,Lr=x(()=>{"use strict";It();mt();Ns();ih();Z={canvas:null,convertTintToImage:!1,cacheStepsPerColorChannel:8,canUseMultiply:cu(),tintMethod:null,_canvasSourceCache:new WeakMap,_unpremultipliedCache:new WeakMap,getCanvasSource:r=>{let t=r.source,e=t?.resource;if(!e)return null;let s=t.alphaMode==="premultiplied-alpha",i=t.resourceWidth??t.pixelWidth,n=t.resourceHeight??t.pixelHeight,o=i!==t.pixelWidth||n!==t.pixelHeight;if(s){if((e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)&&!o)return e;let a=Z._unpremultipliedCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas}if(e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof ArrayBuffer){let a=Z._canvasSourceCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas;let u=N.get().createCanvas(t.pixelWidth,t.pixelHeight),l=u.getContext("2d"),c=l.createImageData(t.pixelWidth,t.pixelHeight),h=c.data,d=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t.format==="bgra8unorm")for(let f=0;f<h.length&&f+3<d.length;f+=4)h[f]=d[f+2],h[f+1]=d[f+1],h[f+2]=d[f],h[f+3]=d[f+3];else h.set(d.subarray(0,h.length));return l.putImageData(c,0,0),Z._canvasSourceCache.set(t,{canvas:u,resourceId:t._resourceId}),u}if(s){let a=N.get().createCanvas(t.pixelWidth,t.pixelHeight),u=a.getContext("2d",{willReadFrequently:!0});a.width=t.pixelWidth,a.height=t.pixelHeight,u.drawImage(e,0,0);let l=u.getImageData(0,0,a.width,a.height),c=l.data;for(let h=0;h<c.length;h+=4){let d=c[h+3];if(d>0){let f=255/d;c[h]=Math.min(255,c[h]*f+.5),c[h+1]=Math.min(255,c[h+1]*f+.5),c[h+2]=Math.min(255,c[h+2]*f+.5)}}return u.putImageData(l,0,0),Z._unpremultipliedCache.set(t,{canvas:a,resourceId:t._resourceId}),a}if(o){let a=Z._canvasSourceCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas;let u=N.get().createCanvas(t.pixelWidth,t.pixelHeight),l=u.getContext("2d");return u.width=t.pixelWidth,u.height=t.pixelHeight,l.drawImage(e,0,0),Z._canvasSourceCache.set(t,{canvas:u,resourceId:t._resourceId}),u}return e},getTintedCanvas:(r,t)=>{let e=r.texture,s=X.shared.setValue(t).toHex(),i=e.tintCache||(e.tintCache={}),n=i[s],o=e.source._resourceId;if(n?.tintId===o)return n;let a=n&&"getContext"in n?n:N.get().createCanvas();if(Z.tintMethod(e,t,a),a.tintId=o,Z.convertTintToImage&&a.toDataURL!==void 0){let u=N.get().createImage();u.src=a.toDataURL(),u.tintId=o,i[s]=u}else i[s]=a;return i[s]},getTintedPattern:(r,t)=>{let e=X.shared.setValue(t).toHex(),s=r.patternCache||(r.patternCache={}),i=r.source._resourceId,n=s[e];return n?.tintId===i||(Z.canvas||(Z.canvas=N.get().createCanvas()),Z.tintMethod(r,t,Z.canvas),n=Z.canvas.getContext("2d").createPattern(Z.canvas,"repeat"),n.tintId=i,s[e]=n),n},applyPatternTransform:(r,t,e=!0)=>{if(!t)return;let s=r;if(!s.setTransform)return;let i=globalThis.DOMMatrix;if(!i)return;let n=new i([t.a,t.b,t.c,t.d,t.tx,t.ty]);s.setTransform(e?n.inverse():n)},tintWithMultiply:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.fillStyle=X.shared.setValue(t).toHex(),s.fillRect(0,0,u,l),s.globalCompositeOperation="multiply";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.globalCompositeOperation="destination-atop",s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore()},tintWithOverlay:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.globalCompositeOperation="copy",s.fillStyle=X.shared.setValue(t).toHex(),s.fillRect(0,0,u,l),s.globalCompositeOperation="destination-atop";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore()},tintWithPerPixel:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.globalCompositeOperation="copy";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore();let h=t>>16&255,d=t>>8&255,f=t&255,p=s.getImageData(0,0,u,l),g=p.data;for(let _=0;_<g.length;_+=4)g[_]=g[_]*h/255,g[_+1]=g[_+1]*d/255,g[_+2]=g[_+2]*f/255;s.putImageData(p,0,0)},_applyInverseRotation:(r,t,e,s)=>{let i=q.inv(t),n=q.uX(i),o=q.uY(i),a=q.vX(i),u=q.vY(i),l=-Math.min(0,n*e,a*s,n*e+a*s),c=-Math.min(0,o*e,u*s,o*e+u*s);r.transform(n,o,a,u,l,c)}};Z.tintMethod=Z.canUseMultiply?Z.tintWithMultiply:Z.tintWithPerPixel});var nh,be,Ks=x(()=>{"use strict";mt();En();Us();nh=class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){let s=N.get().createCanvas();s.width=t,s.height=e;let i=s.getContext("2d");return{canvas:s,context:i}}getOptimalCanvasAndContext(t,e,s=1){t=Math.ceil(t*s-1e-6),e=Math.ceil(e*s-1e-6),t=Ir(t),e=Ir(e);let i=(t<<17)+(e<<1);this._canvasPool[i]||(this._canvasPool[i]=[]);let n=this._canvasPool[i].pop();return n||(n=this._createCanvasAndContext(t,e)),n}returnCanvasAndContext(t){let e=t.canvas,{width:s,height:i}=e,n=(s<<17)+(i<<1);t.context.resetTransform(),t.context.clearRect(0,0,s,i),this._canvasPool[n].push(t)}clear(){this._canvasPool={}}},be=new nh;rr.register(be)});function Ai(r,t,e,s,i,n){let o=r-e,a=t-s,u=i-e,l=n-s,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let f,p;d<0?(f=e,p=s):d>1?(f=i,p=n):(f=e+d*u,p=s+d*l);let g=r-f,_=t-p;return g*g+_*_}var oh=x(()=>{"use strict"});function ah(r,t,e,s,i,n,o,a){let u=o-e,l=a-s,c=i-e,h=n-s,d=r-e,f=t-s,p=u*u+l*l,g=u*c+l*h,_=u*d+l*f,b=c*c+h*h,y=c*d+h*f,v=1/(p*b-g*g),T=(b*_-g*y)*v,S=(p*y-g*_)*v;return T>=0&&S>=0&&T+S<1}var Ym=x(()=>{"use strict"});var hu,jm=x(()=>{"use strict";jt();hu=class r{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new r(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;let s=this.radius*this.radius,i=this.x-t,n=this.y-e;return i*=i,n*=n,i+n<=s}strokeContains(t,e,s,i=.5){if(this.radius===0)return!1;let n=this.x-t,o=this.y-e,a=this.radius,u=(1-i)*s,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(s-u)}getBounds(t){return t||(t=new J),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}});var du,qm=x(()=>{"use strict";jt();du=class r{constructor(t=0,e=0,s=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=i}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return s*=s,i*=i,s+i<=1}strokeContains(t,e,s,i=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return!1;let a=s*(1-i),u=s-a,l=n-u,c=o-u,h=n+a,d=o+a,f=t-this.x,p=e-this.y,g=f*f/(l*l)+p*p/(c*c),_=f*f/(h*h)+p*p/(d*d);return g>1&&_<=1}getBounds(t){return t||(t=new J),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}});var qw,Kw,wi,Km=x(()=>{"use strict";xt();oh();jt();wi=class r{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){let s=[];for(let i=0,n=e.length;i<n;i++)s.push(e[i].x,e[i].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0,e=this.points,s=e.length;for(let i=0;i<s;i+=2){let n=e[i],o=e[i+1],a=e[(i+2)%s],u=e[(i+3)%s];t+=(a-n)*(u+o)}return t<0}containsPolygon(t){let e=this.getBounds(qw),s=t.getBounds(Kw);if(!e.containsRect(s))return!1;let i=t.points;for(let n=0;n<i.length;n+=2){let o=i[n],a=i[n+1];if(!this.contains(o,a))return!1}return!0}clone(){let t=this.points.slice(),e=new r(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1,i=this.points.length/2;for(let n=0,o=i-1;n<i;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>e!=c>e&&t<(l-a)*((e-u)/(c-u))+a&&(s=!s)}return s}strokeContains(t,e,s,i=.5){let n=s*s,o=n*(1-i),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],f=u[(c+2)%u.length],p=u[(c+3)%u.length],g=Ai(t,e,h,d,f,p),_=Math.sign((f-h)*(e-d)-(p-d)*(t-h));if(g<=(_<0?a:o))return!0}return!1}getBounds(t){t||(t=new J);let e=this.points,s=1/0,i=-1/0,n=1/0,o=-1/0;for(let a=0,u=e.length;a<u;a+=2){let l=e[a],c=e[a+1];s=l<s?l:s,i=l>i?l:i,n=c<n?c:n,o=c>o?c:o}return t.x=s,t.width=i-s,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return I("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return I("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}});var uh,fu,Zm=x(()=>{"use strict";jt();uh=(r,t,e,s,i,n,o)=>{let a=r-e,u=t-s,l=Math.sqrt(a*a+u*u);return l>=i-n&&l<=i+o},fu=class r{constructor(t=0,e=0,s=0,i=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=i,this.radius=n}getBounds(t){return t||(t=new J),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){let s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),n=e-(this.y+s),o=s*s;if(i*i+n*n<=o||(i=t-(this.x+this.width-s),i*i+n*n<=o)||(n=e-(this.y+this.height-s),i*i+n*n<=o)||(i=t-(this.x+s),i*i+n*n<=o))return!0}return!1}strokeContains(t,e,s,i=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=s*(1-i),h=s-c,d=n+l,f=o+l,p=a-l*2,g=u-l*2,_=n+a,b=o+u;return(t>=n-c&&t<=n+h||t>=_-h&&t<=_+c)&&e>=f&&e<=f+g||(e>=o-c&&e<=o+h||e>=b-h&&e<=b+c)&&t>=d&&t<=d+p?!0:t<d&&e<f&&uh(t,e,d,f,l,h,c)||t>_-l&&e<f&&uh(t,e,_-l,f,l,h,c)||t>_-l&&e>b-l&&uh(t,e,_-l,b-l,l,h,c)||t<d&&e>b-l&&uh(t,e,d,b-l,l,h,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}});var Qm,$T=x(()=>{"use strict";oh();jt();Qm=class r{constructor(t=0,e=0,s=0,i=0,n=0,o=0){this.type="triangle",this.x=t,this.y=e,this.x2=s,this.y2=i,this.x3=n,this.y3=o}contains(t,e){let s=(this.x-this.x3)*(e-this.y3)-(this.y-this.y3)*(t-this.x3),i=(this.x2-this.x)*(e-this.y)-(this.y2-this.y)*(t-this.x);if(s<0!=i<0&&s!==0&&i!==0)return!1;let n=(this.x3-this.x2)*(e-this.y2)-(this.y3-this.y2)*(t-this.x2);return n===0||n<0==s+i<=0}strokeContains(t,e,s,i=.5){let n=s/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return Ai(t,e,a,c,u,d)<=o||Ai(t,e,u,h,l,d)<=o||Ai(t,e,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x2=t.x2,this.y2=t.y2,this.x3=t.x3,this.y3=t.y3,this}copyTo(t){return t.copyFrom(this),t}getBounds(t){t||(t=new J);let e=Math.min(this.x,this.x2,this.x3),s=Math.max(this.x,this.x2,this.x3),i=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return t.x=e,t.y=i,t.width=s-e,t.height=n-i,t}}});function pu(r,t){t.clear();let e=t.matrix;for(let s=0;s<r.length;s++){let i=r[s];if(i.globalDisplayStatus<7)continue;let n=i.renderGroup??i.parentRenderGroup;n?.isCachedAsTexture?t.matrix=YT.copyFrom(n.textureOffsetInverseTransform).append(i.worldTransform):n?._parentCacheAsTextureRenderGroup?t.matrix=YT.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(i.groupTransform):t.matrix=i.worldTransform,t.addBounds(i.bounds)}return t.matrix=e,t}var YT,lh=x(()=>{"use strict";ot();YT=new F});function Pi(r,t,e,s,i=!1){let n=Zw;n.minX=0,n.minY=0,n.maxX=r.width/s|0,n.maxY=r.height/s|0;let o=yt.getOptimalTexture(n.width,n.height,s,!1,i);return o.source.uploadMethodId="image",o.source.resource=r,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=t/s,o.frame.height=e/s,o.source.emit("update",o.source),o.updateUvs(),o}var Zw,mu=x(()=>{"use strict";_r();he();Zw=new _t});function Jm(r){return typeof r.getCanvasFilterString=="function"}var tg,Un,eg=x(()=>{"use strict";C();Lr();Ks();he();lh();mu();tg=class{constructor(){this.skip=!1,this.useClip=!1,this.filters=null,this.container=null,this.bounds=new _t,this.cssFilterString=""}},Un=class{constructor(t){this._filterStack=[],this._filterStackIndex=0,this._savedStates=[],this._alphaMultiplier=1,this._warnedFilterTypes=new Set,this.renderer=t}push(t){let e=this._pushFilterFrame(),s=t.filterEffect.filters;if(e.skip=!1,e.useClip=!1,e.filters=s,e.container=t.container,e.cssFilterString="",s.every(u=>!u.enabled)){e.skip=!0;return}let i=[],n=1;for(let u of s){if(!u.enabled)continue;if(!Jm(u)){this._warnUnsupportedFilter(u);continue}let l=u.getCanvasFilterString();if(l===null){this._warnUnsupportedFilter(u);continue}l&&i.push(l)}if(i.length===0&&n===1){e.skip=!0;return}e.cssFilterString=i.join(" "),this._calculateFilterArea(t,e.bounds),e.useClip=!!t.filterEffect.filterArea;let o=this.renderer.canvasContext.activeContext,a=o.filter||"none";if(this._savedStates.push({filter:a,alphaMultiplier:this._alphaMultiplier}),e.useClip&&Number.isFinite(e.bounds.width)&&Number.isFinite(e.bounds.height)&&e.bounds.width>0&&e.bounds.height>0){let u=this.renderer.canvasContext.activeResolution||1;o.save(),o.setTransform(1,0,0,1,0,0),o.beginPath(),o.rect(e.bounds.x*u,e.bounds.y*u,e.bounds.width*u,e.bounds.height*u),o.clip()}else e.useClip=!1;n!==1&&(this._alphaMultiplier*=n),e.cssFilterString&&(o.filter=a!=="none"?`${a} ${e.cssFilterString}`:e.cssFilterString)}pop(){let t=this._popFilterFrame();if(t.skip)return;let e=this._savedStates.pop();if(!e)return;let s=this.renderer.canvasContext.activeContext;t.useClip?s.restore():s.filter=e.filter,this._alphaMultiplier=e.alphaMultiplier}generateFilteredTexture({texture:t,filters:e}){if(!e?.length||e.every(b=>!b.enabled))return t;let s=[],i=1;for(let b of e){if(!b.enabled)continue;if(!Jm(b)){this._warnUnsupportedFilter(b);continue}let y=b.getCanvasFilterString();if(y===null){this._warnUnsupportedFilter(b);continue}y&&s.push(y)}if(s.length===0&&i===1)return t;let n=Z.getCanvasSource(t);if(!n)return t;let o=t.frame,a=t.source._resolution??t.source.resolution??1,u=o.width,l=o.height,c=be.getOptimalCanvasAndContext(u,l,a),{canvas:h,context:d}=c;d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,h.width,h.height),s.length&&(d.filter=s.join(" ")),i!==1&&(d.globalAlpha=i);let f=o.x*a,p=o.y*a,g=u*a,_=l*a;return d.drawImage(n,f,p,g,_,0,0,g,_),d.filter="none",d.globalAlpha=1,Pi(h,u,l,a)}_calculateFilterArea(t,e){if(t.renderables?pu(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){let i=(t.container.renderGroup||t.container.parentRenderGroup)?.cacheToLocalTransform;i&&e.applyMatrix(i)}}_warnUnsupportedFilter(t){let e=t?.constructor?.name||"Filter";this._warnedFilterTypes.has(e)||(this._warnedFilterTypes.add(e),console.warn(`CanvasRenderer: filter "${e}" is not supported in Canvas2D and will be skipped.`))}get alphaMultiplier(){return this._alphaMultiplier}_pushFilterFrame(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new tg),this._filterStackIndex++,t}_popFilterFrame(){return this._filterStackIndex<=0?this._filterStack[0]:(this._filterStackIndex--,this._filterStack[this._filterStackIndex])}destroy(){this._filterStack=null,this._savedStates=null,this._warnedFilterTypes=null,this._alphaMultiplier=1}};Un.extension={type:[m.CanvasSystem],name:"filter"}});var In,rg=x(()=>{"use strict";C();In=class{constructor(t){this._renderer=t}push(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:e,filterEffect:t})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(t){t.action==="pushFilter"?this._renderer.filter.push(t):t.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}};In.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"filter"}});function Nr(r,t){let e=jT[r];return e===void 0&&(sg[t]===void 0&&(sg[t]=1),jT[r]=e=sg[t]++),e}var sg,jT,kn=x(()=>{"use strict";sg=Object.create(null),jT=Object.create(null)});function gu(){return(!ch||ch?.isContextLost())&&(ch=N.get().createCanvas().getContext("webgl",{})),ch}var ch,hh=x(()=>{"use strict";mt()});function ig(){if(!dh){dh="mediump";let r=gu();r&&r.getShaderPrecisionFormat&&(dh=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump")}return dh}var dh,ng=x(()=>{"use strict";hh()});function og(r,t,e){return t?r:e?(r=r.replace("out vec4 finalColor;",""),`
|
|
17
|
+
`,t.accessibleText&&(s.innerText=t.accessibleText)),s.style.width=`${RT}px`,s.style.height=`${RT}px`,s.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",s.style.position="absolute",s.style.zIndex=MT.toString(),s.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?s.setAttribute("aria-live","off"):s.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?s.setAttribute("aria-relevant","additions"):s.setAttribute("aria-relevant","text"),s.addEventListener("click",this._onClick.bind(this)),s.addEventListener("focus",this._onFocus.bind(this)),s.addEventListener("focusout",this._onFocusOut.bind(this))),s.style.pointerEvents=t.accessiblePointerEvents,s.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?s.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(s.title=`container ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&s.setAttribute("aria-label",t.accessibleHint),t.interactive?s.tabIndex=t.tabIndex:s.tabIndex=0,this.debug&&this._updateDebugHTML(s),t._accessibleActive=!0,t._accessibleDiv=s,s.container=t,this._children.push(t),this._div.appendChild(t._accessibleDiv)}_dispatchEvent(t,e){let{container:s}=t.target,i=this._renderer.events.rootBoundary,n=Object.assign(new ns(i),{target:s});i.rootTarget=this._renderer.lastObjectRendered,e.forEach(o=>i.dispatchEvent(n,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode!==Gw||!this._activateOnTab||this._activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(t){t?this._activate():this._deactivate()}_getPool(t){return this._pools[t]||(this._pools[t]=[]),this._pools[t]}};ym.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"accessibility"};ym.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};vm=ym});var Sm,Em=x(()=>{"use strict";Sm={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1}});var GT=x(()=>{"use strict";C();_e();Tm();Em();O.add(vm);O.mixin(lt,Sm)});var Rn,Cm=x(()=>{"use strict";C();zc();Rn=class{constructor(t){this._attachedDomElements=[],this._renderer=t,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new Ei({domElement:this._domElement,renderer:this._renderer})}addRenderable(t,e){this._attachedDomElements.includes(t)||this._attachedDomElements.push(t)}updateRenderable(t){}validateRenderable(t){return!0}postrender(){let t=this._attachedDomElements;if(t.length===0){this._domElement.remove();return}this._canvasObserver.ensureAttached();for(let e=0;e<t.length;e++){let s=t[e],i=s.element;if(!s.parent||s.globalDisplayStatus<7)i?.remove(),t.splice(e,1),e--;else{this._domElement.contains(i)||(i.style.position="absolute",i.style.pointerEvents="auto",this._domElement.appendChild(i));let n=s.worldTransform,o=s._anchor,a=s.width*o.x,u=s.height*o.y;i.style.transformOrigin=`${a}px ${u}px`,i.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, ${n.tx-a}, ${n.ty-u})`,i.style.opacity=s.groupAlpha.toString()}}}destroy(){this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++)this._attachedDomElements[t].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}};Rn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"dom"}});var Jt,br=x(()=>{"use strict";he();_e();Jt=class extends lt{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new _t(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){let e=this.bounds,{x:s,y:i}=t;return s>=e.minX&&s<=e.maxX&&i>=e.minY&&i<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,s){let{renderPipes:i}=e;i.blendMode.pushBlendMode(this,this.groupBlendMode,t);let o=i[this.renderPipeId];o?.addRenderable&&o.addRenderable(this,t),this.didViewUpdate=!1;let a=this.children,u=a.length;for(let l=0;l<u;l++)a[l].collectRenderables(t,e,s);i.blendMode.popBlendMode(t)}}});var Am,UT=x(()=>{"use strict";Ue();br();Am=class extends Jt{constructor(t={}){let{element:e,anchor:s,...i}=t;super({label:"DOMContainer",...i}),this.renderPipeId="dom",this.batched=!1,this._anchor=new nt(0,0),s&&(this.anchor=s),this.element=t.element||document.createElement("div")}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set element(t){this._element!==t&&(this._element=t,this.onViewUpdate())}get element(){return this._element}updateBounds(){let t=this._bounds,e=this._element;if(!e){t.minX=0,t.minY=0,t.maxX=0,t.maxY=0;return}let{offsetWidth:s,offsetHeight:i}=e;t.minX=0,t.maxX=s,t.minY=0,t.maxY=i}destroy(t=!1){super.destroy(t),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null}}});var IT=x(()=>{"use strict";C();Cm();O.add(Rn)});var wm,ur,$c=x(()=>{"use strict";zs();is();wm=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this._tickerAdded||!this.domElement||(Gt.system.add(this._tickerUpdate,this,Se.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(Gt.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}):new MouseEvent("mousemove",{clientX:t.clientX,clientY:t.clientY}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},ur=new wm});var Or,tu=x(()=>{"use strict";Ue();Qa();Or=class extends ns{constructor(){super(...arguments),this.client=new nt,this.movement=new nt,this.offset=new nt,this.global=new nt,this.screen=new nt}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,s){return t.worldTransform.applyInverse(s||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,s,i,n,o,a,u,l,c,h,d,f,p,g){throw new Error("Method not implemented.")}}});var Ee,Yc=x(()=>{"use strict";tu();Ee=class extends Or{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}});var yr,jc=x(()=>{"use strict";tu();yr=class extends Or{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};yr.DOM_DELTA_PIXEL=0;yr.DOM_DELTA_LINE=1;yr.DOM_DELTA_PAGE=2});var Nw,Hw,eu,ru,Pm=x(()=>{"use strict";le();Ue();pt();$c();tu();Yc();jc();Nw=2048,Hw=new nt,eu=new nt,ru=class{constructor(t){this.dispatch=new St,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((s,i)=>s.priority-i.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;let e=this.mappingTable[t.type];if(e)for(let s=0,i=e.length;s<i;s++)e[s].fn(t);else k(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){ur.pauseUpdate=!0;let i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[i](this.rootTarget,this.rootTarget.eventMode,Hw.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;let s=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,n=s.length-1;i<n;i++)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!(t.propagationStopped||t.propagationImmediatelyStopped)){t.eventPhase=t.BUBBLING_PHASE;for(let i=s.length-2;i>=0;i--)if(t.currentTarget=s[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;let i=Array.isArray(e)?e:[e];for(let n=s.length-1;n>=0;n--)i.forEach(o=>{t.currentTarget=s[n],this.notifyTarget(t,o)})}propagationPath(t){let e=[t];for(let s=0;s<Nw&&t!==this.rootTarget&&t.parent;s++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,s,i,n,o=!1){let a=!1;if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ur.pauseUpdate=!1),t.interactiveChildren&&t.children){let c=t.children;for(let h=c.length-1;h>=0;h--){let d=c[h],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,s,i,n,o||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;let p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}let u=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(t,s)&&i(t,s)?l?[t]:[]:null}hitTestRecursive(t,e,s,i,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ur.pauseUpdate=!1),t.interactiveChildren&&t.children){let u=t.children,l=s;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(e)?e:h.eventMode,l,i,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let f=t.isInteractive();return(d.length>0||f)&&d.push(t),d}}}let o=this._isInteractive(e),a=t.isInteractive();return o&&i(t,s)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!t||!t.visible||!t.renderable||!t.measurable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,eu),!t.hitArea.contains(eu.x,eu.y)))return!0;if(t.effects&&t.effects.length)for(let s=0;s<t.effects.length;s++){let i=t.effects[s];if(i.containsPoint&&!i.containsPoint(e,this.hitTestFn))return!0}return!1}hitTestFn(t,e){return t.hitArea?!0:t?.containsPoint?(t.worldTransform.applyInverse(e,eu),t.containsPoint(eu)):!1}notifyTarget(t,e){if(!t.currentTarget.isInteractive())return;e??(e=t.type);let s=`on${e}`;t.currentTarget[s]?.(t);let i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){let i=e.button===2;this.dispatchEvent(e,i?"rightdown":"mousedown")}let s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;let s=e.pointerType==="mouse"||e.pointerType==="pen",i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.overTargets);if(i.overTargets?.length>0&&n!==e.target){let u=t.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(t,u,n);if(this.dispatchEvent(l,"pointerout"),s&&this.dispatchEvent(l,"mouseout"),!e.composedPath().includes(n)){let c=this.createPointerEvent(t,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),s&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c)}this.freeEvent(l)}if(n!==e.target){let u=t.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(e,u);this.dispatchEvent(l,"pointerover"),s&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==e.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),s&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(l)}let o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&o.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&o.push("globaltouchmove")),s&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&o.push("globalmousemove"),this.cursor=e.target?.cursor),o.length>0&&this.all(e,o),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId),s=this.createPointerEvent(t),i=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),i&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=s.target?.cursor);let n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),i&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;e.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId);if(e.overTargets){let s=t.pointerType==="mouse"||t.pointerType==="pen",i=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(t,"pointerleave",i);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),s&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;e.overTargets=null,this.freeEvent(n),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){let a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}let i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),o=n;if(n&&!s.composedPath().includes(n)){let a=n;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){let u=s.button===2;this.notifyTarget(s,u?"rightupoutside":"mouseupoutside")}a=a.parent}delete i.pressTargetsByButton[t.button],o=a}if(o){let a=this.clonePointerEvent(s,"click");a.target=o,a.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:e});let u=i.clicksByButton[t.button];if(u.target===a.target&&e-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=e,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof Ee)){k("EventBoundary cannot map a non-pointer event as a pointer event");return}let e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(s){let n=s;for(;n;)i.currentTarget=n,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch"?this.notifyTarget(i,"touchendoutside"):(i.pointerType==="mouse"||i.pointerType==="pen")&&this.notifyTarget(i,i.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof yr)){k("EventBoundary cannot map a non-wheel event as a wheel event");return}let e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s<t.length&&t[s].parent===e;s++)e=t[s];return e}createPointerEvent(t,e,s){let i=this.allocateEvent(Ee);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=s??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],typeof e=="string"&&(i.type=e),i}createWheelEvent(t){let e=this.allocateEvent(yr);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){let s=this.allocateEvent(Ee);return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=e??s.type,s}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Ee&&e instanceof Ee&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Or&&e instanceof Or&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);let e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){let s=t.currentTarget._events[e];if(s)if("fn"in s)s.once&&t.currentTarget.removeListener(e,s.fn,void 0,!0),s.fn.call(s.context,t);else for(let i=0,n=s.length;i<n&&!t.propagationImmediatelyStopped;i++)s[i].once&&t.currentTarget.removeListener(e,s[i].fn,void 0,!0),s[i].fn.call(s[i].context,t)}}});var Ww,Vw,Rm,su,qc=x(()=>{"use strict";C();Pm();$c();Yc();jc();Ww=1,Vw={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Rm=class Bm{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new ru(null),ur.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Ee(null),this._rootWheelEvent=new yr(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Bm.defaultEventFeatures},{set:(e,s,i)=>(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=i),e[s]=i,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:e,resolution:s}=this.renderer;this.setTargetElement(e),this.resolution=s,Bm._defaultEventMode=t.eventMode??"passive",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){ur.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;let s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=this._normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let s=0,i=e.length;s<i;s++){let n=e[s],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,ur.pointerMoved();let e=this._normalizeToPointerData(t);for(let s=0,i=e.length;s<i;s++){let n=this._bootstrapEvent(this._rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);let s=e!==this.domElement?"outside":"",i=this._normalizeToPointerData(t);for(let n=0,o=i.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,i[n]);a.type+=s,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=this._normalizeToPointerData(t);for(let s=0,i=e.length;s<i;s++){let n=this._bootstrapEvent(this._rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;let e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,ur.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;ur.addTickerListener();let t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;ur.removeTickerListener();let t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,s){let i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*n,t.y=(s-i.top)*(this.domElement.height/i.height)*n}_normalizeToPointerData(t){let e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,i=t.changedTouches.length;s<i;s++){let n=t.changedTouches[s];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,n.altKey??(n.altKey=t.altKey),n.ctrlKey??(n.ctrlKey=t.ctrlKey),n.metaKey??(n.metaKey=t.metaKey),n.shiftKey??(n.shiftKey=t.shiftKey),e.push(n)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){let s=t;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=Ww),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e}normalizeWheelEvent(t){let e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Vw[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Rm.extension={name:"events",type:[m.WebGLSystem,m.CanvasSystem,m.WebGPUSystem],priority:-1};Rm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};su=Rm});var Mm,Dm=x(()=>{"use strict";qc();Qa();Mm={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??su.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,t,e){let s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,i=typeof e=="object"?e.signal:void 0,n=typeof e=="object"?e.once===!0:!1,o=typeof t=="function"?void 0:t;r=s?`${r}capture`:r;let a=typeof t=="function"?t:t.handleEvent,u=this;i&&i.addEventListener("abort",()=>{u.off(r,a,o)}),n?u.once(r,a,o):u.on(r,a,o)},removeEventListener(r,t,e){let s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,i=typeof t=="function"?void 0:t;r=s?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.off(r,t,i)},dispatchEvent(r){if(!(r instanceof ns))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}}});var kT=x(()=>{"use strict";C();_e();qc();Dm();O.add(su);O.mixin(lt,Mm)});var Lt,ir=x(()=>{"use strict";Lt=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Lt||{})});var Fm,Gm=x(()=>{"use strict";Fm={createCanvas:(r,t)=>{let e=document.createElement("canvas");return e.width=r,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")}});var OT,N,mt=x(()=>{"use strict";Gm();OT=Fm,N={get(){return OT},set(r){OT=r}}});function vr(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function iu(r){return r.split("?")[0].split("#")[0]}function zw(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xw(r,t,e){return r.replace(new RegExp(zw(t),"g"),e)}function $w(r,t){let e="",s=0,i=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||n===1))if(i!==a-1&&n===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){let u=e.lastIndexOf("/");if(u!==e.length-1){u===-1?(e="",s=0):(e=e.slice(0,u),s=e.length-1-e.lastIndexOf("/")),i=a,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,i=a,n=0;continue}}t&&(e.length>0?e+="/..":e="..",s=2)}else e.length>0?e+=`/${r.slice(i+1,a)}`:e=r.slice(i+1,a),s=a-i-1;i=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}var ee,Xs=x(()=>{"use strict";mt();ee={toPosix(r){return Xw(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){vr(r),r=this.toPosix(r);let t=/^file:\/\/\//.exec(r);if(t)return t[0];let e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(vr(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let s=iu(this.toPosix(t??N.get().getBaseUrl())),i=iu(this.toPosix(e??this.rootname(s)));return r=this.toPosix(r),r.startsWith("/")?ee.join(i,r.slice(1)):this.isAbsolute(r)?r:this.join(s,r)},normalize(r){if(vr(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="",e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));let s=r.endsWith("/");return r=$w(r,!1),r.length>0&&s&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return vr(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e<r.length;++e){let s=r[e];if(vr(s),s.length>0)if(t===void 0)t=s;else{let i=r[e-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(vr(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0),e=t===47,s=-1,i=!0,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(t=r.charCodeAt(a),t===47){if(!i){s=a;break}}else i=!1;return s===-1?e?"/":this.isUrl(o)?n+r:n:e&&s===1?"//":n+r.slice(0,s)},rootname(r){vr(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){let e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){vr(r),t&&vr(t),r=iu(this.toPosix(r));let e=0,s=-1,i=!0,n;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!i){e=n+1;break}}else a===-1&&(i=!1,a=n+1),o>=0&&(u===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return e===s?s=a:s===-1&&(s=r.length),r.slice(e,s)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!i){e=n+1;break}}else s===-1&&(i=!1,s=n+1);return s===-1?"":r.slice(e,s)},extname(r){vr(r),r=iu(this.toPosix(r));let t=-1,e=0,s=-1,i=!0,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!i){e=o+1;break}continue}s===-1&&(i=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":r.slice(t,s)},parse(r){vr(r);let t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=iu(this.toPosix(r));let e=r.charCodeAt(0),s=this.isAbsolute(r),i,n="";t.root=this.rootname(r),s||this.hasProtocol(r)?i=1:i=0;let o=-1,a=0,u=-1,l=!0,c=r.length-1,h=0;for(;c>=i;--c){if(e=r.charCodeAt(c),e===47){if(!l){a=c+1;break}continue}u===-1&&(l=!1,u=c+1),e===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&s?t.base=t.name=r.slice(1,u):t.base=t.name=r.slice(a,u)):(a===0&&s?(t.name=r.slice(1,o),t.base=r.slice(1,u)):(t.name=r.slice(a,o),t.base=r.slice(a,u)),t.ext=r.slice(o,u)),t.dir=this.dirname(r),n&&(t.dir=n+t.dir),t},sep:"/",delimiter:":",joinExtensions:[".html"]}});var Ce,Mn=x(()=>{"use strict";Ce=(r,t,e=!1)=>(Array.isArray(r)||(r=[r]),t?r.map(s=>typeof s=="string"||e?t(s):s):r)});function LT(r,t,e,s,i){let n=t[e];for(let o=0;o<n.length;o++){let a=n[o];e<t.length-1?LT(r.replace(s[e],a),t,e+1,s,i):i.push(r.replace(s[e],a))}}function Um(r){let t=/\{(.*?)\}/g,e=r.match(t),s=[];if(e){let i=[];e.forEach(n=>{let o=n.substring(1,n.length-1).split(",");i.push(o)}),LT(r,i,0,e,s)}else s.push(r);return s}var Im=x(()=>{"use strict"});var $s,nu=x(()=>{"use strict";$s=r=>!Array.isArray(r)});function NT(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Ae,Ys=x(()=>{"use strict";pt();Xs();Mn();Im();nu();Ae=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{let e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){let{alias:e,src:s}=t;return Ce(e||s,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&k("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){let s=[],i=e;Array.isArray(e)||(i=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),i.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(t,a);s.push(l),u=[a,l]}else{let l=a.map(c=>this._createBundleAssetId(t,c));s.push(...l),u=[...a,...l]}this.add({...n,alias:u,src:o})}),this._bundles[t]=s}add(t){let e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&k(`[Resolver] already has key: ${n} overwriting`)},Ce(e).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l,parser:c}=n,h=Ce(o).map(g=>typeof g=="string"?Um(g):Array.isArray(g)?g:[g]),d=this.getAlias(n);Array.isArray(d)?d.forEach(s):s(d);let f=[],p=g=>{let _=this._parsers.find(b=>b.test(g));return{src:g,..._?.parse(g)}};h.forEach(g=>{g.forEach(_=>{let b={};if(typeof _!="object"?b=p(_):(a=_.data??a,u=_.format??u,(_.loadParser||_.parser)&&(l=_.loadParser??l,c=_.parser??c),b={...p(_.src),..._}),!d)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:d,data:a,format:u,loadParser:l,parser:c,progressSize:n.progressSize}),f.push(b)})}),d.forEach(g=>{this._assetMap[g]=f})})}resolveBundle(t){let e=$s(t);t=Ce(t);let s={};return t.forEach(i=>{let n=this._bundles[i];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(i,u)]=l}s[i]=a}}),e?s[t[0]]:s}resolveUrl(t){let e=this.resolve(t);if(typeof t!="string"){let s={};for(let i in e)s[i]=e[i].src;return s}return e.src}resolve(t){let e=$s(t);t=Ce(t);let s={};return t.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let n=this._assetMap[i],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:!1);l.length&&(n=l)})}),this._resolverHash[i]=n[0]}else this._resolverHash[i]=this._buildResolvedAsset({alias:[i],src:i},{});s[i]=this._resolverHash[i]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){let s=t[e],i=this._preferredOrder.find(n=>n.params.format.includes(s.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;let e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){let{aliases:s,data:i,loadParser:n,parser:o,format:a,progressSize:u}=e;return(this._basePath||this._rootPath)&&(t.src=ee.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=n??t.loadParser,t.parser=o??t.parser,t.format=a??t.format??NT(t.src),u!==void 0&&(t.progressSize=u),t}};Ae.RETINA_PREFIX=/@([0-9\.]+)x/});var Dn,Kc=x(()=>{"use strict";Dn=(r,t)=>{let e=t.split("?")[1];return e&&(r+=`?${e}`),r}});var HT,Zc,km=x(()=>{"use strict";jt();Wt();ht();HT=class ou{constructor(t,e){this.linkedSheets=[];let s=t;t?.source instanceof st&&(s={texture:t,data:e});let{texture:i,data:n,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=i instanceof D?i:null,this.textureSource=i.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,i.source.resolution=this.resolution):this.resolution=i.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=ou.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,e=!1){let s=t,i=e?1/0:ou.BATCH_SIZE;for(;s-t<i&&s<this._frameKeys.length;){let n=this._frameKeys[s],o=this._frames[n],a=o.frame;if(a){let u=null,l=null,c=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,h=new J(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);o.rotated?u=new J(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):u=new J(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(l=new J(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[n]=new D({source:this.textureSource,frame:u,orig:h,trim:l,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:n.toString()})}s++}}_processAnimations(){let t=this.data.animations||{};for(let e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){let i=t[e][s];this.animations[e].push(this.textures[i])}}}_parseComplete(){let t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*ou.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ou.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};HT.BATCH_SIZE=1e3;Zc=HT});function WT(r,t,e){let s={};if(r.forEach(i=>{s[i]=t}),Object.keys(t.textures).forEach(i=>{s[`${t.cachePrefix}${i}`]=t.textures[i]}),!e){let i=ee.dirname(r[0]);t.linkedSheets.forEach((n,o)=>{let a=WT([`${i}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}var Yw,Om,Lm=x(()=>{"use strict";ir();Ys();Kc();C();ht();Xs();km();Yw=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Om={extension:m.Asset,cache:{test:r=>r instanceof Zc,getCacheableAssets:(r,t)=>WT(r,t,!1)},resolver:{extension:{type:m.ResolveParser,name:"resolveSpritesheet"},test:r=>{let e=r.split("?")[0].split("."),s=e.pop(),i=e.pop();return s==="json"&&Yw.includes(i)},parse:r=>{let t=r.split(".");return{resolution:parseFloat(Ae.RETINA_PREFIX.exec(r)?.[1]??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:m.LoadParser,priority:Lt.Normal,name:"spritesheetLoader"},async testParse(r,t){return ee.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){let{texture:s,imageFilename:i,textureOptions:n,cachePrefix:o}=t?.data??{},a=ee.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(s instanceof D)u=s;else{let h=Dn(a+(i??r.meta.image),t.src);u=(await e.load([{src:h,data:n}]))[h]}let l=new Zc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let f of c){if(typeof f!="string")continue;let p=a+f;t.data?.ignoreMultiPack||(p=Dn(p,t.src),h.push(e.load({src:p,data:{textureOptions:n,ignoreMultiPack:!0}})))}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[l].concat(l.linkedSheets.filter(p=>p!==f))})}return l},async unload(r,t,e){await e.unload(r.textureSource._sourceOrigin),r.destroy(!1)}}}});var Qc=x(()=>{"use strict";C();Lm();O.add(Om)});function au(r,t,e){let{width:s,height:i}=e.orig,n=e.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-t._x*s,r.maxX=r.minX+o,r.minY=n.y-t._y*i,r.maxY=r.minY+a}else r.minX=-t._x*s,r.maxX=r.minX+s,r.minY=-t._y*i,r.maxY=r.minY+i}var Jc=x(()=>{"use strict"});var we,js=x(()=>{"use strict";Us();ht();Jc();xt();br();we=class r extends Jt{constructor(t=D.EMPTY){t instanceof D&&(t={texture:t});let{texture:e=D.EMPTY,anchor:s,roundPixels:i,width:n,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=i??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof D?new r(t):new r(D.from(t,e))}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return au(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return I("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let t=this._anchor,e=this._texture,s=this._bounds,{width:i,height:n}=e.orig;s.minX=-t._x*i,s.maxX=s.minX+i,s.minY=-t._y*n,s.maxY=s.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}});function Ci(r,t,e){let s=jw;r.measurable=!0,rs(r,e,s),t.addBoundsMask(s),r.measurable=!1}var jw,uu=x(()=>{"use strict";he();pi();jw=new _t});function Ai(r,t,e){let s=$e.get();r.measurable=!0;let i=Zt.get().identity(),n=VT(r,e,i);gi(r,s,n),r.measurable=!1,t.addBoundsMask(s),Zt.return(i),$e.return(s)}function VT(r,t,e){return r?(r!==t&&(VT(r.parent,t,e),r.updateLocalTransform(),e.append(r.localTransform)),e):(k("Mask bounds, renderable is not inside the root container"),e)}var lu=x(()=>{"use strict";qa();ks();pt()});var Fn,Nm=x(()=>{"use strict";C();js();uu();lu();Fn=class{constructor(t){this.priority=0,this.inverse=!1,this.channel="red",this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof we),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||Ci(this.mask,t,e)}addLocalBounds(t,e){Ai(this.mask,t,e)}containsPoint(t,e){let s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof we}};Fn.extension=m.MaskEffect});var Gn,Hm=x(()=>{"use strict";C();Gn=class{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}};Gn.extension=m.MaskEffect});var Un,Wm=x(()=>{"use strict";C();_e();uu();lu();Un=class{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){Ci(this.mask,t,e)}addLocalBounds(t,e){Ai(this.mask,t,e)}containsPoint(t,e){let s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof lt}};Un.extension=m.MaskEffect});var ne,qs=x(()=>{"use strict";mt();C();Wt();ne=class extends st{constructor(t){t.resource||(t.resource=N.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){let i=super.resize(t,e,s);return i&&this.resizeCanvas(),i}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};ne.extension=m.TextureSource});var ke,wi=x(()=>{"use strict";C();Wt();ke=class extends st{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}};ke.extension=m.TextureSource});async function cu(){return Vm??(Vm=(async()=>{let t=N.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";let e=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";let s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);let i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);let n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Vm}var Vm,th=x(()=>{"use strict";mt()});var eh,Ks,rh=x(()=>{"use strict";C();is();th();Wt();eh=class zT extends st{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...zT.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let t=Gt.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.isValid||t.addEventListener("loadedmetadata",this._onLoadedMetadata),this.alphaMode=await cu(),this._load=new Promise((s,i)=>{this.isValid?s(this):(this._resolve=s,this._reject=i,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){let t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlayThrough),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){let t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("loadedmetadata",this._onLoadedMetadata),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Gt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Gt.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Gt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};eh.extension=m.TextureSource;eh.defaultOptions={...st.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};eh.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};Ks=eh});var zm,at,Tr=x(()=>{"use strict";pt();Mn();zm=class{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){let e=this._cache.get(t);return e||k(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){let s=Ce(t),i;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(e)){i=l.getCacheableAssets(s,e);break}}let n=new Map(Object.entries(i||{}));i||s.forEach(u=>{n.set(u,e)});let o=[...n.keys()],a={cacheKeys:o,keys:s};s.forEach(u=>{this._cacheMap.set(u,a)}),o.forEach(u=>{let l=i?i[u]:e;this._cache.has(u)&&this._cache.get(u)!==l&&k("[Cache] already has key:",u),this._cache.set(u,n.get(u))})}remove(t){if(!this._cacheMap.has(t)){k(`[Assets] Asset id ${t} was not found in the Cache`);return}let e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}},at=new zm});function qw(r={}){return $m(r)}function $m(r={}){let t=r&&r.resource,e=t?r.resource:r,s=t?r:{resource:r};for(let i=0;i<Xm.length;i++){let n=Xm[i];if(n.test(e))return new n(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function XT(r={},t=!1){let e=r&&r.resource,s=e?r.resource:r,i=e?r:{resource:r};if(!t&&at.has(s))return at.get(s);let n=new D({source:$m(i)});return n.on("destroy",()=>{at.has(s)&&at.remove(s)}),t||at.set(s,n),n}function $T(r,t=!1){return typeof r=="string"?at.get(r):r instanceof st?new D({source:r}):XT(r,t)}var Xm,Ym=x(()=>{"use strict";Tr();C();Wt();ht();Xm=[];O.handleByList(m.TextureSource,Xm);D.from=$T;st.from=$m});var sh=x(()=>{"use strict";C();Nm();Hm();Wm();kc();qs();wi();rh();Ym();O.add(Fn,Gn,Un,Ks,ke,ne,Ws)});function YT(r){let t=N.get().createCanvas(6,1),e=t.getContext("2d");return e.fillStyle=r,e.fillRect(0,0,6,1),t}function hu(){if(In!==void 0)return In;try{let r=YT("#ff00ff"),t=YT("#ffff00"),s=N.get().createCanvas(6,1).getContext("2d");s.globalCompositeOperation="multiply",s.drawImage(r,0,0),s.drawImage(t,2,0);let i=s.getImageData(2,0,1,1);if(!i)In=!1;else{let n=i.data;In=n[0]===255&&n[1]===0&&n[2]===0}}catch{In=!1}return In}var In,ih=x(()=>{"use strict";mt()});var Z,Lr=x(()=>{"use strict";It();mt();Hs();ih();Z={canvas:null,convertTintToImage:!1,cacheStepsPerColorChannel:8,canUseMultiply:hu(),tintMethod:null,_canvasSourceCache:new WeakMap,_unpremultipliedCache:new WeakMap,getCanvasSource:r=>{let t=r.source,e=t?.resource;if(!e)return null;let s=t.alphaMode==="premultiplied-alpha",i=t.resourceWidth??t.pixelWidth,n=t.resourceHeight??t.pixelHeight,o=i!==t.pixelWidth||n!==t.pixelHeight;if(s){if((e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)&&!o)return e;let a=Z._unpremultipliedCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas}if(e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof ArrayBuffer){let a=Z._canvasSourceCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas;let u=N.get().createCanvas(t.pixelWidth,t.pixelHeight),l=u.getContext("2d"),c=l.createImageData(t.pixelWidth,t.pixelHeight),h=c.data,d=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(t.format==="bgra8unorm")for(let f=0;f<h.length&&f+3<d.length;f+=4)h[f]=d[f+2],h[f+1]=d[f+1],h[f+2]=d[f],h[f+3]=d[f+3];else h.set(d.subarray(0,h.length));return l.putImageData(c,0,0),Z._canvasSourceCache.set(t,{canvas:u,resourceId:t._resourceId}),u}if(s){let a=N.get().createCanvas(t.pixelWidth,t.pixelHeight),u=a.getContext("2d",{willReadFrequently:!0});a.width=t.pixelWidth,a.height=t.pixelHeight,u.drawImage(e,0,0);let l=u.getImageData(0,0,a.width,a.height),c=l.data;for(let h=0;h<c.length;h+=4){let d=c[h+3];if(d>0){let f=255/d;c[h]=Math.min(255,c[h]*f+.5),c[h+1]=Math.min(255,c[h+1]*f+.5),c[h+2]=Math.min(255,c[h+2]*f+.5)}}return u.putImageData(l,0,0),Z._unpremultipliedCache.set(t,{canvas:a,resourceId:t._resourceId}),a}if(o){let a=Z._canvasSourceCache.get(t);if(a?.resourceId===t._resourceId)return a.canvas;let u=N.get().createCanvas(t.pixelWidth,t.pixelHeight),l=u.getContext("2d");return u.width=t.pixelWidth,u.height=t.pixelHeight,l.drawImage(e,0,0),Z._canvasSourceCache.set(t,{canvas:u,resourceId:t._resourceId}),u}return e},getTintedCanvas:(r,t)=>{let e=r.texture,s=X.shared.setValue(t).toHex(),i=e.tintCache||(e.tintCache={}),n=i[s],o=e.source._resourceId;if(n?.tintId===o)return n;let a=n&&"getContext"in n?n:N.get().createCanvas();if(Z.tintMethod(e,t,a),a.tintId=o,Z.convertTintToImage&&a.toDataURL!==void 0){let u=N.get().createImage();u.src=a.toDataURL(),u.tintId=o,i[s]=u}else i[s]=a;return i[s]},getTintedPattern:(r,t)=>{let e=X.shared.setValue(t).toHex(),s=r.patternCache||(r.patternCache={}),i=r.source._resourceId,n=s[e];return n?.tintId===i||(Z.canvas||(Z.canvas=N.get().createCanvas()),Z.tintMethod(r,t,Z.canvas),n=Z.canvas.getContext("2d").createPattern(Z.canvas,"repeat"),n.tintId=i,s[e]=n),n},applyPatternTransform:(r,t,e=!0)=>{if(!t)return;let s=r;if(!s.setTransform)return;let i=globalThis.DOMMatrix;if(!i)return;let n=new i([t.a,t.b,t.c,t.d,t.tx,t.ty]);s.setTransform(e?n.inverse():n)},tintWithMultiply:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.fillStyle=X.shared.setValue(t).toHex(),s.fillRect(0,0,u,l),s.globalCompositeOperation="multiply";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.globalCompositeOperation="destination-atop",s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore()},tintWithOverlay:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.globalCompositeOperation="copy",s.fillStyle=X.shared.setValue(t).toHex(),s.fillRect(0,0,u,l),s.globalCompositeOperation="destination-atop";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore()},tintWithPerPixel:(r,t,e)=>{let s=e.getContext("2d"),i=r.frame.clone(),n=r.source._resolution??r.source.resolution??1,o=r.rotate;i.x*=n,i.y*=n,i.width*=n,i.height*=n;let a=q.isVertical(o),u=a?i.height:i.width,l=a?i.width:i.height;e.width=Math.ceil(u),e.height=Math.ceil(l),s.save(),s.globalCompositeOperation="copy";let c=Z.getCanvasSource(r);if(!c){s.restore();return}o&&Z._applyInverseRotation(s,o,i.width,i.height),s.drawImage(c,i.x,i.y,i.width,i.height,0,0,i.width,i.height),s.restore();let h=t>>16&255,d=t>>8&255,f=t&255,p=s.getImageData(0,0,u,l),g=p.data;for(let _=0;_<g.length;_+=4)g[_]=g[_]*h/255,g[_+1]=g[_+1]*d/255,g[_+2]=g[_+2]*f/255;s.putImageData(p,0,0)},_applyInverseRotation:(r,t,e,s)=>{let i=q.inv(t),n=q.uX(i),o=q.uY(i),a=q.vX(i),u=q.vY(i),l=-Math.min(0,n*e,a*s,n*e+a*s),c=-Math.min(0,o*e,u*s,o*e+u*s);r.transform(n,o,a,u,l,c)}};Z.tintMethod=Z.canUseMultiply?Z.tintWithMultiply:Z.tintWithPerPixel});var nh,be,Zs=x(()=>{"use strict";mt();An();Is();nh=class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){let s=N.get().createCanvas();s.width=t,s.height=e;let i=s.getContext("2d");return{canvas:s,context:i}}getOptimalCanvasAndContext(t,e,s=1){t=Math.ceil(t*s-1e-6),e=Math.ceil(e*s-1e-6),t=Ir(t),e=Ir(e);let i=(t<<17)+(e<<1);this._canvasPool[i]||(this._canvasPool[i]=[]);let n=this._canvasPool[i].pop();return n||(n=this._createCanvasAndContext(t,e)),n}returnCanvasAndContext(t){let e=t.canvas,{width:s,height:i}=e,n=(s<<17)+(i<<1);t.context.resetTransform(),t.context.clearRect(0,0,s,i),this._canvasPool[n].push(t)}clear(){this._canvasPool={}}},be=new nh;rr.register(be)});function Pi(r,t,e,s,i,n){let o=r-e,a=t-s,u=i-e,l=n-s,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let f,p;d<0?(f=e,p=s):d>1?(f=i,p=n):(f=e+d*u,p=s+d*l);let g=r-f,_=t-p;return g*g+_*_}var oh=x(()=>{"use strict"});function ah(r,t,e,s,i,n,o,a){let u=o-e,l=a-s,c=i-e,h=n-s,d=r-e,f=t-s,p=u*u+l*l,g=u*c+l*h,_=u*d+l*f,b=c*c+h*h,y=c*d+h*f,v=1/(p*b-g*g),T=(b*_-g*y)*v,S=(p*y-g*_)*v;return T>=0&&S>=0&&T+S<1}var jm=x(()=>{"use strict"});var du,qm=x(()=>{"use strict";jt();du=class r{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new r(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;let s=this.radius*this.radius,i=this.x-t,n=this.y-e;return i*=i,n*=n,i+n<=s}strokeContains(t,e,s,i=.5){if(this.radius===0)return!1;let n=this.x-t,o=this.y-e,a=this.radius,u=(1-i)*s,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(s-u)}getBounds(t){return t||(t=new J),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}});var fu,Km=x(()=>{"use strict";jt();fu=class r{constructor(t=0,e=0,s=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=i}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return s*=s,i*=i,s+i<=1}strokeContains(t,e,s,i=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return!1;let a=s*(1-i),u=s-a,l=n-u,c=o-u,h=n+a,d=o+a,f=t-this.x,p=e-this.y,g=f*f/(l*l)+p*p/(c*c),_=f*f/(h*h)+p*p/(d*d);return g>1&&_<=1}getBounds(t){return t||(t=new J),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}});var Kw,Zw,Bi,Zm=x(()=>{"use strict";xt();oh();jt();Bi=class r{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){let s=[];for(let i=0,n=e.length;i<n;i++)s.push(e[i].x,e[i].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0,e=this.points,s=e.length;for(let i=0;i<s;i+=2){let n=e[i],o=e[i+1],a=e[(i+2)%s],u=e[(i+3)%s];t+=(a-n)*(u+o)}return t<0}containsPolygon(t){let e=this.getBounds(Kw),s=t.getBounds(Zw);if(!e.containsRect(s))return!1;let i=t.points;for(let n=0;n<i.length;n+=2){let o=i[n],a=i[n+1];if(!this.contains(o,a))return!1}return!0}clone(){let t=this.points.slice(),e=new r(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1,i=this.points.length/2;for(let n=0,o=i-1;n<i;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>e!=c>e&&t<(l-a)*((e-u)/(c-u))+a&&(s=!s)}return s}strokeContains(t,e,s,i=.5){let n=s*s,o=n*(1-i),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],f=u[(c+2)%u.length],p=u[(c+3)%u.length],g=Pi(t,e,h,d,f,p),_=Math.sign((f-h)*(e-d)-(p-d)*(t-h));if(g<=(_<0?a:o))return!0}return!1}getBounds(t){t||(t=new J);let e=this.points,s=1/0,i=-1/0,n=1/0,o=-1/0;for(let a=0,u=e.length;a<u;a+=2){let l=e[a],c=e[a+1];s=l<s?l:s,i=l>i?l:i,n=c<n?c:n,o=c>o?c:o}return t.x=s,t.width=i-s,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return I("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return I("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}});var uh,pu,Qm=x(()=>{"use strict";jt();uh=(r,t,e,s,i,n,o)=>{let a=r-e,u=t-s,l=Math.sqrt(a*a+u*u);return l>=i-n&&l<=i+o},pu=class r{constructor(t=0,e=0,s=0,i=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=i,this.radius=n}getBounds(t){return t||(t=new J),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){let s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),n=e-(this.y+s),o=s*s;if(i*i+n*n<=o||(i=t-(this.x+this.width-s),i*i+n*n<=o)||(n=e-(this.y+this.height-s),i*i+n*n<=o)||(i=t-(this.x+s),i*i+n*n<=o))return!0}return!1}strokeContains(t,e,s,i=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=s*(1-i),h=s-c,d=n+l,f=o+l,p=a-l*2,g=u-l*2,_=n+a,b=o+u;return(t>=n-c&&t<=n+h||t>=_-h&&t<=_+c)&&e>=f&&e<=f+g||(e>=o-c&&e<=o+h||e>=b-h&&e<=b+c)&&t>=d&&t<=d+p?!0:t<d&&e<f&&uh(t,e,d,f,l,h,c)||t>_-l&&e<f&&uh(t,e,_-l,f,l,h,c)||t>_-l&&e>b-l&&uh(t,e,_-l,b-l,l,h,c)||t<d&&e>b-l&&uh(t,e,d,b-l,l,h,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}});var Jm,jT=x(()=>{"use strict";oh();jt();Jm=class r{constructor(t=0,e=0,s=0,i=0,n=0,o=0){this.type="triangle",this.x=t,this.y=e,this.x2=s,this.y2=i,this.x3=n,this.y3=o}contains(t,e){let s=(this.x-this.x3)*(e-this.y3)-(this.y-this.y3)*(t-this.x3),i=(this.x2-this.x)*(e-this.y)-(this.y2-this.y)*(t-this.x);if(s<0!=i<0&&s!==0&&i!==0)return!1;let n=(this.x3-this.x2)*(e-this.y2)-(this.y3-this.y2)*(t-this.x2);return n===0||n<0==s+i<=0}strokeContains(t,e,s,i=.5){let n=s/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return Pi(t,e,a,c,u,d)<=o||Pi(t,e,u,h,l,d)<=o||Pi(t,e,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x2=t.x2,this.y2=t.y2,this.x3=t.x3,this.y3=t.y3,this}copyTo(t){return t.copyFrom(this),t}getBounds(t){t||(t=new J);let e=Math.min(this.x,this.x2,this.x3),s=Math.max(this.x,this.x2,this.x3),i=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return t.x=e,t.y=i,t.width=s-e,t.height=n-i,t}}});function mu(r,t){t.clear();let e=t.matrix;for(let s=0;s<r.length;s++){let i=r[s];if(i.globalDisplayStatus<7)continue;let n=i.renderGroup??i.parentRenderGroup;n?.isCachedAsTexture?t.matrix=qT.copyFrom(n.textureOffsetInverseTransform).append(i.worldTransform):n?._parentCacheAsTextureRenderGroup?t.matrix=qT.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(i.groupTransform):t.matrix=i.worldTransform,t.addBounds(i.bounds)}return t.matrix=e,t}var qT,lh=x(()=>{"use strict";ot();qT=new F});function Ri(r,t,e,s,i=!1){let n=Qw;n.minX=0,n.minY=0,n.maxX=r.width/s|0,n.maxY=r.height/s|0;let o=yt.getOptimalTexture(n.width,n.height,s,!1,i);return o.source.uploadMethodId="image",o.source.resource=r,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=t/s,o.frame.height=e/s,o.source.emit("update",o.source),o.updateUvs(),o}var Qw,gu=x(()=>{"use strict";_r();he();Qw=new _t});function tg(r){return typeof r.getCanvasFilterString=="function"}var eg,kn,rg=x(()=>{"use strict";C();Lr();Zs();he();lh();gu();eg=class{constructor(){this.skip=!1,this.useClip=!1,this.filters=null,this.container=null,this.bounds=new _t,this.cssFilterString=""}},kn=class{constructor(t){this._filterStack=[],this._filterStackIndex=0,this._savedStates=[],this._alphaMultiplier=1,this._warnedFilterTypes=new Set,this.renderer=t}push(t){let e=this._pushFilterFrame(),s=t.filterEffect.filters;if(e.skip=!1,e.useClip=!1,e.filters=s,e.container=t.container,e.cssFilterString="",s.every(u=>!u.enabled)){e.skip=!0;return}let i=[],n=1;for(let u of s){if(!u.enabled)continue;if(!tg(u)){this._warnUnsupportedFilter(u);continue}let l=u.getCanvasFilterString();if(l===null){this._warnUnsupportedFilter(u);continue}l&&i.push(l)}if(i.length===0&&n===1){e.skip=!0;return}e.cssFilterString=i.join(" "),this._calculateFilterArea(t,e.bounds),e.useClip=!!t.filterEffect.filterArea;let o=this.renderer.canvasContext.activeContext,a=o.filter||"none";if(this._savedStates.push({filter:a,alphaMultiplier:this._alphaMultiplier}),e.useClip&&Number.isFinite(e.bounds.width)&&Number.isFinite(e.bounds.height)&&e.bounds.width>0&&e.bounds.height>0){let u=this.renderer.canvasContext.activeResolution||1;o.save(),o.setTransform(1,0,0,1,0,0),o.beginPath(),o.rect(e.bounds.x*u,e.bounds.y*u,e.bounds.width*u,e.bounds.height*u),o.clip()}else e.useClip=!1;n!==1&&(this._alphaMultiplier*=n),e.cssFilterString&&(o.filter=a!=="none"?`${a} ${e.cssFilterString}`:e.cssFilterString)}pop(){let t=this._popFilterFrame();if(t.skip)return;let e=this._savedStates.pop();if(!e)return;let s=this.renderer.canvasContext.activeContext;t.useClip?s.restore():s.filter=e.filter,this._alphaMultiplier=e.alphaMultiplier}generateFilteredTexture({texture:t,filters:e}){if(!e?.length||e.every(b=>!b.enabled))return t;let s=[],i=1;for(let b of e){if(!b.enabled)continue;if(!tg(b)){this._warnUnsupportedFilter(b);continue}let y=b.getCanvasFilterString();if(y===null){this._warnUnsupportedFilter(b);continue}y&&s.push(y)}if(s.length===0&&i===1)return t;let n=Z.getCanvasSource(t);if(!n)return t;let o=t.frame,a=t.source._resolution??t.source.resolution??1,u=o.width,l=o.height,c=be.getOptimalCanvasAndContext(u,l,a),{canvas:h,context:d}=c;d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,h.width,h.height),s.length&&(d.filter=s.join(" ")),i!==1&&(d.globalAlpha=i);let f=o.x*a,p=o.y*a,g=u*a,_=l*a;return d.drawImage(n,f,p,g,_,0,0,g,_),d.filter="none",d.globalAlpha=1,Ri(h,u,l,a)}_calculateFilterArea(t,e){if(t.renderables?mu(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){let i=(t.container.renderGroup||t.container.parentRenderGroup)?.cacheToLocalTransform;i&&e.applyMatrix(i)}}_warnUnsupportedFilter(t){let e=t?.constructor?.name||"Filter";this._warnedFilterTypes.has(e)||(this._warnedFilterTypes.add(e),console.warn(`CanvasRenderer: filter "${e}" is not supported in Canvas2D and will be skipped.`))}get alphaMultiplier(){return this._alphaMultiplier}_pushFilterFrame(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new eg),this._filterStackIndex++,t}_popFilterFrame(){return this._filterStackIndex<=0?this._filterStack[0]:(this._filterStackIndex--,this._filterStack[this._filterStackIndex])}destroy(){this._filterStack=null,this._savedStates=null,this._warnedFilterTypes=null,this._alphaMultiplier=1}};kn.extension={type:[m.CanvasSystem],name:"filter"}});var On,sg=x(()=>{"use strict";C();On=class{constructor(t){this._renderer=t}push(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:e,filterEffect:t})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(t){t.action==="pushFilter"?this._renderer.filter.push(t):t.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}};On.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"filter"}});function Nr(r,t){let e=KT[r];return e===void 0&&(ig[t]===void 0&&(ig[t]=1),KT[r]=e=ig[t]++),e}var ig,KT,Ln=x(()=>{"use strict";ig=Object.create(null),KT=Object.create(null)});function xu(){return(!ch||ch?.isContextLost())&&(ch=N.get().createCanvas().getContext("webgl",{})),ch}var ch,hh=x(()=>{"use strict";mt()});function ng(){if(!dh){dh="mediump";let r=xu();r&&r.getShaderPrecisionFormat&&(dh=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump")}return dh}var dh,og=x(()=>{"use strict";hh()});function ag(r,t,e){return t?r:e?(r=r.replace("out vec4 finalColor;",""),`
|
|
18
18
|
|
|
19
19
|
#ifdef GL_ES // This checks if it is WebGL1
|
|
20
20
|
#define in varying
|
|
@@ -29,10 +29,10 @@ Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!Sn.noColor
|
|
|
29
29
|
#define out varying
|
|
30
30
|
#endif
|
|
31
31
|
${r}
|
|
32
|
-
`}var
|
|
33
|
-
${r}`}else if(s!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var
|
|
34
|
-
${r}`:r}var
|
|
35
|
-
${r}`}var Qw,Jw,fg=x(()=>{"use strict";Qw={},Jw={}});function pg(r,t){return t?r.replace("#version 300 es",""):r}var mg=x(()=>{"use strict"});var gg,xu,qT,Rt,Oe=x(()=>{"use strict";kn();ng();ag();lg();hg();fg();mg();gg={stripVersion:pg,ensurePrecision:ug,addProgramDefines:og,setProgramName:dg,insertVersion:cg},xu=Object.create(null),qT=class xg{constructor(t){t={...xg.defaultOptions,...t};let e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:ig()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e},i=t.fragment,n=t.vertex;Object.keys(gg).forEach(o=>{let a=s[o];i=gg[o](i,a,!0),n=gg[o](n,a,!1)}),this.fragment=i,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Nr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,xu[this._cacheKey]=null}static from(t){let e=`${t.vertex}:${t.fragment}`;return xu[e]||(xu[e]=new xg(t),xu[e]._cacheKey=e),xu[e]}};qT.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};Rt=qT});function Le(r){return KT[r]??KT.float32}var KT,Zs=x(()=>{"use strict";KT={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}}});function QT(r,t){let e;for(;(e=ZT.exec(r))!==null;){let s=t3[e[3]]??"float32";t[e[2]]={location:parseInt(e[1],10),format:s,stride:Le(s).stride,offset:0,instance:!1,start:0}}ZT.lastIndex=0}function e3(r){return r.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function _g({source:r,entryPoint:t}){let e={},s=e3(r),i=s.indexOf(`fn ${t}(`);if(i===-1)return e;let n=s.indexOf("->",i);if(n===-1)return e;let o=s.substring(i,n);if(QT(o,e),Object.keys(e).length===0){let a=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){let u=a[1],l=new RegExp(`struct\\s+${u}\\s*\\{([^}]+)\\}`,"s"),c=s.match(l);c&&QT(c[1],e)}}return e}var t3,ZT,bg=x(()=>{"use strict";Zs();t3={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},ZT=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g});function _u(r){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,l=r.match(t)?.map(h=>({group:parseInt(h.match(e)[1],10),binding:parseInt(h.match(s)[1],10),name:h.match(i)[2],isUniform:h.match(i)[1]==="<uniform>",type:h.match(n)[1]}));if(!l)return{groups:[],structs:[]};let c=r.match(o)?.map(h=>{let d=h.match(u)[1],f=h.match(a).reduce((p,g)=>{let[_,b]=g.split(":");return p[_.trim()]=b.trim(),p},{});return f?{name:d,members:f}:null}).filter(({name:h})=>l.some(d=>d.type===h||d.type.includes(`<${h}>`)))??[];return{groups:l,structs:c}}var yg=x(()=>{"use strict"});var as,vg=x(()=>{"use strict";as=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(as||{})});function Tg({groups:r}){let t=[];for(let e=0;e<r.length;e++){let s=r[e];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:as.VERTEX|as.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}var Sg=x(()=>{"use strict";vg()});function Eg({groups:r}){let t=[];for(let e=0;e<r.length;e++){let s=r[e];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}var Cg=x(()=>{"use strict"});function Ag(r,t){let e=new Set,s=new Set,i=[...r.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),n=[...r.groups,...t.groups].filter(o=>{let a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:i,groups:n}}var wg=x(()=>{"use strict"});var bu,Mt,Ye=x(()=>{"use strict";kn();bg();yg();Sg();Cg();wg();bu=Object.create(null),Mt=class r{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:e,vertex:s,layout:i,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){let a=_u(e.source);this.structsAndGroups=a}else{let a=_u(s.source),u=_u(e.source);this.structsAndGroups=Ag(a,u)}this.layout=i??Eg(this.structsAndGroups),this.gpuLayout=n??Tg(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Nr(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=_g(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,bu[this._cacheKey]=null}static from(t){let e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return bu[e]||(bu[e]=new r(t),bu[e]._cacheKey=e),bu[e]}}});var oe,us=x(()=>{"use strict";oe=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(let s in t){let i=t[s];this.setResource(i,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;let t=[],e=0;for(let s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){let s=this.resources[e];t!==s&&(s?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){let s=this.resources;for(let i in s)s[i]._gcLastUsed=t,s[i]._touched=e}destroy(){let t=this.resources;for(let e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}});var Tt,Pe=x(()=>{"use strict";Tt=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.CANVAS=4]="CANVAS",r[r.BOTH=3]="BOTH",r))(Tt||{})});var fh,Pg,Bg=x(()=>{"use strict";fh=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Pg=fh.reduce((r,t)=>(r[t]=!0,r),{})});function Rg(r,t){switch(r){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Mg=x(()=>{"use strict"});var JT,dt,te=x(()=>{"use strict";Yt();kn();Bg();Mg();JT=class tS{constructor(t,e){this._touched=0,this.uid=et("uniform"),this._resourceType="uniformGroup",this._resourceId=et("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...tS.defaultOptions,...e},this.uniformStructures=t;let s={};for(let i in t){let n=t[i];if(n.name=i,n.size=n.size??1,!Pg[n.type]){let o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){let[,a,u]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${u} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${fh.join(", ")}`)}n.value??(n.value=Rg(n.type,n.size)),s[i]=n.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Nr(Object.keys(s).map(i=>`${i}-${t[i].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};JT.defaultOptions={ubo:!1,isStatic:!1};dt=JT});var Vt,lr=x(()=>{"use strict";le();Yt();Oe();us();Ye();Pe();te();Vt=class r extends St{constructor(t){super(),this.uid=et("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:s,groups:i,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=Tt.WEBGPU),s&&(o|=Tt.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!i&&(n={}),n&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&i&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h}}else if(e&&i&&!a){let l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c})}else if(n){i={},a={},e&&e.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h});let l=0;for(let c in n)u[c]||(i[99]||(i[99]=new oe,this._ownedBindGroups.push(i[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new dt(d));let f=u[h];f&&(i[f.group]||(i[f.group]=new oe,this._ownedBindGroups.push(i[f.group])),i[f.group].setResource(d,f.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,u)}addResource(t,e,s){var i,n;(i=this._uniformBindMap)[e]||(i[e]={}),(n=this._uniformBindMap[e])[s]||(n[s]=t),this.groups[e]||(this.groups[e]=new oe,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){let s={};for(let i in e){let n=e[i];Object.defineProperty(s,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return s}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){let{gpu:e,gl:s,...i}=t,n,o;return e&&(n=Mt.from(e)),s&&(o=Rt.from(s)),new r({gpuProgram:n,glProgram:o,...i})}}});var r3,Dg,Fg,Gg,Ug,Ig,kg,Og,Ut,je=x(()=>{"use strict";r3={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Dg=0,Fg=1,Gg=2,Ug=3,Ig=4,kg=5,Og=class eS{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Dg)}set blend(t){!!(this.data&1<<Dg)!==t&&(this.data^=1<<Dg)}get offsets(){return!!(this.data&1<<Fg)}set offsets(t){!!(this.data&1<<Fg)!==t&&(this.data^=1<<Fg)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Gg)}set culling(t){!!(this.data&1<<Gg)!==t&&(this.data^=1<<Gg)}get depthTest(){return!!(this.data&1<<Ug)}set depthTest(t){!!(this.data&1<<Ug)!==t&&(this.data^=1<<Ug)}get depthMask(){return!!(this.data&1<<kg)}set depthMask(t){!!(this.data&1<<kg)!==t&&(this.data^=1<<kg)}get clockwiseFrontFace(){return!!(this.data&1<<Ig)}set clockwiseFrontFace(t){!!(this.data&1<<Ig)!==t&&(this.data^=1<<Ig)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=r3[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new eS;return t.depthTest=!1,t.blend=!0,t}};Og.default2d=Og.for2d();Ut=Og});var rS,ae,Sr=x(()=>{"use strict";Oe();Ye();lr();je();rS=class Lg extends Vt{constructor(t){t={...Lg.defaultOptions,...t},super(t),this.enabled=!0,this._state=Ut.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)}apply(t,e,s,i){t.applyFilter(this,e,s,i)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){let{gpu:e,gl:s,...i}=t,n,o;return e&&(n=Mt.from(e)),s&&(o=Rt.from(s)),new Lg({gpuProgram:n,glProgram:o,...i})}};rS.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};ae=rS});var ls,On=x(()=>{"use strict";ls=`in vec2 aPosition;
|
|
32
|
+
`}var ug=x(()=>{"use strict"});function lg(r,t,e){let s=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(r.substring(0,9)!=="precision"){let i=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return i==="highp"&&s!=="highp"&&(i="mediump"),`precision ${i} float;
|
|
33
|
+
${r}`}else if(s!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var cg=x(()=>{"use strict"});function hg(r,t){return t?`#version 300 es
|
|
34
|
+
${r}`:r}var dg=x(()=>{"use strict"});function fg(r,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";let s=e?Jw:t3;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,r.indexOf("#define SHADER_NAME")!==-1?r:`${`#define SHADER_NAME ${t}`}
|
|
35
|
+
${r}`}var Jw,t3,pg=x(()=>{"use strict";Jw={},t3={}});function mg(r,t){return t?r.replace("#version 300 es",""):r}var gg=x(()=>{"use strict"});var xg,_u,ZT,Rt,Oe=x(()=>{"use strict";Ln();og();ug();cg();dg();pg();gg();xg={stripVersion:mg,ensurePrecision:lg,addProgramDefines:ag,setProgramName:fg,insertVersion:hg},_u=Object.create(null),ZT=class _g{constructor(t){t={..._g.defaultOptions,...t};let e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:ng()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e},i=t.fragment,n=t.vertex;Object.keys(xg).forEach(o=>{let a=s[o];i=xg[o](i,a,!0),n=xg[o](n,a,!1)}),this.fragment=i,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Nr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,_u[this._cacheKey]=null}static from(t){let e=`${t.vertex}:${t.fragment}`;return _u[e]||(_u[e]=new _g(t),_u[e]._cacheKey=e),_u[e]}};ZT.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};Rt=ZT});function Le(r){return QT[r]??QT.float32}var QT,Qs=x(()=>{"use strict";QT={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}}});function tS(r,t){let e;for(;(e=JT.exec(r))!==null;){let s=e3[e[3]]??"float32";t[e[2]]={location:parseInt(e[1],10),format:s,stride:Le(s).stride,offset:0,instance:!1,start:0}}JT.lastIndex=0}function r3(r){return r.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function bg({source:r,entryPoint:t}){let e={},s=r3(r),i=s.indexOf(`fn ${t}(`);if(i===-1)return e;let n=s.indexOf("->",i);if(n===-1)return e;let o=s.substring(i,n);if(tS(o,e),Object.keys(e).length===0){let a=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){let u=a[1],l=new RegExp(`struct\\s+${u}\\s*\\{([^}]+)\\}`,"s"),c=s.match(l);c&&tS(c[1],e)}}return e}var e3,JT,yg=x(()=>{"use strict";Qs();e3={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},JT=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g});function bu(r){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,l=r.match(t)?.map(h=>({group:parseInt(h.match(e)[1],10),binding:parseInt(h.match(s)[1],10),name:h.match(i)[2],isUniform:h.match(i)[1]==="<uniform>",type:h.match(n)[1]}));if(!l)return{groups:[],structs:[]};let c=r.match(o)?.map(h=>{let d=h.match(u)[1],f=h.match(a).reduce((p,g)=>{let[_,b]=g.split(":");return p[_.trim()]=b.trim(),p},{});return f?{name:d,members:f}:null}).filter(({name:h})=>l.some(d=>d.type===h||d.type.includes(`<${h}>`)))??[];return{groups:l,structs:c}}var vg=x(()=>{"use strict"});var as,Tg=x(()=>{"use strict";as=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(as||{})});function Sg({groups:r}){let t=[];for(let e=0;e<r.length;e++){let s=r[e];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:as.VERTEX|as.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:as.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}var Eg=x(()=>{"use strict";Tg()});function Cg({groups:r}){let t=[];for(let e=0;e<r.length;e++){let s=r[e];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}var Ag=x(()=>{"use strict"});function wg(r,t){let e=new Set,s=new Set,i=[...r.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),n=[...r.groups,...t.groups].filter(o=>{let a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:i,groups:n}}var Pg=x(()=>{"use strict"});var yu,Mt,Ye=x(()=>{"use strict";Ln();yg();vg();Eg();Ag();Pg();yu=Object.create(null),Mt=class r{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:e,vertex:s,layout:i,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){let a=bu(e.source);this.structsAndGroups=a}else{let a=bu(s.source),u=bu(e.source);this.structsAndGroups=wg(a,u)}this.layout=i??Cg(this.structsAndGroups),this.gpuLayout=n??Sg(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Nr(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=bg(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,yu[this._cacheKey]=null}static from(t){let e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return yu[e]||(yu[e]=new r(t),yu[e]._cacheKey=e),yu[e]}}});var oe,us=x(()=>{"use strict";oe=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(let s in t){let i=t[s];this.setResource(i,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;let t=[],e=0;for(let s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){let s=this.resources[e];t!==s&&(s?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){let s=this.resources;for(let i in s)s[i]._gcLastUsed=t,s[i]._touched=e}destroy(){let t=this.resources;for(let e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}});var Tt,Pe=x(()=>{"use strict";Tt=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.CANVAS=4]="CANVAS",r[r.BOTH=3]="BOTH",r))(Tt||{})});var fh,Bg,Rg=x(()=>{"use strict";fh=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Bg=fh.reduce((r,t)=>(r[t]=!0,r),{})});function Mg(r,t){switch(r){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Dg=x(()=>{"use strict"});var eS,dt,te=x(()=>{"use strict";Yt();Ln();Rg();Dg();eS=class rS{constructor(t,e){this._touched=0,this.uid=et("uniform"),this._resourceType="uniformGroup",this._resourceId=et("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...rS.defaultOptions,...e},this.uniformStructures=t;let s={};for(let i in t){let n=t[i];if(n.name=i,n.size=n.size??1,!Bg[n.type]){let o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){let[,a,u]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${u} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${fh.join(", ")}`)}n.value??(n.value=Mg(n.type,n.size)),s[i]=n.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Nr(Object.keys(s).map(i=>`${i}-${t[i].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};eS.defaultOptions={ubo:!1,isStatic:!1};dt=eS});var Vt,lr=x(()=>{"use strict";le();Yt();Oe();us();Ye();Pe();te();Vt=class r extends St{constructor(t){super(),this.uid=et("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:s,groups:i,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=Tt.WEBGPU),s&&(o|=Tt.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!i&&(n={}),n&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&i&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h}}else if(e&&i&&!a){let l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c})}else if(n){i={},a={},e&&e.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h});let l=0;for(let c in n)u[c]||(i[99]||(i[99]=new oe,this._ownedBindGroups.push(i[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new dt(d));let f=u[h];f&&(i[f.group]||(i[f.group]=new oe,this._ownedBindGroups.push(i[f.group])),i[f.group].setResource(d,f.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,u)}addResource(t,e,s){var i,n;(i=this._uniformBindMap)[e]||(i[e]={}),(n=this._uniformBindMap[e])[s]||(n[s]=t),this.groups[e]||(this.groups[e]=new oe,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){let s={};for(let i in e){let n=e[i];Object.defineProperty(s,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return s}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){let{gpu:e,gl:s,...i}=t,n,o;return e&&(n=Mt.from(e)),s&&(o=Rt.from(s)),new r({gpuProgram:n,glProgram:o,...i})}}});var s3,Fg,Gg,Ug,Ig,kg,Og,Lg,Ut,je=x(()=>{"use strict";s3={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Fg=0,Gg=1,Ug=2,Ig=3,kg=4,Og=5,Lg=class sS{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Fg)}set blend(t){!!(this.data&1<<Fg)!==t&&(this.data^=1<<Fg)}get offsets(){return!!(this.data&1<<Gg)}set offsets(t){!!(this.data&1<<Gg)!==t&&(this.data^=1<<Gg)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ug)}set culling(t){!!(this.data&1<<Ug)!==t&&(this.data^=1<<Ug)}get depthTest(){return!!(this.data&1<<Ig)}set depthTest(t){!!(this.data&1<<Ig)!==t&&(this.data^=1<<Ig)}get depthMask(){return!!(this.data&1<<Og)}set depthMask(t){!!(this.data&1<<Og)!==t&&(this.data^=1<<Og)}get clockwiseFrontFace(){return!!(this.data&1<<kg)}set clockwiseFrontFace(t){!!(this.data&1<<kg)!==t&&(this.data^=1<<kg)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=s3[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new sS;return t.depthTest=!1,t.blend=!0,t}};Lg.default2d=Lg.for2d();Ut=Lg});var iS,ae,Sr=x(()=>{"use strict";Oe();Ye();lr();je();iS=class Ng extends Vt{constructor(t){t={...Ng.defaultOptions,...t},super(t),this.enabled=!0,this._state=Ut.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)}apply(t,e,s,i){t.applyFilter(this,e,s,i)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){let{gpu:e,gl:s,...i}=t,n,o;return e&&(n=Mt.from(e)),s&&(o=Rt.from(s)),new Ng({gpuProgram:n,glProgram:o,...i})}};iS.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};ae=iS});var ls,Nn=x(()=>{"use strict";ls=`in vec2 aPosition;
|
|
36
36
|
out vec2 vTextureCoord;
|
|
37
37
|
|
|
38
38
|
uniform vec4 uInputSize;
|
|
@@ -59,13 +59,13 @@ void main(void)
|
|
|
59
59
|
gl_Position = filterVertexPosition();
|
|
60
60
|
vTextureCoord = filterTextureCoord();
|
|
61
61
|
}
|
|
62
|
-
`});var
|
|
62
|
+
`});var Hg,Wg=x(()=>{"use strict";Hg=`in vec2 vTextureCoord;
|
|
63
63
|
out vec4 finalColor;
|
|
64
64
|
uniform sampler2D uTexture;
|
|
65
65
|
void main() {
|
|
66
66
|
finalColor = texture(uTexture, vTextureCoord);
|
|
67
67
|
}
|
|
68
|
-
`});var ph,
|
|
68
|
+
`});var ph,Vg=x(()=>{"use strict";ph=`struct GlobalFilterUniforms {
|
|
69
69
|
uInputSize: vec4<f32>,
|
|
70
70
|
uInputPixel: vec4<f32>,
|
|
71
71
|
uInputClamp: vec4<f32>,
|
|
@@ -114,24 +114,24 @@ fn mainFragment(
|
|
|
114
114
|
) -> @location(0) vec4<f32> {
|
|
115
115
|
return textureSample(uTexture, uSampler, uv);
|
|
116
116
|
}
|
|
117
|
-
`});var yu,Vg=x(()=>{"use strict";Oe();Ye();Sr();On();Hg();Wg();yu=class extends ae{constructor(){let t=Mt.from({vertex:{source:ph,entryPoint:"mainVertex"},fragment:{source:ph,entryPoint:"mainFragment"},name:"passthrough-filter"}),e=Rt.from({vertex:ls,fragment:Ng,name:"passthrough-filter"});super({gpuProgram:t,glProgram:e})}}});var ct,Hr=x(()=>{"use strict";ct=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(ct||{})});var zt,cs=x(()=>{"use strict";le();Yt();Hr();zt=class extends St{constructor(t){let{data:e,size:s}=t,{usage:i,label:n,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=et("buffer"),this._resourceType="buffer",this._resourceId=et("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);let a=!!e;this.descriptor={size:s,usage:i,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&ct.STATIC)}set static(t){t?this.descriptor.usage|=ct.STATIC:this.descriptor.usage&=~ct.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}let i=this._data;if(this._data=t,this._dataInt32=null,!i||i.length!==t.length){!this.shrinkToFit&&i&&t.byteLength<i.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=et("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}});function mh(r,t){if(!(r instanceof zt)){let e=t?ct.INDEX:ct.VERTEX;r instanceof Array&&(t?(r=new Uint32Array(r),e=ct.INDEX|ct.COPY_DST):(r=new Float32Array(r),e=ct.VERTEX|ct.COPY_DST)),r=new zt({data:r,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return r}var zg=x(()=>{"use strict";cs();Hr()});function Xg(r,t,e){let s=r.getAttribute(t);if(!s)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;let i=s.buffer.data,n=1/0,o=1/0,a=-1/0,u=-1/0,l=i.BYTES_PER_ELEMENT,c=(s.offset||0)/l,h=(s.stride||8)/l;for(let d=c;d<i.length;d+=h){let f=i[d],p=i[d+1];f>a&&(a=f),p>u&&(u=p),f<n&&(n=f),p<o&&(o=p)}return e.minX=n,e.minY=o,e.maxX=a,e.maxY=u,e}var $g=x(()=>{"use strict"});function s3(r){return(r instanceof zt||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=mh(r.buffer,!1),r}var Ne,Qs=x(()=>{"use strict";le();he();Yt();cs();zg();$g();Ne=class extends St{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=et("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new _t,this._boundsDirty=!0;let{attributes:e,indexBuffer:s,topology:i}=t;if(this.buffers=[],this.attributes={},e)for(let n in e)this.addAttribute(n,e[n]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=i||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(let t in this.attributes){let e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){let s=s3(e);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=mh(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,Xg(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}});var i3,Yg,Ln,jg=x(()=>{"use strict";C();Vg();ot();us();Qs();te();ht();_r();Pe();he();lh();pt();i3=new Ne({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),Yg=class{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new _t,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}},Ln=class{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new dt({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new oe({}),this.renderer=t}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){let e=this.renderer,s=t.filterEffect.filters,i=this._pushFilterData();i.skip=!1,i.filters=s,i.container=t.container,i.outputRenderSurface=e.renderTarget.renderSurface;let n=e.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(s.every(f=>!f.enabled)){i.skip=!0;return}let u=i.bounds;if(this._calculateFilterArea(t,u),this._calculateFilterBounds(i,e.renderTarget.rootViewPort,a,o,1),i.skip)return;let l=this._getPreviousFilterData(),c=this._findFilterResolution(o),h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY),this._calculateGlobalFrame(i,h,d,c,n.width,n.height),this._setupFilterTextures(i,u,e,l)}generateFilteredTexture({texture:t,filters:e}){let s=this._pushFilterData();this._activeFilterData=s,s.skip=!1,s.filters=e;let i=t.source,n=i.resolution,o=i.antialias;if(e.every(f=>!f.enabled))return s.skip=!0,t;let a=s.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(s,a.rectangle,o,n,0),s.skip)return t;let u=n;this._calculateGlobalFrame(s,0,0,u,i.width,i.height),s.outputRenderSurface=yt.getOptimalTexture(a.width,a.height,s.resolution,s.antialias),s.backTexture=D.EMPTY,s.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(s,!0);let d=s.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){let t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,!1),e.blendRequired&&yt.returnTexture(e.backTexture),yt.returnTexture(e.inputTexture))}getBackTexture(t,e,s){let i=t.colorTexture.source._resolution,n=yt.getOptimalTexture(e.width,e.height,i,!1),o=e.minX,a=e.minY;s&&(o-=s.minX,a-=s.minY),o=Math.floor(o*i),a=Math.floor(a*i);let u=Math.ceil(e.width*i),l=Math.ceil(e.height*i);return this.renderer.renderTarget.copyToTexture(t,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(t,e,s,i){let n=this.renderer,o=this._activeFilterData,u=o.outputRenderSurface===s,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(l),h=0,d=0;if(u){let p=this._findPreviousFilterOffset();h=p.x,d=p.y}this._updateFilterUniforms(e,s,o,h,d,c,u,i);let f=t.enabled?t:this._getPassthroughFilter();this._setupBindGroupsAndRender(f,e,n)}calculateSpriteMatrix(t,e){let s=this._activeFilterData,i=t.set(s.inputTexture._source.width,0,0,s.inputTexture._source.height,s.bounds.minX,s.bounds.minY),n=e.worldTransform.copyTo(F.shared),o=e.renderGroup||e.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),i.prepend(n),i.scale(1/e.texture.orig.width,1/e.texture.orig.height),i.translate(e.anchor.x,e.anchor.y),i}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new yu),this._passthroughFilter}_setupBindGroupsAndRender(t,e,s){if(s.renderPipes.uniformBatch){let i=s.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(i,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,s.encoder.draw({geometry:i3,shader:t,state:t._state,topology:"triangle-list"}),s.type===Tt.WEBGL&&s.renderTarget.finishRenderPass()}_setupFilterTextures(t,e,s,i){if(t.backTexture=D.EMPTY,t.inputTexture=yt.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),t.blendRequired){s.renderTarget.finishRenderPass();let n=s.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(n,e,i?.bounds)}s.renderTarget.bind(t.inputTexture,!0),s.globalUniforms.push({offset:e})}_calculateGlobalFrame(t,e,s,i,n,o){let a=t.globalFrame;a.x=e*i,a.y=s*i,a.width=n*i,a.height=o*i}_updateFilterUniforms(t,e,s,i,n,o,a,u){let l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,f=l.uInputClamp,p=l.uGlobalFrame,g=l.uOutputTexture;a?(c[0]=s.bounds.minX-i,c[1]=s.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,h[0]=t.source.width,h[1]=t.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=t.source.pixelWidth,d[1]=t.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],f[0]=.5*d[2],f[1]=.5*d[3],f[2]=t.frame.width*h[2]-.5*d[2],f[3]=t.frame.height*h[3]-.5*d[3];let _=this.renderer.renderTarget.rootRenderTarget.colorTexture;p[0]=i*o,p[1]=n*o,p[2]=_.source.width*o,p[3]=_.source.height*o,e instanceof D&&(e.source.resource=null);let b=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!u),e instanceof D?(g[0]=e.frame.width,g[1]=e.frame.height):(g[0]=b.width,g[1]=b.height),g[2]=b.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,s=this._filterStackIndex;for(;s>0;){s--;let i=this._filterStack[s];if(!i.skip){t=i.bounds.minX,e=i.bounds.minY;break}}return{x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?pu(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){let i=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;i&&e.applyMatrix(i)}}_applyFiltersToTexture(t,e){let s=t.inputTexture,i=t.bounds,n=t.filters,o=t.firstEnabledIndex,a=t.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(s.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),o===a)n[o].apply(this,s,t.outputRenderSurface,e);else{let u=t.inputTexture,l=yt.getOptimalTexture(i.width,i.height,u.source._resolution,!1),c=l;for(let h=o;h<a;h++){let d=n[h];if(!d.enabled)continue;d.apply(this,u,c,!0);let f=u;u=c,c=f}n[a].apply(this,u,t.outputRenderSurface,e),yt.returnTexture(l)}}_calculateFilterBounds(t,e,s,i,n){let o=this.renderer,a=t.bounds,u=t.filters,l=1/0,c=0,h=!0,d=!1,f=!1,p=!0,g=-1,_=-1;for(let b=0;b<u.length;b++){let y=u[b];if(!y.enabled)continue;if(g===-1&&(g=b),_=b,l=Math.min(l,y.resolution==="inherit"?i:y.resolution),c+=y.padding,y.antialias==="off"?h=!1:y.antialias==="inherit"&&h&&(h=s),y.clipToViewport||(p=!1),!!!(y.compatibleRenderers&o.type)){f=!1;break}if(y.blendRequired&&!(o.backBuffer?.useBackBuffer??!0)){k("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),f=!1;break}f=!0,d||(d=y.blendRequired)}if(!f){t.skip=!0;return}if(p&&a.fitBounds(0,e.width/i,0,e.height/i),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){t.skip=!0;return}t.antialias=h,t.resolution=l,t.blendRequired=d,t.firstEnabledIndex=g,t.lastEnabledIndex=_}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>0&&(e--,t=this._filterStack[e],!!t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new Yg),this._filterStackIndex++,t}};Ln.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"filter"}});var qg=x(()=>{"use strict";C();eg();rg();jg();O.add(Ln,Un);O.add(In)});var n3={};var sS=x(()=>{"use strict";DT();GT();UT();Qc();sh();qg()});var o3={};var nS=x(()=>{"use strict";Qc();sh();qg()});async function kh(r){if(!r)for(let t=0;t<Jg.length;t++){let e=Jg[t];if(e.value.test()){await e.value.load();return}}}async function a3(r){return kh(!r)}var Jg,tx=x(()=>{"use strict";C();Jg=[];O.handleByNamedList(m.Environment,Jg)});function Tu(){if(typeof vu=="boolean")return vu;try{vu=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{vu=!1}return vu}var vu,Oh=x(()=>{"use strict"});function Vh(r,t,e=2){let s=t&&t.length,i=s?t[0]*e:r.length;Au.size&&Au.clear();let n=hS(r,0,i,e,!0),o=[];if(!n||n.next===n.prev)return o;let a=0,u=0,l=0;if(s&&(n=d3(r,t,n,e)),r.length>80*e){a=r[0],u=r[1];let c=a,h=u;for(let d=e;d<i;d+=e){let f=r[d],p=r[d+1];f<a&&(a=f),p<u&&(u=p),f>c&&(c=f),p>h&&(h=p)}l=Math.max(c-a,h-u),l=l!==0?32767/l:0}return rx(n,o,a,u,l),o}function hS(r,t,e,s,i){let n=null;if(i===C3(r,t,e,s)>0)for(let o=t;o<e;o+=s)n=cS(o/s|0,r[o],r[o+1],n);else for(let o=e-s;o>=t;o-=s)n=cS(o/s|0,r[o],r[o+1],n);return n&&wu(n,n.next)&&(Bu(n),n=n.next),n}function Di(r,t=r){let e=t===r,s=r,i;do i=!1,s!==s.next&&(Au.size===0||!Au.has(s))&&(wu(s,s.next)||re(s.prev,s,s.next)===0)?((e||s===t)&&(t=s.prev),ex=!0,Bu(s),s=s.prev,i=!0):(e||s!==t)&&(s=s.next,i=!e);while(i||s!==t);return t}function rx(r,t,e,s,i){i&&b3(r,e,s,i);let n=r,o=!1;for(;r.prev!==r.next;){let a=r.prev,u=r.next;if(re(a,r,u)<0&&(i?l3(r,e,s,i):u3(r))){t.push(a.i,r.i,u.i),Bu(r),r=u,n=u;continue}if(r=u,r===n){if(ex=!1,r=Di(r),ex){n=r;continue}if(!o){r=c3(r,t),n=r,o=!0;continue}h3(r,t,e,s,i);break}}}function u3(r){let t=r.prev,e=r,s=r.next,i=t.x,n=e.x,o=s.x,a=t.y,u=e.y,l=s.y,c=Math.min(i,n,o),h=Math.min(a,u,l),d=Math.max(i,n,o),f=Math.max(a,u,l),p=s.next;for(;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&!(i===p.x&&a===p.y)&&Wh(i,a,n,u,o,l,p.x,p.y)&&re(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function l3(r,t,e,s){let i=r.prev,n=r,o=r.next,a=i.x,u=n.x,l=o.x,c=i.y,h=n.y,d=o.y,f=Math.min(a,u,l),p=Math.min(c,h,d),g=Math.max(a,u,l),_=Math.max(c,h,d),b=ox(f,p,t,e,s),y=ox(g,_,t,e,s),v=r.prevZ;for(;v&&v.z>=b;){if(v.x>=f&&v.x<=g&&v.y>=p&&v.y<=_&&v!==o&&!(a===v.x&&c===v.y)&&Wh(a,c,u,h,l,d,v.x,v.y)&&re(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let T=r.nextZ;for(;T&&T.z<=y;){if(T.x>=f&&T.x<=g&&T.y>=p&&T.y<=_&&T!==o&&!(a===T.x&&c===T.y)&&Wh(a,c,u,h,l,d,T.x,T.y)&&re(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function c3(r,t){let e=r,s=!1;do{let i=e.prev,n=e.next.next;pS(i,e,e.next,n,!1)&&Pu(i,n)&&Pu(n,i)&&(t.push(i.i,e.i,n.i),Bu(e),Bu(e.next),e=r=n,s=!0),e=e.next}while(e!==r);return s?Di(e):e}function h3(r,t,e,s,i){let n=r;do{let o=n.next.next;for(;o!==n.prev;){if(n.i!==o.i&&T3(n,o)){let a=mS(n,o);n=Di(n,n.next),a=Di(a,a.next),rx(n,t,e,s,i),rx(a,t,e,s,i);return}o=o.next}n=n.next}while(n!==r)}function d3(r,t,e,s){let i=[];for(let n=0,o=t.length;n<o;n++){let a=t[n]*s,u=n<o-1?t[n+1]*s:r.length,l=hS(r,a,u,s,!1);l===l.next&&Au.add(l),i.push(v3(l))}i.sort(f3),m3(r.length/s,t.length),fS(e,e),sx=!0;for(let n=0;n<i.length;n++)e=p3(i[n],e);return sx=!1,Di(e)}function f3(r,t){return r.x-t.x||r.y-t.y||(r.next.y-r.y)/(r.next.x-r.x)-(t.next.y-t.y)/(t.next.x-t.x)}function p3(r,t){let e=x3(r,t);if(!e)return t;let s=mS(e,r),i=s.next;return fS(e,i.next),Di(s,s.next),Di(e,e.next)}function m3(r,t){let e=Math.ceil((r+2*t)/dS)+t+2;qt.length<e*4&&(qt=new Float64Array(e*4)),Hh=0}function fS(r,t){let e=r;do{let s=Hh++;ix[s]=e;let i=1/0,n=1/0,o=-1/0,a=-1/0,u=0;do{let c=e.next;e.z=s,e.x<i&&(i=e.x),e.x>o&&(o=e.x),e.y<n&&(n=e.y),e.y>a&&(a=e.y),c.x<i&&(i=c.x),c.x>o&&(o=c.x),c.y<n&&(n=c.y),c.y>a&&(a=c.y),e=c}while(++u<dS&&e!==t);nx[s]=e;let l=s*4;qt[l]=i,qt[l+1]=n,qt[l+2]=o,qt[l+3]=a}while(e!==t)}function g3(r,t){let e=r.z*4;t.x<qt[e]&&(qt[e]=t.x),t.y<qt[e+1]&&(qt[e+1]=t.y),t.x>qt[e+2]&&(qt[e+2]=t.x),t.y>qt[e+3]&&(qt[e+3]=t.y)}function uS(r){let t=nx[r];for(;t.prev.next!==t;)t=t.next;return nx[r]=t,t}function lS(r){let t=ix[r];for(;t.prev.next!==t;)t=t.next;return ix[r]=t,t}function x3(r,t){let e=t,s=r.x,i=r.y,n=-1/0,o;if(wu(r,e))return e;for(let d=0,f=0;d<Hh;d++,f+=4){if(i<qt[f+1]||i>qt[f+3]||qt[f]>s||qt[f+2]<=n)continue;let p=uS(d);e=lS(d);do{if(e.prev.next===e){if(wu(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){let g=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(g<=s&&g>n&&(n=g,o=e.x<e.next.x?e:e.next,g===s))return o}}e=e.next}while(e!==p)}if(!o)return null;let a=o.x,u=o.y,l=Math.min(i,u),c=Math.max(i,u),h=1/0;for(let d=0,f=0;d<Hh;d++,f+=4){if(qt[f+2]<a||qt[f]>s||qt[f+3]<l||qt[f+1]>c)continue;let p=uS(d);e=lS(d);do{if(e.prev.next===e&&s>=e.x&&e.x>=a&&s!==e.x&&Wh(i<u?s:n,i,a,u,i<u?n:s,i,e.x,e.y)){let g=Math.abs(i-e.y)/(s-e.x);(Pu(e,r)||e.y===i&&e.next.y===i&&e.next.x>s)&&(g<h||g===h&&(e.x>o.x||e.x===o.x&&_3(o,e)))&&(o=e,h=g)}e=e.next}while(e!==p)}return o}function _3(r,t){return re(r.prev,r,t.prev)<0&&re(t.next,r,r.next)<0}function b3(r,t,e,s){let i=r,n=0;do i.z=ox(i.x,i.y,t,e,s),cr[n++]=i,i=i.next;while(i!==r);y3(n);let o=null;for(let a=0;a<n;a++){let u=cr[a];u.prevZ=o,o&&(o.nextZ=u),o=u}o.nextZ=null}function y3(r){if(r<=32){for(let t=1;t<r;t++){let e=cr[t],s=e.z,i=t-1;for(;i>=0&&cr[i].z>s;)cr[i+1]=cr[i],i--;cr[i+1]=e}return}Mi.length<r&&(Mi=new Uint32Array(r),Eu=new Uint32Array(r),Su=new Array(r));for(let t=0;t<r;t++)Mi[t]=cr[t].z;Lh(r,cr,Mi,Su,Eu,0),Lh(r,Su,Eu,cr,Mi,8),Lh(r,cr,Mi,Su,Eu,16),Lh(r,Su,Eu,cr,Mi,24)}function Lh(r,t,e,s,i,n){Cu.fill(0);for(let a=0;a<r;a++)Cu[e[a]>>>n&255]++;let o=0;for(let a=0;a<256;a++){let u=Cu[a];Cu[a]=o,o+=u}for(let a=0;a<r;a++){let u=e[a],l=Cu[u>>>n&255]++;s[l]=t[a],i[l]=u}}function ox(r,t,e,s,i){return r=(r-e)*i|0,t=(t-s)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function v3(r){let t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Wh(r,t,e,s,i,n,o,a){return(i-o)*(t-a)>=(r-o)*(n-a)&&(r-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(i-o)*(s-a)}function T3(r,t){let e=wu(r,t)&&re(r.prev,r,r.next)>0&&re(t.prev,t,t.next)>0;return r.next.i!==t.i&&(e||Pu(r,t)&&Pu(t,r)&&(re(r.prev,r,t.prev)!==0||re(r,t.prev,t)!==0))&&!S3(r,t)&&(e||E3(r,t))}function re(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function wu(r,t){return r.x===t.x&&r.y===t.y}function pS(r,t,e,s,i=!0){let n=re(r,t,e),o=re(r,t,s),a=re(e,s,r),u=re(e,s,t);return(n>0&&o<0||n<0&&o>0)&&(a>0&&u<0||a<0&&u>0)?!0:i?!!(n===0&&Nh(r,e,t)||o===0&&Nh(r,s,t)||a===0&&Nh(e,r,s)||u===0&&Nh(e,t,s)):!1}function Nh(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function S3(r,t){let e=Math.min(r.x,t.x),s=Math.max(r.x,t.x),i=Math.min(r.y,t.y),n=Math.max(r.y,t.y),o=r;do{let a=o.next;if(o.x>s&&a.x>s||o.x<e&&a.x<e||o.y>n&&a.y>n||o.y<i&&a.y<i){o=a;continue}if(o.i!==r.i&&a.i!==r.i&&o.i!==t.i&&a.i!==t.i&&pS(o,a,r,t))return!0;o=a}while(o!==r);return!1}function Pu(r,t){return re(r.prev,r,r.next)<0?re(r,t,r.next)>=0&&re(r,r.prev,t)>=0:re(r,t,r.prev)<0||re(r,r.next,t)<0}function E3(r,t){let e=r,s=!1,i=(r.x+t.x)/2,n=(r.y+t.y)/2;do{let o=e.next;e.y>n!=o.y>n&&i<(o.x-e.x)*(n-e.y)/(o.y-e.y)+e.x&&(s=!s),e=o}while(e!==r);return s}function mS(r,t){let e=ax(r.i,r.x,r.y),s=ax(t.i,t.x,t.y),i=r.next,n=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}function cS(r,t,e,s){let i=ax(r,t,e);return s?(i.next=s.next,i.prev=s,s.next.prev=i,s.next=i):(i.prev=i,i.next=i),i}function Bu(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ),sx&&g3(r.prev,r.next)}function ax(r,t,e){return{i:r,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function C3(r,t,e,s){let i=0;for(let n=t,o=e-s;n<e;n+=s)i+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return i}var Au,ex,sx,dS,qt,Hh,ix,nx,cr,Su,Mi,Eu,Cu,gS=x(()=>{"use strict";Au=new Set,ex=!1;sx=!1;dS=16,qt=new Float64Array(0),Hh=0,ix=[],nx=[];cr=[],Su=[],Mi=new Uint32Array(0),Eu=new Uint32Array(0),Cu=new Uint32Array(256)});var ux,lx=x(()=>{"use strict";gS();le();ux=Vh.default||Vh});var ue,Fi=x(()=>{"use strict";ue=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(ue||{})});var Gi,zh=x(()=>{"use strict";Gi=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,i,n,o,a,u){let{name:l,items:c}=this;for(let h=0,d=c.length;h<d;h++)c[h][l](t,e,s,i,n,o,a,u);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){let e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return 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}}});var A3,xS,Er,Ui=x(()=>{"use strict";It();tx();_e();Oh();Yt();xt();Us();Fi();zh();le();A3=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],xS=class _S extends St{constructor(t){super(),this.tick=0,this.uid=et("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;let e=[...A3,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){let e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await kh(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={..._S.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,e){this.tick++;let s=t;if(s instanceof lt&&(s={container:s},e&&(I(V,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){let i=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=i?s.clearColor:X.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){let i=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==i&&this.runners.resolutionChange.emit(s)}clear(t={}){let e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=ue.ALL);let{clear:s,clearColor:i,target:n,mipLevel:o,layer:a}=t;X.shared.setValue(i??this.background.colorRgba),e.renderTarget.clear(n,s,X.shared.toArray(),o??0,a??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new Gi(e)})}_addSystems(t){let e;for(e in t){let s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){let s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(let i in this.runners)this.runners[i].add(s);return this}_addPipes(t,e){let s=e.reduce((i,n)=>(i[n.name]=n.value,i),{});t.forEach(i=>{let n=i.value,o=i.name,a=s[o];this.renderPipes[o]=new n(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&rr.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Tu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};xS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};Er=xS});function Ii(r,t,e){let s=2166136261;for(let i=0;i<t;i++)s^=r[i].uid,s=Math.imul(s,16777619),s>>>=0;return bS[s]||w3(r,t,s,e)}function w3(r,t,e,s){let i={},n=0;for(let a=0;a<s;a++){let u=a<t?r[a]:D.EMPTY.source;i[n++]=u.source,i[n++]=u.style}let o=new oe(i);return bS[e]=o,o}var bS,Ru=x(()=>{"use strict";us();ht();bS={}});function Yh(r,t,e){if(r)for(let s in r){let i=s.toLocaleLowerCase(),n=t[i];if(n){let o=r[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else k(`${s} placement hook does not exist in shader`)}}var cx=x(()=>{"use strict";pt()});function jh(r){let t={};return(r.match(P3)?.map(s=>s.replace(/[{()}]/g,""))??[]).forEach(s=>{t[s]=[]}),t}var P3,hx=x(()=>{"use strict";P3=/\{\{(.*?)\}\}/g});function yS(r,t){let e,s=/@in\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function qh(r,t,e=!1){let s=[];yS(t,s),r.forEach(a=>{a.header&&yS(a.header,s)});let i=s;e&&i.sort();let n=i.map((a,u)=>` @location(${u}) ${a},`).join(`
|
|
117
|
+
`});var vu,zg=x(()=>{"use strict";Oe();Ye();Sr();Nn();Wg();Vg();vu=class extends ae{constructor(){let t=Mt.from({vertex:{source:ph,entryPoint:"mainVertex"},fragment:{source:ph,entryPoint:"mainFragment"},name:"passthrough-filter"}),e=Rt.from({vertex:ls,fragment:Hg,name:"passthrough-filter"});super({gpuProgram:t,glProgram:e})}}});var ct,Hr=x(()=>{"use strict";ct=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(ct||{})});var zt,cs=x(()=>{"use strict";le();Yt();Hr();zt=class extends St{constructor(t){let{data:e,size:s}=t,{usage:i,label:n,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=et("buffer"),this._resourceType="buffer",this._resourceId=et("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);let a=!!e;this.descriptor={size:s,usage:i,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&ct.STATIC)}set static(t){t?this.descriptor.usage|=ct.STATIC:this.descriptor.usage&=~ct.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}let i=this._data;if(this._data=t,this._dataInt32=null,!i||i.length!==t.length){!this.shrinkToFit&&i&&t.byteLength<i.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=et("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}});function mh(r,t){if(!(r instanceof zt)){let e=t?ct.INDEX:ct.VERTEX;r instanceof Array&&(t?(r=new Uint32Array(r),e=ct.INDEX|ct.COPY_DST):(r=new Float32Array(r),e=ct.VERTEX|ct.COPY_DST)),r=new zt({data:r,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return r}var Xg=x(()=>{"use strict";cs();Hr()});function $g(r,t,e){let s=r.getAttribute(t);if(!s)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;let i=s.buffer.data,n=1/0,o=1/0,a=-1/0,u=-1/0,l=i.BYTES_PER_ELEMENT,c=(s.offset||0)/l,h=(s.stride||8)/l;for(let d=c;d<i.length;d+=h){let f=i[d],p=i[d+1];f>a&&(a=f),p>u&&(u=p),f<n&&(n=f),p<o&&(o=p)}return e.minX=n,e.minY=o,e.maxX=a,e.maxY=u,e}var Yg=x(()=>{"use strict"});function i3(r){return(r instanceof zt||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=mh(r.buffer,!1),r}var Ne,Js=x(()=>{"use strict";le();he();Yt();cs();Xg();Yg();Ne=class extends St{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=et("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new _t,this._boundsDirty=!0;let{attributes:e,indexBuffer:s,topology:i}=t;if(this.buffers=[],this.attributes={},e)for(let n in e)this.addAttribute(n,e[n]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=i||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(let t in this.attributes){let e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){let s=i3(e);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=mh(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,$g(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}});var n3,jg,Hn,qg=x(()=>{"use strict";C();zg();ot();us();Js();te();ht();_r();Pe();he();lh();pt();n3=new Ne({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),jg=class{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new _t,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}},Hn=class{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new dt({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new oe({}),this.renderer=t}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){let e=this.renderer,s=t.filterEffect.filters,i=this._pushFilterData();i.skip=!1,i.filters=s,i.container=t.container,i.outputRenderSurface=e.renderTarget.renderSurface;let n=e.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(s.every(f=>!f.enabled)){i.skip=!0;return}let u=i.bounds;if(this._calculateFilterArea(t,u),this._calculateFilterBounds(i,e.renderTarget.rootViewPort,a,o,1),i.skip)return;let l=this._getPreviousFilterData(),c=this._findFilterResolution(o),h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY),this._calculateGlobalFrame(i,h,d,c,n.width,n.height),this._setupFilterTextures(i,u,e,l)}generateFilteredTexture({texture:t,filters:e}){let s=this._pushFilterData();this._activeFilterData=s,s.skip=!1,s.filters=e;let i=t.source,n=i.resolution,o=i.antialias;if(e.every(f=>!f.enabled))return s.skip=!0,t;let a=s.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(s,a.rectangle,o,n,0),s.skip)return t;let u=n;this._calculateGlobalFrame(s,0,0,u,i.width,i.height),s.outputRenderSurface=yt.getOptimalTexture(a.width,a.height,s.resolution,s.antialias),s.backTexture=D.EMPTY,s.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(s,!0);let d=s.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){let t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,!1),e.blendRequired&&yt.returnTexture(e.backTexture),yt.returnTexture(e.inputTexture))}getBackTexture(t,e,s){let i=t.colorTexture.source._resolution,n=yt.getOptimalTexture(e.width,e.height,i,!1),o=e.minX,a=e.minY;s&&(o-=s.minX,a-=s.minY),o=Math.floor(o*i),a=Math.floor(a*i);let u=Math.ceil(e.width*i),l=Math.ceil(e.height*i);return this.renderer.renderTarget.copyToTexture(t,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(t,e,s,i){let n=this.renderer,o=this._activeFilterData,u=o.outputRenderSurface===s,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(l),h=0,d=0;if(u){let p=this._findPreviousFilterOffset();h=p.x,d=p.y}this._updateFilterUniforms(e,s,o,h,d,c,u,i);let f=t.enabled?t:this._getPassthroughFilter();this._setupBindGroupsAndRender(f,e,n)}calculateSpriteMatrix(t,e){let s=this._activeFilterData,i=t.set(s.inputTexture._source.width,0,0,s.inputTexture._source.height,s.bounds.minX,s.bounds.minY),n=e.worldTransform.copyTo(F.shared),o=e.renderGroup||e.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),i.prepend(n),i.scale(1/e.texture.orig.width,1/e.texture.orig.height),i.translate(e.anchor.x,e.anchor.y),i}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new vu),this._passthroughFilter}_setupBindGroupsAndRender(t,e,s){if(s.renderPipes.uniformBatch){let i=s.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(i,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,s.encoder.draw({geometry:n3,shader:t,state:t._state,topology:"triangle-list"}),s.type===Tt.WEBGL&&s.renderTarget.finishRenderPass()}_setupFilterTextures(t,e,s,i){if(t.backTexture=D.EMPTY,t.inputTexture=yt.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),t.blendRequired){s.renderTarget.finishRenderPass();let n=s.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(n,e,i?.bounds)}s.renderTarget.bind(t.inputTexture,!0),s.globalUniforms.push({offset:e})}_calculateGlobalFrame(t,e,s,i,n,o){let a=t.globalFrame;a.x=e*i,a.y=s*i,a.width=n*i,a.height=o*i}_updateFilterUniforms(t,e,s,i,n,o,a,u){let l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,f=l.uInputClamp,p=l.uGlobalFrame,g=l.uOutputTexture;a?(c[0]=s.bounds.minX-i,c[1]=s.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,h[0]=t.source.width,h[1]=t.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=t.source.pixelWidth,d[1]=t.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],f[0]=.5*d[2],f[1]=.5*d[3],f[2]=t.frame.width*h[2]-.5*d[2],f[3]=t.frame.height*h[3]-.5*d[3];let _=this.renderer.renderTarget.rootRenderTarget.colorTexture;p[0]=i*o,p[1]=n*o,p[2]=_.source.width*o,p[3]=_.source.height*o,e instanceof D&&(e.source.resource=null);let b=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!u),e instanceof D?(g[0]=e.frame.width,g[1]=e.frame.height):(g[0]=b.width,g[1]=b.height),g[2]=b.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,s=this._filterStackIndex;for(;s>0;){s--;let i=this._filterStack[s];if(!i.skip){t=i.bounds.minX,e=i.bounds.minY;break}}return{x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?mu(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){let i=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;i&&e.applyMatrix(i)}}_applyFiltersToTexture(t,e){let s=t.inputTexture,i=t.bounds,n=t.filters,o=t.firstEnabledIndex,a=t.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(s.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),o===a)n[o].apply(this,s,t.outputRenderSurface,e);else{let u=t.inputTexture,l=yt.getOptimalTexture(i.width,i.height,u.source._resolution,!1),c=l;for(let h=o;h<a;h++){let d=n[h];if(!d.enabled)continue;d.apply(this,u,c,!0);let f=u;u=c,c=f}n[a].apply(this,u,t.outputRenderSurface,e),yt.returnTexture(l)}}_calculateFilterBounds(t,e,s,i,n){let o=this.renderer,a=t.bounds,u=t.filters,l=1/0,c=0,h=!0,d=!1,f=!1,p=!0,g=-1,_=-1;for(let b=0;b<u.length;b++){let y=u[b];if(!y.enabled)continue;if(g===-1&&(g=b),_=b,l=Math.min(l,y.resolution==="inherit"?i:y.resolution),c+=y.padding,y.antialias==="off"?h=!1:y.antialias==="inherit"&&h&&(h=s),y.clipToViewport||(p=!1),!!!(y.compatibleRenderers&o.type)){f=!1;break}if(y.blendRequired&&!(o.backBuffer?.useBackBuffer??!0)){k("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),f=!1;break}f=!0,d||(d=y.blendRequired)}if(!f){t.skip=!0;return}if(p&&a.fitBounds(0,e.width/i,0,e.height/i),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){t.skip=!0;return}t.antialias=h,t.resolution=l,t.blendRequired=d,t.firstEnabledIndex=g,t.lastEnabledIndex=_}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>0&&(e--,t=this._filterStack[e],!!t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new jg),this._filterStackIndex++,t}};Hn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"filter"}});var Kg=x(()=>{"use strict";C();rg();sg();qg();O.add(Hn,kn);O.add(On)});var o3={};var nS=x(()=>{"use strict";GT();IT();kT();Qc();sh();Kg()});var a3={};var aS=x(()=>{"use strict";Qc();sh();Kg()});async function kh(r){if(!r)for(let t=0;t<tx.length;t++){let e=tx[t];if(e.value.test()){await e.value.load();return}}}async function u3(r){return kh(!r)}var tx,ex=x(()=>{"use strict";C();tx=[];O.handleByNamedList(m.Environment,tx)});function Su(){if(typeof Tu=="boolean")return Tu;try{Tu=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Tu=!1}return Tu}var Tu,Oh=x(()=>{"use strict"});function Vh(r,t,e=2){let s=t&&t.length,i=s?t[0]*e:r.length;wu.size&&wu.clear();let n=fS(r,0,i,e,!0),o=[];if(!n||n.next===n.prev)return o;let a=0,u=0,l=0;if(s&&(n=f3(r,t,n,e)),r.length>80*e){a=r[0],u=r[1];let c=a,h=u;for(let d=e;d<i;d+=e){let f=r[d],p=r[d+1];f<a&&(a=f),p<u&&(u=p),f>c&&(c=f),p>h&&(h=p)}l=Math.max(c-a,h-u),l=l!==0?32767/l:0}return sx(n,o,a,u,l),o}function fS(r,t,e,s,i){let n=null;if(i===A3(r,t,e,s)>0)for(let o=t;o<e;o+=s)n=dS(o/s|0,r[o],r[o+1],n);else for(let o=e-s;o>=t;o-=s)n=dS(o/s|0,r[o],r[o+1],n);return n&&Pu(n,n.next)&&(Ru(n),n=n.next),n}function Gi(r,t=r){let e=t===r,s=r,i;do i=!1,s!==s.next&&(wu.size===0||!wu.has(s))&&(Pu(s,s.next)||re(s.prev,s,s.next)===0)?((e||s===t)&&(t=s.prev),rx=!0,Ru(s),s=s.prev,i=!0):(e||s!==t)&&(s=s.next,i=!e);while(i||s!==t);return t}function sx(r,t,e,s,i){i&&y3(r,e,s,i);let n=r,o=!1;for(;r.prev!==r.next;){let a=r.prev,u=r.next;if(re(a,r,u)<0&&(i?c3(r,e,s,i):l3(r))){t.push(a.i,r.i,u.i),Ru(r),r=u,n=u;continue}if(r=u,r===n){if(rx=!1,r=Gi(r),rx){n=r;continue}if(!o){r=h3(r,t),n=r,o=!0;continue}d3(r,t,e,s,i);break}}}function l3(r){let t=r.prev,e=r,s=r.next,i=t.x,n=e.x,o=s.x,a=t.y,u=e.y,l=s.y,c=Math.min(i,n,o),h=Math.min(a,u,l),d=Math.max(i,n,o),f=Math.max(a,u,l),p=s.next;for(;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&!(i===p.x&&a===p.y)&&Wh(i,a,n,u,o,l,p.x,p.y)&&re(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function c3(r,t,e,s){let i=r.prev,n=r,o=r.next,a=i.x,u=n.x,l=o.x,c=i.y,h=n.y,d=o.y,f=Math.min(a,u,l),p=Math.min(c,h,d),g=Math.max(a,u,l),_=Math.max(c,h,d),b=ax(f,p,t,e,s),y=ax(g,_,t,e,s),v=r.prevZ;for(;v&&v.z>=b;){if(v.x>=f&&v.x<=g&&v.y>=p&&v.y<=_&&v!==o&&!(a===v.x&&c===v.y)&&Wh(a,c,u,h,l,d,v.x,v.y)&&re(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let T=r.nextZ;for(;T&&T.z<=y;){if(T.x>=f&&T.x<=g&&T.y>=p&&T.y<=_&&T!==o&&!(a===T.x&&c===T.y)&&Wh(a,c,u,h,l,d,T.x,T.y)&&re(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function h3(r,t){let e=r,s=!1;do{let i=e.prev,n=e.next.next;gS(i,e,e.next,n,!1)&&Bu(i,n)&&Bu(n,i)&&(t.push(i.i,e.i,n.i),Ru(e),Ru(e.next),e=r=n,s=!0),e=e.next}while(e!==r);return s?Gi(e):e}function d3(r,t,e,s,i){let n=r;do{let o=n.next.next;for(;o!==n.prev;){if(n.i!==o.i&&S3(n,o)){let a=xS(n,o);n=Gi(n,n.next),a=Gi(a,a.next),sx(n,t,e,s,i),sx(a,t,e,s,i);return}o=o.next}n=n.next}while(n!==r)}function f3(r,t,e,s){let i=[];for(let n=0,o=t.length;n<o;n++){let a=t[n]*s,u=n<o-1?t[n+1]*s:r.length,l=fS(r,a,u,s,!1);l===l.next&&wu.add(l),i.push(T3(l))}i.sort(p3),g3(r.length/s,t.length),mS(e,e),ix=!0;for(let n=0;n<i.length;n++)e=m3(i[n],e);return ix=!1,Gi(e)}function p3(r,t){return r.x-t.x||r.y-t.y||(r.next.y-r.y)/(r.next.x-r.x)-(t.next.y-t.y)/(t.next.x-t.x)}function m3(r,t){let e=_3(r,t);if(!e)return t;let s=xS(e,r),i=s.next;return mS(e,i.next),Gi(s,s.next),Gi(e,e.next)}function g3(r,t){let e=Math.ceil((r+2*t)/pS)+t+2;qt.length<e*4&&(qt=new Float64Array(e*4)),Hh=0}function mS(r,t){let e=r;do{let s=Hh++;nx[s]=e;let i=1/0,n=1/0,o=-1/0,a=-1/0,u=0;do{let c=e.next;e.z=s,e.x<i&&(i=e.x),e.x>o&&(o=e.x),e.y<n&&(n=e.y),e.y>a&&(a=e.y),c.x<i&&(i=c.x),c.x>o&&(o=c.x),c.y<n&&(n=c.y),c.y>a&&(a=c.y),e=c}while(++u<pS&&e!==t);ox[s]=e;let l=s*4;qt[l]=i,qt[l+1]=n,qt[l+2]=o,qt[l+3]=a}while(e!==t)}function x3(r,t){let e=r.z*4;t.x<qt[e]&&(qt[e]=t.x),t.y<qt[e+1]&&(qt[e+1]=t.y),t.x>qt[e+2]&&(qt[e+2]=t.x),t.y>qt[e+3]&&(qt[e+3]=t.y)}function cS(r){let t=ox[r];for(;t.prev.next!==t;)t=t.next;return ox[r]=t,t}function hS(r){let t=nx[r];for(;t.prev.next!==t;)t=t.next;return nx[r]=t,t}function _3(r,t){let e=t,s=r.x,i=r.y,n=-1/0,o;if(Pu(r,e))return e;for(let d=0,f=0;d<Hh;d++,f+=4){if(i<qt[f+1]||i>qt[f+3]||qt[f]>s||qt[f+2]<=n)continue;let p=cS(d);e=hS(d);do{if(e.prev.next===e){if(Pu(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){let g=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(g<=s&&g>n&&(n=g,o=e.x<e.next.x?e:e.next,g===s))return o}}e=e.next}while(e!==p)}if(!o)return null;let a=o.x,u=o.y,l=Math.min(i,u),c=Math.max(i,u),h=1/0;for(let d=0,f=0;d<Hh;d++,f+=4){if(qt[f+2]<a||qt[f]>s||qt[f+3]<l||qt[f+1]>c)continue;let p=cS(d);e=hS(d);do{if(e.prev.next===e&&s>=e.x&&e.x>=a&&s!==e.x&&Wh(i<u?s:n,i,a,u,i<u?n:s,i,e.x,e.y)){let g=Math.abs(i-e.y)/(s-e.x);(Bu(e,r)||e.y===i&&e.next.y===i&&e.next.x>s)&&(g<h||g===h&&(e.x>o.x||e.x===o.x&&b3(o,e)))&&(o=e,h=g)}e=e.next}while(e!==p)}return o}function b3(r,t){return re(r.prev,r,t.prev)<0&&re(t.next,r,r.next)<0}function y3(r,t,e,s){let i=r,n=0;do i.z=ax(i.x,i.y,t,e,s),cr[n++]=i,i=i.next;while(i!==r);v3(n);let o=null;for(let a=0;a<n;a++){let u=cr[a];u.prevZ=o,o&&(o.nextZ=u),o=u}o.nextZ=null}function v3(r){if(r<=32){for(let t=1;t<r;t++){let e=cr[t],s=e.z,i=t-1;for(;i>=0&&cr[i].z>s;)cr[i+1]=cr[i],i--;cr[i+1]=e}return}Fi.length<r&&(Fi=new Uint32Array(r),Cu=new Uint32Array(r),Eu=new Array(r));for(let t=0;t<r;t++)Fi[t]=cr[t].z;Lh(r,cr,Fi,Eu,Cu,0),Lh(r,Eu,Cu,cr,Fi,8),Lh(r,cr,Fi,Eu,Cu,16),Lh(r,Eu,Cu,cr,Fi,24)}function Lh(r,t,e,s,i,n){Au.fill(0);for(let a=0;a<r;a++)Au[e[a]>>>n&255]++;let o=0;for(let a=0;a<256;a++){let u=Au[a];Au[a]=o,o+=u}for(let a=0;a<r;a++){let u=e[a],l=Au[u>>>n&255]++;s[l]=t[a],i[l]=u}}function ax(r,t,e,s,i){return r=(r-e)*i|0,t=(t-s)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function T3(r){let t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Wh(r,t,e,s,i,n,o,a){return(i-o)*(t-a)>=(r-o)*(n-a)&&(r-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(i-o)*(s-a)}function S3(r,t){let e=Pu(r,t)&&re(r.prev,r,r.next)>0&&re(t.prev,t,t.next)>0;return r.next.i!==t.i&&(e||Bu(r,t)&&Bu(t,r)&&(re(r.prev,r,t.prev)!==0||re(r,t.prev,t)!==0))&&!E3(r,t)&&(e||C3(r,t))}function re(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Pu(r,t){return r.x===t.x&&r.y===t.y}function gS(r,t,e,s,i=!0){let n=re(r,t,e),o=re(r,t,s),a=re(e,s,r),u=re(e,s,t);return(n>0&&o<0||n<0&&o>0)&&(a>0&&u<0||a<0&&u>0)?!0:i?!!(n===0&&Nh(r,e,t)||o===0&&Nh(r,s,t)||a===0&&Nh(e,r,s)||u===0&&Nh(e,t,s)):!1}function Nh(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function E3(r,t){let e=Math.min(r.x,t.x),s=Math.max(r.x,t.x),i=Math.min(r.y,t.y),n=Math.max(r.y,t.y),o=r;do{let a=o.next;if(o.x>s&&a.x>s||o.x<e&&a.x<e||o.y>n&&a.y>n||o.y<i&&a.y<i){o=a;continue}if(o.i!==r.i&&a.i!==r.i&&o.i!==t.i&&a.i!==t.i&&gS(o,a,r,t))return!0;o=a}while(o!==r);return!1}function Bu(r,t){return re(r.prev,r,r.next)<0?re(r,t,r.next)>=0&&re(r,r.prev,t)>=0:re(r,t,r.prev)<0||re(r,r.next,t)<0}function C3(r,t){let e=r,s=!1,i=(r.x+t.x)/2,n=(r.y+t.y)/2;do{let o=e.next;e.y>n!=o.y>n&&i<(o.x-e.x)*(n-e.y)/(o.y-e.y)+e.x&&(s=!s),e=o}while(e!==r);return s}function xS(r,t){let e=ux(r.i,r.x,r.y),s=ux(t.i,t.x,t.y),i=r.next,n=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}function dS(r,t,e,s){let i=ux(r,t,e);return s?(i.next=s.next,i.prev=s,s.next.prev=i,s.next=i):(i.prev=i,i.next=i),i}function Ru(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ),ix&&x3(r.prev,r.next)}function ux(r,t,e){return{i:r,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function A3(r,t,e,s){let i=0;for(let n=t,o=e-s;n<e;n+=s)i+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return i}var wu,rx,ix,pS,qt,Hh,nx,ox,cr,Eu,Fi,Cu,Au,_S=x(()=>{"use strict";wu=new Set,rx=!1;ix=!1;pS=16,qt=new Float64Array(0),Hh=0,nx=[],ox=[];cr=[],Eu=[],Fi=new Uint32Array(0),Cu=new Uint32Array(0),Au=new Uint32Array(256)});var lx,cx=x(()=>{"use strict";_S();le();lx=Vh.default||Vh});var ue,Ui=x(()=>{"use strict";ue=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(ue||{})});var Ii,zh=x(()=>{"use strict";Ii=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,i,n,o,a,u){let{name:l,items:c}=this;for(let h=0,d=c.length;h<d;h++)c[h][l](t,e,s,i,n,o,a,u);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){let e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return 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}}});var w3,bS,Er,ki=x(()=>{"use strict";It();ex();_e();Oh();Yt();xt();Is();Ui();zh();le();w3=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],bS=class yS extends St{constructor(t){super(),this.tick=0,this.uid=et("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;let e=[...w3,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){let e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await kh(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={...yS.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,e){this.tick++;let s=t;if(s instanceof lt&&(s={container:s},e&&(I(V,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){let i=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=i?s.clearColor:X.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){let i=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==i&&this.runners.resolutionChange.emit(s)}clear(t={}){let e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=ue.ALL);let{clear:s,clearColor:i,target:n,mipLevel:o,layer:a}=t;X.shared.setValue(i??this.background.colorRgba),e.renderTarget.clear(n,s,X.shared.toArray(),o??0,a??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new Ii(e)})}_addSystems(t){let e;for(e in t){let s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){let s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(let i in this.runners)this.runners[i].add(s);return this}_addPipes(t,e){let s=e.reduce((i,n)=>(i[n.name]=n.value,i),{});t.forEach(i=>{let n=i.value,o=i.name,a=s[o];this.renderPipes[o]=new n(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&rr.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Su())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};bS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};Er=bS});function Oi(r,t,e){let s=2166136261;for(let i=0;i<t;i++)s^=r[i].uid,s=Math.imul(s,16777619),s>>>=0;return vS[s]||P3(r,t,s,e)}function P3(r,t,e,s){let i={},n=0;for(let a=0;a<s;a++){let u=a<t?r[a]:D.EMPTY.source;i[n++]=u.source,i[n++]=u.style}let o=new oe(i);return vS[e]=o,o}var vS,Mu=x(()=>{"use strict";us();ht();vS={}});function Yh(r,t,e){if(r)for(let s in r){let i=s.toLocaleLowerCase(),n=t[i];if(n){let o=r[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else k(`${s} placement hook does not exist in shader`)}}var hx=x(()=>{"use strict";pt()});function jh(r){let t={};return(r.match(B3)?.map(s=>s.replace(/[{()}]/g,""))??[]).forEach(s=>{t[s]=[]}),t}var B3,dx=x(()=>{"use strict";B3=/\{\{(.*?)\}\}/g});function TS(r,t){let e,s=/@in\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function qh(r,t,e=!1){let s=[];TS(t,s),r.forEach(a=>{a.header&&TS(a.header,s)});let i=s;e&&i.sort();let n=i.map((a,u)=>` @location(${u}) ${a},`).join(`
|
|
118
118
|
`),o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
|
|
119
119
|
${n}
|
|
120
|
-
`),o}var
|
|
121
|
-
`),n=e.sort().map(u=>` var ${
|
|
120
|
+
`),o}var fx=x(()=>{"use strict"});function SS(r,t){let e,s=/@out\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function R3(r){let e=/\b(\w+)\s*:/g.exec(r);return e?e[1]:""}function M3(r){let t=/@.*?\s+/g;return r.replace(t,"")}function px(r,t){let e=[];SS(t,e),r.forEach(u=>{u.header&&SS(u.header,e)});let s=0,i=e.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${s++}) ${u}`).join(`,
|
|
121
|
+
`),n=e.sort().map(u=>` var ${M3(u)};`).join(`
|
|
122
122
|
`),o=`return VSOutput(
|
|
123
|
-
${e.sort().map(u=>` ${
|
|
123
|
+
${e.sort().map(u=>` ${R3(u)}`).join(`,
|
|
124
124
|
`)});`,a=t.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`
|
|
125
125
|
${i}
|
|
126
126
|
`),a=a.replace("{{start}}",`
|
|
127
127
|
${n}
|
|
128
128
|
`),a=a.replace("{{return}}",`
|
|
129
129
|
${o}
|
|
130
|
-
`),a}var
|
|
130
|
+
`),a}var mx=x(()=>{"use strict"});function Kh(r,t){let e=r;for(let s in t){let i=t[s];i.join(`
|
|
131
131
|
`).length?e=e.replace(`{{${s}}}`,`//-----${s} START-----//
|
|
132
132
|
${i.join(`
|
|
133
133
|
`)}
|
|
134
|
-
//----${s} FINISH----//`):e=e.replace(`{{${s}}}`,"")}return e}var
|
|
134
|
+
//----${s} FINISH----//`):e=e.replace(`{{${s}}}`,"")}return e}var gx=x(()=>{"use strict"});function _x({template:r,bits:t}){let e=ES(r,t);if(ti[e])return ti[e];let{vertex:s,fragment:i}=F3(r,t);return ti[e]=CS(s,i,t),ti[e]}function bx({template:r,bits:t}){let e=ES(r,t);return ti[e]||(ti[e]=CS(r.vertex,r.fragment,t)),ti[e]}function F3(r,t){let e=t.map(o=>o.vertex).filter(o=>!!o),s=t.map(o=>o.fragment).filter(o=>!!o),i=qh(e,r.vertex,!0);i=px(e,i);let n=qh(s,r.fragment,!0);return{vertex:i,fragment:n}}function ES(r,t){return t.map(e=>(xx.has(e)||xx.set(e,D3++),xx.get(e))).sort((e,s)=>e-s).join("-")+r.vertex+r.fragment}function CS(r,t,e){let s=jh(r),i=jh(t);return e.forEach(n=>{Yh(n.vertex,s,n.name),Yh(n.fragment,i,n.name)}),{vertex:Kh(r,s),fragment:Kh(t,i)}}var ti,xx,D3,yx=x(()=>{"use strict";hx();dx();fx();mx();gx();ti=Object.create(null),xx=new Map,D3=0});var vx,Tx,Sx,Ex,Cx=x(()=>{"use strict";vx=`
|
|
135
135
|
@in aPosition: vec2<f32>;
|
|
136
136
|
@in aUV: vec2<f32>;
|
|
137
137
|
|
|
@@ -175,7 +175,7 @@ ${i.join(`
|
|
|
175
175
|
|
|
176
176
|
{{return}}
|
|
177
177
|
};
|
|
178
|
-
`,
|
|
178
|
+
`,Tx=`
|
|
179
179
|
@in vUV : vec2<f32>;
|
|
180
180
|
@in vColor : vec4<f32>;
|
|
181
181
|
|
|
@@ -198,7 +198,7 @@ ${i.join(`
|
|
|
198
198
|
|
|
199
199
|
return finalColor;
|
|
200
200
|
};
|
|
201
|
-
`,
|
|
201
|
+
`,Sx=`
|
|
202
202
|
in vec2 aPosition;
|
|
203
203
|
in vec2 aUV;
|
|
204
204
|
|
|
@@ -234,7 +234,7 @@ ${i.join(`
|
|
|
234
234
|
|
|
235
235
|
{{end}}
|
|
236
236
|
}
|
|
237
|
-
`,
|
|
237
|
+
`,Ex=`
|
|
238
238
|
|
|
239
239
|
in vec4 vColor;
|
|
240
240
|
in vec2 vUV;
|
|
@@ -255,7 +255,7 @@ ${i.join(`
|
|
|
255
255
|
|
|
256
256
|
{{end}}
|
|
257
257
|
}
|
|
258
|
-
`});var
|
|
258
|
+
`});var Ax,G3,wx,Px=x(()=>{"use strict";Ax={name:"global-uniforms-bit",vertex:{header:`
|
|
259
259
|
struct GlobalUniforms {
|
|
260
260
|
uProjectionMatrix:mat3x3<f32>,
|
|
261
261
|
uWorldTransformMatrix:mat3x3<f32>,
|
|
@@ -264,29 +264,29 @@ ${i.join(`
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
267
|
-
`}},
|
|
267
|
+
`}},G3={name:"global-uniforms-ubo-bit",vertex:{header:`
|
|
268
268
|
uniform globalUniforms {
|
|
269
269
|
mat3 uProjectionMatrix;
|
|
270
270
|
mat3 uWorldTransformMatrix;
|
|
271
271
|
vec4 uWorldColorAlpha;
|
|
272
272
|
vec2 uResolution;
|
|
273
273
|
};
|
|
274
|
-
`}},
|
|
274
|
+
`}},wx={name:"global-uniforms-bit",vertex:{header:`
|
|
275
275
|
uniform mat3 uProjectionMatrix;
|
|
276
276
|
uniform mat3 uWorldTransformMatrix;
|
|
277
277
|
uniform vec4 uWorldColorAlpha;
|
|
278
278
|
uniform vec2 uResolution;
|
|
279
|
-
`}}});function Cr({bits:r,name:t}){let e=
|
|
279
|
+
`}}});function Cr({bits:r,name:t}){let e=_x({template:{fragment:Tx,vertex:vx},bits:[Ax,...r]});return Mt.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})}function Ar({bits:r,name:t}){return new Rt({name:t,...bx({template:{vertex:Sx,fragment:Ex},bits:[wx,...r]})})}var fs=x(()=>{"use strict";Oe();Ye();yx();Cx();Px()});var Li,Ni,Wn=x(()=>{"use strict";Li={name:"color-bit",vertex:{header:`
|
|
280
280
|
@in aColor: vec4<f32>;
|
|
281
281
|
`,main:`
|
|
282
282
|
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
283
|
-
`}},
|
|
283
|
+
`}},Ni={name:"color-bit",vertex:{header:`
|
|
284
284
|
in vec4 aColor;
|
|
285
285
|
`,main:`
|
|
286
286
|
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
287
|
-
`}}});function
|
|
288
|
-
`)}function
|
|
289
|
-
`)}function
|
|
287
|
+
`}}});function U3(r){let t=[];if(r===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let s=0;s<r;s++)t.push(`@group(1) @binding(${e++}) var textureSource${s+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${e++}) var textureSampler${s+1}: sampler;`)}return t.join(`
|
|
288
|
+
`)}function I3(r){let t=[];if(r===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e<r;e++)e===r-1?t.push(" default:{"):t.push(` case ${e}:{`),t.push(` outColor = textureSampleGrad(textureSource${e+1}, textureSampler${e+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
|
|
289
|
+
`)}function Hi(r){return Bx[r]||(Bx[r]={name:"texture-batch-bit",vertex:{header:`
|
|
290
290
|
@in aTextureIdAndRound: vec2<u32>;
|
|
291
291
|
@out @interpolate(flat) vTextureId : u32;
|
|
292
292
|
`,main:`
|
|
@@ -299,14 +299,14 @@ ${i.join(`
|
|
|
299
299
|
`},fragment:{header:`
|
|
300
300
|
@in @interpolate(flat) vTextureId: u32;
|
|
301
301
|
|
|
302
|
-
${
|
|
302
|
+
${U3(r)}
|
|
303
303
|
`,main:`
|
|
304
304
|
var uvDx = dpdx(vUV);
|
|
305
305
|
var uvDy = dpdy(vUV);
|
|
306
306
|
|
|
307
|
-
${
|
|
308
|
-
`}}),
|
|
309
|
-
`)}function
|
|
307
|
+
${I3(r)}
|
|
308
|
+
`}}),Bx[r]}function k3(r){let t=[];for(let e=0;e<r;e++)e>0&&t.push("else"),e<r-1&&t.push(`if(vTextureId < ${e}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${e}], vUV);`),t.push("}");return t.join(`
|
|
309
|
+
`)}function Wi(r){return Rx[r]||(Rx[r]={name:"texture-batch-bit",vertex:{header:`
|
|
310
310
|
in vec2 aTextureIdAndRound;
|
|
311
311
|
out float vTextureId;
|
|
312
312
|
|
|
@@ -324,8 +324,8 @@ ${i.join(`
|
|
|
324
324
|
|
|
325
325
|
`,main:`
|
|
326
326
|
|
|
327
|
-
${
|
|
328
|
-
`}}),
|
|
327
|
+
${k3(r)}
|
|
328
|
+
`}}),Rx[r]}var Bx,Rx,Vn=x(()=>{"use strict";Bx={};Rx={}});var ei,Mx,Vi,zi=x(()=>{"use strict";ei={name:"local-uniform-bit",vertex:{header:`
|
|
329
329
|
|
|
330
330
|
struct LocalUniforms {
|
|
331
331
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -342,7 +342,7 @@ ${i.join(`
|
|
|
342
342
|
{
|
|
343
343
|
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
344
344
|
}
|
|
345
|
-
`}},
|
|
345
|
+
`}},Mx={...ei,vertex:{...ei.vertex,header:ei.vertex.header.replace("group(1)","group(2)")}},Vi={name:"local-uniform-bit",vertex:{header:`
|
|
346
346
|
|
|
347
347
|
uniform mat3 uTransformMatrix;
|
|
348
348
|
uniform vec4 uColor;
|
|
@@ -365,7 +365,7 @@ ${i.join(`
|
|
|
365
365
|
{
|
|
366
366
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
367
367
|
}
|
|
368
|
-
`}}});var
|
|
368
|
+
`}}});var zn,Dx=x(()=>{"use strict";C();ot();Mu();fs();Wn();Vn();zi();ps();lr();te();zn=class{constructor(){this._maxTextures=0}contextChange(t){let e=new dt({uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=t.limits.maxBatchableTextures;let s=Cr({name:"graphics",bits:[Li,Hi(this._maxTextures),Mx,wr]});this.shader=new Vt({gpuProgram:s,resources:{localUniforms:e}})}execute(t,e){let s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(s),l=n.encoder;l.setGeometry(a.geometry,i.gpuProgram);let c=n.globalUniforms.bindGroup;l.setBindGroup(0,c,i.gpuProgram);let h=n.renderPipes.uniformBatch.getUniformBindGroup(i.resources.localUniforms,!0);l.setBindGroup(2,h,i.gpuProgram);let d=u.instructions,f=null;for(let p=0;p<u.instructionSize;p++){let g=d[p];if(g.topology!==f&&(f=g.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,i.gpuProgram,t.state,g.topology)),i.groups[1]=g.bindGroup,!g.gpuBindGroup){let _=g.textures;g.bindGroup=Oi(_.textures,_.count,this._maxTextures),g.gpuBindGroup=n.bindGroup.getBindGroup(g.bindGroup,i.gpuProgram,1)}l.setBindGroup(1,g.bindGroup,i.gpuProgram),l.renderPassEncoder.drawIndexed(g.size,1,g.start)}}destroy(){this.shader.destroy(!0),this.shader=null}};zn.extension={type:[m.WebGPUPipesAdaptor],name:"graphics"}});var Fx,Gx,Zh=x(()=>{"use strict";Fx={name:"texture-bit",vertex:{header:`
|
|
369
369
|
|
|
370
370
|
struct TextureUniforms {
|
|
371
371
|
uTextureMatrix:mat3x3<f32>,
|
|
@@ -381,7 +381,7 @@ ${i.join(`
|
|
|
381
381
|
|
|
382
382
|
`,main:`
|
|
383
383
|
outColor = textureSample(uTexture, uSampler, vUV);
|
|
384
|
-
`}},
|
|
384
|
+
`}},Gx={name:"texture-bit",vertex:{header:`
|
|
385
385
|
uniform mat3 uTextureMatrix;
|
|
386
386
|
`,main:`
|
|
387
387
|
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
@@ -391,9 +391,9 @@ ${i.join(`
|
|
|
391
391
|
|
|
392
392
|
`,main:`
|
|
393
393
|
outColor = texture(uTexture, vUV);
|
|
394
|
-
`}}});var Vn,Gx=x(()=>{"use strict";C();ot();fs();Wi();ps();Zh();lr();ht();pt();Vn=class{init(){let t=Cr({name:"mesh",bits:[ti,Dx,wr]});this._shader=new Vt({gpuProgram:t,resources:{uTexture:D.EMPTY._source,uSampler:D.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new F}}}})}execute(t,e){let s=t.renderer,i=e._shader;if(!i)i=this._shader,i.groups[2]=s.texture.getTextureBindGroup(e.texture);else if(!i.gpuProgram){k("Mesh shader has no gpuProgram",e.shader);return}let n=i.gpuProgram;if(n.autoAssignGlobalUniforms&&(i.groups[0]=s.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=t.localUniforms;i.groups[1]=s.renderPipes.uniformBatch.getUniformBindGroup(o,!0)}s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Vn.extension={type:[m.WebGPUPipesAdaptor],name:"mesh"}});var Qh,zn,Ux=x(()=>{"use strict";C();je();Ru();Qh=Ut.for2d(),zn=class{start(t,e,s){let i=t.renderer,n=i.encoder,o=s.gpuProgram;this._shader=s,this._geometry=e,n.setGeometry(e,o),Qh.blendMode="normal",i.pipeline.getPipeline(e,o,Qh);let a=i.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o)}execute(t,e){let s=this._shader.gpuProgram,i=t.renderer,n=i.encoder;if(!e.bindGroup){let u=e.textures;e.bindGroup=Ii(u.textures,u.count,i.limits.maxBatchableTextures)}Qh.blendMode=e.blendMode;let o=i.bindGroup.getBindGroup(e.bindGroup,s,1),a=i.pipeline.getPipeline(this._geometry,s,Qh,e.topology);e.bindGroup._touch(i.gc.now,i.tick),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(e.size,1,e.start)}};zn.extension={type:[m.WebGPUPipesAdaptor],name:"batch"}});var ei,Jh=x(()=>{"use strict";C();ei=class{constructor(t){this._renderer=t}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}};ei.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"customRender"}});var Br,Xn=x(()=>{"use strict";Br=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}});function $n(r,t){let e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){let n=s[i];t[n.renderPipeId].execute(n)}}var td=x(()=>{"use strict"});var ri,ed=x(()=>{"use strict";C();ot();xr();Xn();td();ri=class{constructor(t){this._renderer=t}addRenderGroup(t,e){t.isCachedAsTexture?this._addRenderableCacheAsTexture(t,e):this._addRenderableDirect(t,e)}execute(t){t.isRenderable&&(t.isCachedAsTexture?this._executeCacheAsTexture(t):this._executeDirect(t))}destroy(){this._renderer=null}_addRenderableDirect(t,e){this._renderer.renderPipes.batch.break(e),t._batchableRenderGroup&&(Ct.return(t._batchableRenderGroup),t._batchableRenderGroup=null),e.add(t)}_addRenderableCacheAsTexture(t,e){let s=t._batchableRenderGroup??(t._batchableRenderGroup=Ct.get(Br));s.renderable=t.root,s.transform=t.root.relativeGroupTransform,s.texture=t.texture,s.bounds=t._textureBounds,e.add(t),this._renderer.renderPipes.blendMode.pushBlendMode(t,t.root.groupBlendMode,e),this._renderer.renderPipes.batch.addToBatch(s,e),this._renderer.renderPipes.blendMode.popBlendMode(e)}_executeCacheAsTexture(t){if(t.textureNeedsUpdate){t.textureNeedsUpdate=!1;let e=new F().translate(-t._textureBounds.x,-t._textureBounds.y);this._renderer.renderTarget.push(t.texture,!0,null,t.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:e,worldColor:4294967295,offset:{x:0,y:0}}),$n(t,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}t._batchableRenderGroup._batcher.updateElement(t._batchableRenderGroup),t._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(t){this._renderer.globalUniforms.push({worldTransformMatrix:t.inverseParentTextureTransform,worldColor:t.worldColorAlpha}),$n(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}};ri.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"renderGroup"}});function Yn(r,t){t||(t=0);for(let e=t;e<r.length&&r[e];e++)r[e]=null}var rd=x(()=>{"use strict"});function sd(r,t=!1){AS(r);let e=r.childrenToUpdate,s=r.updateTick++;for(let i in e){let n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&Ix(c,s,0)}Yn(a,u),o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)sd(r.renderGroupChildren[i],t)}function AS(r){let t=r.root,e;if(r.renderGroupParent){let s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=fi(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function Ix(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;let s=r.localTransform;r.updateLocalTransform();let i=r.parent;if(i&&!i.renderGroup?(e|=r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&ES&&CS(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&ES&&CS(r,k3,e)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)Ix(n[l],t,e);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u)}}function CS(r,t,e){if(e&An){r.groupColor=fi(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&Ka&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&yi&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}var k3,ES,kx=x(()=>{"use strict";_e();rd();Dc();k3=new lt,ES=yi|An|Ka});function Ox(r,t){let{list:e}=r.childrenRenderablesToUpdate,s=!1;for(let i=0;i<r.childrenRenderablesToUpdate.index;i++){let n=e[i];if(s=t[n.renderPipeId].validateRenderable(n),s)break}return r.structureDidChange=s,s}var Lx=x(()=>{"use strict"});var O3,jn,Nx=x(()=>{"use strict";C();ot();_r();kr();he();rd();td();kx();Lx();O3=new F,jn=class{constructor(t){this._renderer=t}render({container:t,transform:e}){let s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;let n=this._renderer,o=O3;e&&(o.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));let a=n.renderPipes;this._updateCachedRenderGroups(t.renderGroup,null),this._updateRenderGroups(t.renderGroup),n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),$n(t.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(o),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}_updateCachedRenderGroups(t,e){if(t._parentCacheAsTextureRenderGroup=e,t.isCachedAsTexture){if(!t.textureNeedsUpdate)return;e=t}for(let s=t.renderGroupChildren.length-1;s>=0;s--)this._updateCachedRenderGroups(t.renderGroupChildren[s],e);if(t.invalidateMatrices(),t.isCachedAsTexture){if(t.textureNeedsUpdate){let s=t.root.getLocalBounds(),i=this._renderer,n=t.textureOptions.resolution||i.view.resolution,o=t.textureOptions.antialias??i.view.antialias,a=t.textureOptions.scaleMode??"linear",u=t.texture;s.ceil(),t.texture&&yt.returnTexture(t.texture,!0);let l=yt.getOptimalTexture(s.width,s.height,n,o);l._source.style=new Qt({scaleMode:a}),t.texture=l,t._textureBounds||(t._textureBounds=new _t),t._textureBounds.copyFrom(s),u!==t.texture&&t.renderGroupParent&&(t.renderGroupParent.structureDidChange=!0)}}else t.texture&&(yt.returnTexture(t.texture,!0),t.texture=null)}_updateRenderGroups(t){let e=this._renderer,s=e.renderPipes;if(t.runOnRender(e),t.instructionSet.renderPipes=s,t.structureDidChange?Yn(t.childrenRenderablesToUpdate.list,0):Ox(t,s),sd(t),t.structureDidChange?(t.structureDidChange=!1,this._buildInstructions(t,e)):this._updateRenderables(t),t.childrenRenderablesToUpdate.index=0,e.renderPipes.batch.upload(t.instructionSet),!(t.isCachedAsTexture&&!t.textureNeedsUpdate))for(let i=0;i<t.renderGroupChildren.length;i++)this._updateRenderGroups(t.renderGroupChildren[i])}_updateRenderables(t){let{list:e,index:s}=t.childrenRenderablesToUpdate;for(let i=0;i<s;i++){let n=e[i];n.didViewUpdate&&t.updateRenderable(n)}Yn(e,s)}_buildInstructions(t,e){let s=t.root,i=t.instructionSet;i.reset();let n=e.renderPipes?e:e.batch.renderer,o=n.renderPipes;o.batch.buildStart(i),o.blendMode.buildStart(),o.colorMask.buildStart(),s.sortableChildren&&s.sortChildren(),s.collectRenderablesWithEffects(i,n,null),o.batch.buildEnd(i),o.blendMode.buildEnd(i)}};jn.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderGroup"}});var si,id=x(()=>{"use strict";C();Xn();si=class{constructor(t){this._renderer=t}addRenderable(t,e){let s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){let e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.bounds=t.visualBounds,e.texture=t._texture}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=new Br;return e.renderable=t,e.transform=t.groupTransform,e.texture=t._texture,e.bounds=t.visualBounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}};si.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"sprite"}});var L3,Vi,nd=x(()=>{"use strict";le();L3=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,Vi="8.19.0"});var qn,Kn,od=x(()=>{"use strict";C();nd();qn=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,Vi)}static destroy(){}};qn.extension=m.Application;Kn=class{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Vi)}destroy(){this._renderer=null}};Kn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"initHook",priority:-10}});var Rr,ad=x(()=>{"use strict";Rr=class{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),this.size=this.rawBinaryData.byteLength}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 int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=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`)}}}});function Zn(r,t,e,s){if(e??(e=0),s??(s=Math.min(r.byteLength-e,t.byteLength)),!(e&7)&&!(s&7)){let i=s/8;new Float64Array(t,0,i).set(new Float64Array(r,e,i))}else if(!(e&3)&&!(s&3)){let i=s/4;new Float32Array(t,0,i).set(new Float32Array(r,e,i))}else new Uint8Array(t).set(new Uint8Array(r,e,s))}var ud=x(()=>{"use strict"});var Hx,Dt,ii=x(()=>{"use strict";Hx={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},Dt=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(Dt||{})});function Wr(r,t){return t.alphaMode==="no-premultiply-alpha"&&Hx[r]||r}var Qn=x(()=>{"use strict";ii()});function H3(r){let t="";for(let e=0;e<r;++e)e>0&&(t+=`
|
|
395
|
-
else `),e<r-1&&(t+=`if(test == ${e}.0){}`);return t}function
|
|
396
|
-
`)});function
|
|
394
|
+
`}}});var Xn,Ux=x(()=>{"use strict";C();ot();fs();zi();ps();Zh();lr();ht();pt();Xn=class{init(){let t=Cr({name:"mesh",bits:[ei,Fx,wr]});this._shader=new Vt({gpuProgram:t,resources:{uTexture:D.EMPTY._source,uSampler:D.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new F}}}})}execute(t,e){let s=t.renderer,i=e._shader;if(!i)i=this._shader,i.groups[2]=s.texture.getTextureBindGroup(e.texture);else if(!i.gpuProgram){k("Mesh shader has no gpuProgram",e.shader);return}let n=i.gpuProgram;if(n.autoAssignGlobalUniforms&&(i.groups[0]=s.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=t.localUniforms;i.groups[1]=s.renderPipes.uniformBatch.getUniformBindGroup(o,!0)}s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Xn.extension={type:[m.WebGPUPipesAdaptor],name:"mesh"}});var Qh,$n,Ix=x(()=>{"use strict";C();je();Mu();Qh=Ut.for2d(),$n=class{start(t,e,s){let i=t.renderer,n=i.encoder,o=s.gpuProgram;this._shader=s,this._geometry=e,n.setGeometry(e,o),Qh.blendMode="normal",i.pipeline.getPipeline(e,o,Qh);let a=i.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o)}execute(t,e){let s=this._shader.gpuProgram,i=t.renderer,n=i.encoder;if(!e.bindGroup){let u=e.textures;e.bindGroup=Oi(u.textures,u.count,i.limits.maxBatchableTextures)}Qh.blendMode=e.blendMode;let o=i.bindGroup.getBindGroup(e.bindGroup,s,1),a=i.pipeline.getPipeline(this._geometry,s,Qh,e.topology);e.bindGroup._touch(i.gc.now,i.tick),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(e.size,1,e.start)}};$n.extension={type:[m.WebGPUPipesAdaptor],name:"batch"}});var ri,Jh=x(()=>{"use strict";C();ri=class{constructor(t){this._renderer=t}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}};ri.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"customRender"}});var Br,Yn=x(()=>{"use strict";Br=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}});function jn(r,t){let e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){let n=s[i];t[n.renderPipeId].execute(n)}}var td=x(()=>{"use strict"});var si,ed=x(()=>{"use strict";C();ot();xr();Yn();td();si=class{constructor(t){this._renderer=t}addRenderGroup(t,e){t.isCachedAsTexture?this._addRenderableCacheAsTexture(t,e):this._addRenderableDirect(t,e)}execute(t){t.isRenderable&&(t.isCachedAsTexture?this._executeCacheAsTexture(t):this._executeDirect(t))}destroy(){this._renderer=null}_addRenderableDirect(t,e){this._renderer.renderPipes.batch.break(e),t._batchableRenderGroup&&(Ct.return(t._batchableRenderGroup),t._batchableRenderGroup=null),e.add(t)}_addRenderableCacheAsTexture(t,e){let s=t._batchableRenderGroup??(t._batchableRenderGroup=Ct.get(Br));s.renderable=t.root,s.transform=t.root.relativeGroupTransform,s.texture=t.texture,s.bounds=t._textureBounds,e.add(t),this._renderer.renderPipes.blendMode.pushBlendMode(t,t.root.groupBlendMode,e),this._renderer.renderPipes.batch.addToBatch(s,e),this._renderer.renderPipes.blendMode.popBlendMode(e)}_executeCacheAsTexture(t){if(t.textureNeedsUpdate){t.textureNeedsUpdate=!1;let e=new F().translate(-t._textureBounds.x,-t._textureBounds.y);this._renderer.renderTarget.push(t.texture,!0,null,t.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:e,worldColor:4294967295,offset:{x:0,y:0}}),jn(t,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}t._batchableRenderGroup._batcher.updateElement(t._batchableRenderGroup),t._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(t){this._renderer.globalUniforms.push({worldTransformMatrix:t.inverseParentTextureTransform,worldColor:t.worldColorAlpha}),jn(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}};si.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"renderGroup"}});function qn(r,t){t||(t=0);for(let e=t;e<r.length&&r[e];e++)r[e]=null}var rd=x(()=>{"use strict"});function sd(r,t=!1){PS(r);let e=r.childrenToUpdate,s=r.updateTick++;for(let i in e){let n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&kx(c,s,0)}qn(a,u),o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)sd(r.renderGroupChildren[i],t)}function PS(r){let t=r.root,e;if(r.renderGroupParent){let s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=mi(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function kx(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;let s=r.localTransform;r.updateLocalTransform();let i=r.parent;if(i&&!i.renderGroup?(e|=r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&AS&&wS(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&AS&&wS(r,O3,e)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)kx(n[l],t,e);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u)}}function wS(r,t,e){if(e&Pn){r.groupColor=mi(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&Za&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&Ti&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}var O3,AS,Ox=x(()=>{"use strict";_e();rd();Dc();O3=new lt,AS=Ti|Pn|Za});function Lx(r,t){let{list:e}=r.childrenRenderablesToUpdate,s=!1;for(let i=0;i<r.childrenRenderablesToUpdate.index;i++){let n=e[i];if(s=t[n.renderPipeId].validateRenderable(n),s)break}return r.structureDidChange=s,s}var Nx=x(()=>{"use strict"});var L3,Kn,Hx=x(()=>{"use strict";C();ot();_r();kr();he();rd();td();Ox();Nx();L3=new F,Kn=class{constructor(t){this._renderer=t}render({container:t,transform:e}){let s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;let n=this._renderer,o=L3;e&&(o.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));let a=n.renderPipes;this._updateCachedRenderGroups(t.renderGroup,null),this._updateRenderGroups(t.renderGroup),n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),jn(t.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(o),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}_updateCachedRenderGroups(t,e){if(t._parentCacheAsTextureRenderGroup=e,t.isCachedAsTexture){if(!t.textureNeedsUpdate)return;e=t}for(let s=t.renderGroupChildren.length-1;s>=0;s--)this._updateCachedRenderGroups(t.renderGroupChildren[s],e);if(t.invalidateMatrices(),t.isCachedAsTexture){if(t.textureNeedsUpdate){let s=t.root.getLocalBounds(),i=this._renderer,n=t.textureOptions.resolution||i.view.resolution,o=t.textureOptions.antialias??i.view.antialias,a=t.textureOptions.scaleMode??"linear",u=t.texture;s.ceil(),t.texture&&yt.returnTexture(t.texture,!0);let l=yt.getOptimalTexture(s.width,s.height,n,o);l._source.style=new Qt({scaleMode:a}),t.texture=l,t._textureBounds||(t._textureBounds=new _t),t._textureBounds.copyFrom(s),u!==t.texture&&t.renderGroupParent&&(t.renderGroupParent.structureDidChange=!0)}}else t.texture&&(yt.returnTexture(t.texture,!0),t.texture=null)}_updateRenderGroups(t){let e=this._renderer,s=e.renderPipes;if(t.runOnRender(e),t.instructionSet.renderPipes=s,t.structureDidChange?qn(t.childrenRenderablesToUpdate.list,0):Lx(t,s),sd(t),t.structureDidChange?(t.structureDidChange=!1,this._buildInstructions(t,e)):this._updateRenderables(t),t.childrenRenderablesToUpdate.index=0,e.renderPipes.batch.upload(t.instructionSet),!(t.isCachedAsTexture&&!t.textureNeedsUpdate))for(let i=0;i<t.renderGroupChildren.length;i++)this._updateRenderGroups(t.renderGroupChildren[i])}_updateRenderables(t){let{list:e,index:s}=t.childrenRenderablesToUpdate;for(let i=0;i<s;i++){let n=e[i];n.didViewUpdate&&t.updateRenderable(n)}qn(e,s)}_buildInstructions(t,e){let s=t.root,i=t.instructionSet;i.reset();let n=e.renderPipes?e:e.batch.renderer,o=n.renderPipes;o.batch.buildStart(i),o.blendMode.buildStart(),o.colorMask.buildStart(),s.sortableChildren&&s.sortChildren(),s.collectRenderablesWithEffects(i,n,null),o.batch.buildEnd(i),o.blendMode.buildEnd(i)}};Kn.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderGroup"}});var ii,id=x(()=>{"use strict";C();Yn();ii=class{constructor(t){this._renderer=t}addRenderable(t,e){let s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){let e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.bounds=t.visualBounds,e.texture=t._texture}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=new Br;return e.renderable=t,e.transform=t.groupTransform,e.texture=t._texture,e.bounds=t.visualBounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}};ii.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"sprite"}});var N3,Xi,nd=x(()=>{"use strict";le();N3=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,Xi="8.19.0"});var Zn,Qn,od=x(()=>{"use strict";C();nd();Zn=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,Xi)}static destroy(){}};Zn.extension=m.Application;Qn=class{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Xi)}destroy(){this._renderer=null}};Qn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"initHook",priority:-10}});var Rr,ad=x(()=>{"use strict";Rr=class{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),this.size=this.rawBinaryData.byteLength}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 int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=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`)}}}});function Jn(r,t,e,s){if(e??(e=0),s??(s=Math.min(r.byteLength-e,t.byteLength)),!(e&7)&&!(s&7)){let i=s/8;new Float64Array(t,0,i).set(new Float64Array(r,e,i))}else if(!(e&3)&&!(s&3)){let i=s/4;new Float32Array(t,0,i).set(new Float32Array(r,e,i))}else new Uint8Array(t).set(new Uint8Array(r,e,s))}var ud=x(()=>{"use strict"});var Wx,Dt,ni=x(()=>{"use strict";Wx={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},Dt=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(Dt||{})});function Wr(r,t){return t.alphaMode==="no-premultiply-alpha"&&Wx[r]||r}var to=x(()=>{"use strict";ni()});function W3(r){let t="";for(let e=0;e<r;++e)e>0&&(t+=`
|
|
395
|
+
else `),e<r-1&&(t+=`if(test == ${e}.0){}`);return t}function Du(r,t){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let e=t.createShader(t.FRAGMENT_SHADER);try{for(;;){let s=H3.replace(/%forloop%/gi,W3(r));if(t.shaderSource(e,s),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))r=r/2|0;else break}}finally{t.deleteShader(e)}return r}var H3,ld=x(()=>{"use strict";H3=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
396
|
+
`)});function Vx(){if(eo)return eo;let r=xu();return eo=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),eo=Du(eo,r),r.getExtension("WEBGL_lose_context")?.loseContext(),eo}var eo,zx=x(()=>{"use strict";hh();ld();eo=null});var Fu,Xx=x(()=>{"use strict";Fu=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){let e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}});function BS(){return hd>0?Uu[--hd]:new cd}function RS(r){r.elements=null,Uu[hd++]=r}var cd,Uu,hd,Gu,MS,$x,Yx=x(()=>{"use strict";Yt();ad();xt();Is();ud();to();zx();Xx();cd=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Fu,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}},Uu=[],hd=0;rr.register({clear:()=>{if(Uu.length>0)for(let r of Uu)r&&r.destroy();Uu.length=0,hd=0}});Gu=0,MS=class DS{constructor(t){this.uid=et("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...DS.defaultOptions,...t},t.maxTextures||(I("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=Vx());let{maxTextures:e,attributesInitialSize:s,indicesInitialSize:i}=t;this.attributeBuffer=new Rr(s*4),this.indexBuffer=new Uint16Array(i),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)RS(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){let s=t._batch.textures.ids[e._source.uid];return!s&&s!==0?!1:(t._textureId=s,t.texture=e,!0)}updateElement(t){this.dirty=!0;let e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){let e=this._elements;if(!e[this.elementStart])return;let s=BS(),i=s.textures;i.clear();let n=e[this.elementStart],o=Wr(n.blendMode,n.texture._source),a=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let u=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,c=this.indexBuffer,h=this._batchIndexSize,d=this._batchIndexStart,f="startBatch",p=[],g=this.maxTextures;for(let _=this.elementStart;_<this.elementSize;++_){let b=e[_];e[_]=null;let v=b.texture._source,T=Wr(b.blendMode,v),S=o!==T||a!==b.topology;if(v._batchTick===Gu&&!S){b._textureId=v._textureBindLocation,h+=b.indexSize,b.packAsQuad?(this.packQuadAttributes(b,u,l,b._attributeStart,b._textureId),this.packQuadIndex(c,b._indexStart,b._attributeStart/this.vertexSize)):(this.packAttributes(b,u,l,b._attributeStart,b._textureId),this.packIndex(b,c,b._indexStart,b._attributeStart/this.vertexSize)),b._batch=s,p.push(b);continue}v._batchTick=Gu,(i.count>=g||S)&&(this._finishBatch(s,d,h-d,i,o,a,t,f,p),f="renderBatch",d=h,o=T,a=b.topology,s=BS(),i=s.textures,i.clear(),p=[],++Gu),b._textureId=v._textureBindLocation=i.count,i.ids[v.uid]=i.count,i.textures[i.count++]=v,b._batch=s,p.push(b),h+=b.indexSize,b.packAsQuad?(this.packQuadAttributes(b,u,l,b._attributeStart,b._textureId),this.packQuadIndex(c,b._indexStart,b._attributeStart/this.vertexSize)):(this.packAttributes(b,u,l,b._attributeStart,b._textureId),this.packIndex(b,c,b._indexStart,b._attributeStart/this.vertexSize))}i.count>0&&(this._finishBatch(s,d,h-d,i,o,a,t,f,p),d=h,++Gu),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=h}_finishBatch(t,e,s,i,n,o,a,u,l){t.gpuBindGroup=null,t.bindGroup=null,t.action=u,t.batcher=this,t.textures=i,t.blendMode=n,t.topology=o,t.start=e,t.size=s,t.elements=l,++Gu,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){let e=Math.max(t,this.attributeBuffer.size*2),s=new Rr(e);Jn(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){let e=this.indexBuffer,s=Math.max(t,e.length*1.5);s+=s%2;let i=s>65535?new Uint32Array(s):new Uint16Array(s);if(i.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n<e.length;n++)i[n]=e[n];else Jn(e.buffer,i.buffer);this.indexBuffer=i}packQuadIndex(t,e,s){t[e]=s+0,t[e+1]=s+1,t[e+2]=s+2,t[e+3]=s+0,t[e+4]=s+2,t[e+5]=s+3}packIndex(t,e,s,i){let n=t.indices,o=t.indexSize,a=t.indexOffset,u=t.attributeOffset;for(let l=0;l<o;l++)e[s++]=i+n[l+a]-u}destroy(t={}){if(this.batches!==null){for(let e=0;e<this.batchIndex;e++)RS(this.batches[e]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(this.shader?.destroy(),this.shader=null);for(let e=0;e<this._elements.length;e++)this._elements[e]&&(this._elements[e]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};MS.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};$x=MS});var V3,z3,Iu,jx=x(()=>{"use strict";cs();Hr();Js();V3=new Float32Array(1),z3=new Uint32Array(1),Iu=class extends Ne{constructor(){let e=new zt({data:V3,label:"attribute-batch-buffer",usage:ct.VERTEX|ct.COPY_DST,shrinkToFit:!1}),s=new zt({data:z3,label:"index-batch-buffer",usage:ct.INDEX|ct.COPY_DST,shrinkToFit:!1}),i=24;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:i,offset:0},aUV:{buffer:e,format:"float32x2",stride:i,offset:8},aColor:{buffer:e,format:"unorm8x4",stride:i,offset:16},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:i,offset:20}},indexBuffer:s})}}});function $i(r){let t=FS[r];if(t)return t;let e=new Int32Array(r);for(let s=0;s<r;s++)e[s]=s;return t=FS[r]=new dt({uTextures:{value:e,type:"i32",size:r}},{isStatic:!0}),t}var FS,ku=x(()=>{"use strict";te();FS={}});var ro,qx=x(()=>{"use strict";fs();Wn();Vn();ps();ku();lr();ro=class extends Vt{constructor(t){let e=Ar({name:"batch",bits:[Ni,Wi(t),Pr]}),s=Cr({name:"batch",bits:[Li,Hi(t),wr]});super({glProgram:e,gpuProgram:s,resources:{batchSamplers:$i(t)}}),this.maxTextures=t}}});var Ou,GS,so,dd=x(()=>{"use strict";C();Yx();jx();qx();Ou=null,GS=class US extends $x{constructor(t){super(t),this.geometry=new Iu,this.name=US.extension.name,this.vertexSize=6,Ou??(Ou=new ro(t.maxTextures)),this.shader=Ou}packAttributes(t,e,s,i,n){let o=n<<16|t.roundPixels&65535,a=t.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,{positions:p,uvs:g}=t,_=t.color,b=t.attributeOffset,y=b+t.attributeSize;for(let v=b;v<y;v++){let T=v*2,S=p[T],E=p[T+1];e[i++]=u*S+c*E+d,e[i++]=h*E+l*S+f,e[i++]=g[T],e[i++]=g[T+1],s[i++]=_,s[i++]=o}}packQuadAttributes(t,e,s,i,n){let o=t.texture,a=t.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,p=t.bounds,g=p.maxX,_=p.minX,b=p.maxY,y=p.minY,v=o.uvs,T=t.color,S=n<<16|t.roundPixels&65535;e[i+0]=u*_+c*y+d,e[i+1]=h*y+l*_+f,e[i+2]=v.x0,e[i+3]=v.y0,s[i+4]=T,s[i+5]=S,e[i+6]=u*g+c*y+d,e[i+7]=h*y+l*g+f,e[i+8]=v.x1,e[i+9]=v.y1,s[i+10]=T,s[i+11]=S,e[i+12]=u*g+c*b+d,e[i+13]=h*b+l*g+f,e[i+14]=v.x2,e[i+15]=v.y2,s[i+16]=T,s[i+17]=S,e[i+18]=u*_+c*b+d,e[i+19]=h*b+l*_+f,e[i+20]=v.x3,e[i+21]=v.y3,s[i+22]=T,s[i+23]=S}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Ou=new ro(t),this.shader=Ou)}destroy(){this.shader=null,super.destroy()}};GS.extension={type:[m.Batcher],name:"default"};so=GS});var Kx,io,fd=x(()=>{"use strict";C();je();dd();Kx=class IS{constructor(t,e){this.state=Ut.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=t,this._adaptor=e,this._adaptor.init?.(this)}static getBatcher(t,e){return new this._availableBatchers[t]({maxTextures:e})}buildStart(t){let e=this._batchersByInstructionSet[t.uid];e||(e=this._batchersByInstructionSet[t.uid]=Object.create(null),e.default||(e.default=new so({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=e,this._activeBatch=this._activeBatches.default;for(let s in this._activeBatches)this._activeBatches[s].begin()}addToBatch(t,e){if(this._activeBatch.name!==t.batcherName){this._activeBatch.break(e);let s=this._activeBatches[t.batcherName];s||(s=this._activeBatches[t.batcherName]=IS.getBatcher(t.batcherName,this.renderer.limits.maxBatchableTextures),s.begin()),this._activeBatch=s}this._activeBatch.add(t)}break(t){this._activeBatch.break(t)}buildEnd(t){this._activeBatch.break(t);let e=this._activeBatches;for(let s in e){let i=e[s],n=i.geometry;n.indexBuffer.setDataWithSize(i.indexBuffer,i.indexSize,!0),n.buffers[0].setDataWithSize(i.attributeBuffer.float32View,i.attributeSize,!1)}}upload(t){let e=this._batchersByInstructionSet[t.uid];for(let s in e){let i=e[s],n=i.geometry;i.dirty&&(i.dirty=!1,n.buffers[0].update(i.attributeSize*4))}}execute(t){if(t.action==="startBatch"){let e=t.batcher,s=e.geometry,i=e.shader;this._adaptor.start(this,s,i)}this._adaptor.execute(this,t)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(let t in this._activeBatches)this._activeBatches[t].destroy();this._activeBatches=null}};Kx.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"batch"};Kx._availableBatchers=Object.create(null);io=Kx;O.handleByMap(m.Batcher,io._availableBatchers);O.add(so)});var Zx,Qx=x(()=>{"use strict";Zx=`in vec2 vMaskCoord;
|
|
397
397
|
in vec2 vTextureCoord;
|
|
398
398
|
|
|
399
399
|
uniform sampler2D uTexture;
|
|
@@ -433,7 +433,7 @@ void main(void)
|
|
|
433
433
|
|
|
434
434
|
finalColor = original * a;
|
|
435
435
|
}
|
|
436
|
-
`});var
|
|
436
|
+
`});var Jx,t_=x(()=>{"use strict";Jx=`in vec2 aPosition;
|
|
437
437
|
|
|
438
438
|
out vec2 vTextureCoord;
|
|
439
439
|
out vec2 vMaskCoord;
|
|
@@ -470,7 +470,7 @@ void main(void)
|
|
|
470
470
|
vTextureCoord = filterTextureCoord(aPosition);
|
|
471
471
|
vMaskCoord = getFilterCoord(aPosition);
|
|
472
472
|
}
|
|
473
|
-
`});var pd,
|
|
473
|
+
`});var pd,e_=x(()=>{"use strict";pd=`struct GlobalFilterUniforms {
|
|
474
474
|
uInputSize:vec4<f32>,
|
|
475
475
|
uInputPixel:vec4<f32>,
|
|
476
476
|
uInputClamp:vec4<f32>,
|
|
@@ -574,9 +574,9 @@ fn mainFragment(
|
|
|
574
574
|
|
|
575
575
|
return source * a;
|
|
576
576
|
}
|
|
577
|
-
`});var Ou,e_=x(()=>{"use strict";ot();Oe();Ye();te();Oc();Sr();Zx();Jx();t_();Ou=class extends ae{constructor(t){let{sprite:e,...s}=t,i=new bi(e.texture),n=new dt({uFilterMatrix:{value:new F,type:"mat3x3<f32>"},uMaskClamp:{value:i.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:t.inverse?1:0,type:"f32"},uChannel:{value:t.channel==="alpha"?1:0,type:"f32"}}),o=Mt.from({vertex:{source:pd,entryPoint:"mainVertex"},fragment:{source:pd,entryPoint:"mainFragment"}}),a=Rt.from({vertex:Qx,fragment:Kx,name:"mask-filter"});super({...s,gpuProgram:o,glProgram:a,clipToViewport:!1,resources:{filterUniforms:n,uMaskTexture:e.texture.source}}),this.sprite=e,this._textureMatrix=i}set inverse(t){this.resources.filterUniforms.uniforms.uInverse=t?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}set channel(t){this.resources.filterUniforms.uniforms.uChannel=t==="alpha"?1:0}get channel(){return this.resources.filterUniforms.uniforms.uChannel===1?"alpha":"red"}apply(t,e,s,i){this._textureMatrix.texture=this.sprite.texture,t.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,t.applyFilter(this,e,s,i)}}});var z3,r_,ni,md=x(()=>{"use strict";C();Xa();e_();he();di();Ys();xr();ht();_r();Pe();z3=new _t,r_=class extends Ur{constructor(){super(),this.filters=[new Ou({sprite:new we(D.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(t){this.filters[0].sprite=t}get inverse(){return this.filters[0].inverse}set inverse(t){this.filters[0].inverse=t}get channel(){return this.filters[0].channel}set channel(t){this.filters[0].channel=t}},ni=class{constructor(t){this._activeMaskStage=[],this._renderer=t}push(t,e,s){let i=this._renderer;if(i.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1,maskedContainer:e}),t.inverse=e._maskOptions.inverse,t.channel=e._maskOptions.channel??"red",t.renderMaskToTexture){let n=t.mask;n.includeInBuild=!0,n.collectRenderables(s,i,null),n.includeInBuild=!1}i.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:t,maskedContainer:e,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){let e=this._renderer,s=t.mask.renderMaskToTexture;if(t.action==="pushMaskBegin"){let i=Ct.get(r_);if(i.inverse=t.inverse,i.channel=t.mask.channel,s){t.mask.mask.measurable=!0;let n=rs(t.mask.mask,!0,z3);t.mask.mask.measurable=!1,n.ceil();let o=e.renderTarget.renderTarget.colorTexture.source,a=yt.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);e.renderTarget.push(a,!0),e.globalUniforms.push({offset:n,worldColor:4294967295});let u=i.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:i,maskedContainer:t.maskedContainer,filterTexture:a})}else i.sprite=t.mask.mask,this._activeMaskStage.push({filterEffect:i,maskedContainer:t.maskedContainer})}else if(t.action==="pushMaskEnd"){let i=this._activeMaskStage[this._activeMaskStage.length-1];s&&(e.type===Tt.WEBGL&&e.renderTarget.finishRenderPass(),e.renderTarget.pop(),e.globalUniforms.pop()),e.filter.push({renderPipeId:"filter",action:"pushFilter",container:i.maskedContainer,filterEffect:i.filterEffect,canBundle:!1})}else if(t.action==="popMaskEnd"){e.filter.pop();let i=this._activeMaskStage.pop();s&&yt.returnTexture(i.filterTexture),Ct.return(i.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}};ni.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"alphaMask"}});var so,s_=x(()=>{"use strict";C();so=class{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,s){this._renderer.renderPipes.batch.break(s);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&t.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,s.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1})),this._colorStackIndex++}pop(t,e,s){this._renderer.renderPipes.batch.break(s);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,s.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1}))}execute(t){this._renderer.colorMask.setMask(t.colorMask)}destroy(){this._renderer=null,this._colorStack=null}};so.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"colorMask"}});var io,i_=x(()=>{"use strict";C();Fi();ii();io=class{constructor(t){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=t}push(t,e,s){var i;let n=t,o=this._renderer;o.renderPipes.batch.break(s),o.renderPipes.blendMode.setBlendMode(n.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});let a=n.mask;a.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=s.instructionSize,a.collectRenderables(s,o,null),a.includeInBuild=!1,o.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});let l=s.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(i=this._maskStackHash)[c]??(i[c]=0)}pop(t,e,s){let i=t,n=this._renderer;n.renderPipes.batch.break(s),n.renderPipes.blendMode.setBlendMode(i.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:e._maskOptions.inverse,canBundle:!1});let o=this._maskHash.get(t);for(let a=0;a<o.instructionsLength;a++)s.instructions[s.instructionSize++]=s.instructions[o.instructionsStart++];s.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(t){var e;let s=this._renderer,i=s,n=s.renderTarget.renderTarget.uid,o=(e=this._maskStackHash)[n]??(e[n]=0);t.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(Dt.RENDERING_MASK_ADD,o),o++,i.colorMask.setMask(0)):t.action==="pushMaskEnd"?(t.inverse?i.stencil.setStencilMode(Dt.INVERSE_MASK_ACTIVE,o):i.stencil.setStencilMode(Dt.MASK_ACTIVE,o),i.colorMask.setMask(15)):t.action==="popMaskBegin"?(i.colorMask.setMask(0),o!==0?i.stencil.setStencilMode(Dt.RENDERING_MASK_REMOVE,o):(i.renderTarget.clear(null,ue.STENCIL),i.stencil.setStencilMode(Dt.DISABLED,o)),o--):t.action==="popMaskEnd"&&(t.inverse?i.stencil.setStencilMode(Dt.INVERSE_MASK_ACTIVE,o):i.stencil.setStencilMode(Dt.MASK_ACTIVE,o),i.colorMask.setMask(15)),this._maskStackHash[n]=o}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}};io.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"stencilMask"}});var n_,o_,a_=x(()=>{"use strict";It();C();pt();n_=class US{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new X(0),this.color=this._backgroundColor,this.alpha=1}init(t){t={...US.defaultOptions,...t},this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){X.shared.setValue(t).alpha<1&&this._backgroundColor.alpha===1&&k("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};n_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"background",priority:0};n_.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};o_=n_});var Lu,oi,gd=x(()=>{"use strict";C();Xa();Nc();pt();Lu={};O.handle(m.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Lu[r.name]=r.ref},r=>{delete Lu[r.name]});oi=class{constructor(t){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(t,e,s){this._blendModeStack.push(e),this.setBlendMode(t,e,s)}popBlendMode(t){this._blendModeStack.pop();let e=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,e,t)}setBlendMode(t,e,s){let i=t instanceof Ws;if(this._activeBlendMode===e){this._isAdvanced&&t&&!i&&this._renderableList?.push(t);return}this._isAdvanced&&this._endAdvancedBlendMode(s),this._activeBlendMode=e,t&&(this._isAdvanced=!!Lu[e],this._isAdvanced&&this._beginAdvancedBlendMode(t,s))}_beginAdvancedBlendMode(t,e){this._renderer.renderPipes.batch.break(e);let s=this._activeBlendMode;if(!Lu[s]){k(`Unable to assign BlendMode: '${s}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._ensureFilterEffect(s),n=t instanceof Ws,o={renderPipeId:"filter",action:"pushFilter",filterEffect:i,renderables:n?null:[t],container:n?t.root:null,canBundle:!1};this._renderableList=o.renderables,e.add(o)}_ensureFilterEffect(t){let e=this._filterHash[t];return e||(e=this._filterHash[t]=new Ur,e.filters=[new Lu[t]]),e}_endAdvancedBlendMode(t){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(let t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}};oi.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"blendMode"}});var u_,l_,c_,h_=x(()=>{"use strict";mt();C();_e();ht();u_={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},l_=class IS{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof lt||t instanceof D?{target:t,...e}:{...e,...t}}async image(t){let e=N.get().createImage();return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,IS.defaultImageOptions);let{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},u_[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(u_[e],s);if(i.convertToBlob!==void 0){let n=await i.convertToBlob({type:u_[e],quality:s});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);let e=t.target,s=this._renderer;if(e instanceof D)return s.texture.generateCanvas(e);let i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(!0),n}pixels(t){t=this._normalizeOptions(t);let e=t.target,s=this._renderer,i=e instanceof D?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof lt&&i.destroy(!0),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof D?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){t=this._normalizeOptions(t);let e=this.canvas(t),s=document.createElement("a");s.download=t.filename??"image.png",s.href=e.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){let e=t.width??200;t=this._normalizeOptions(t);let s=this.canvas(t),i=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);let n=["font-size: 1px;",`padding: ${e}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};l_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"extract"};l_.defaultImageOptions={format:"png",quality:1};c_=l_});var Nu,d_=x(()=>{"use strict";Wt();ht();Nu=class r extends D{static create(t){let{dynamic:e,textureOptions:s,...i}=t;return new r({...s,source:new st(i),dynamic:e??!1})}resize(t,e,s){return this.source.resize(t,e,s),this}}});var X3,$3,Y3,no,f_=x(()=>{"use strict";It();C();ot();jt();he();ja();_e();d_();X3=new J,$3=new _t,Y3=[0,0,0,0],no=class{constructor(t){this._renderer=t}generateTexture(t){t instanceof lt&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});let e=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,i=t.target,n=t.clearColor;n?n=Array.isArray(n)&&n.length===4?n:X.shared.setValue(n).toArray():n=Y3;let o=t.frame?.copyTo(X3)||pi(i,$3).rectangle,a=t.defaultAnchor&&{defaultAnchor:t.defaultAnchor};o.width=Math.max(o.width,1/e)|0,o.height=Math.max(o.height,1/e)|0;let u=Nu.create({...t.textureSourceOptions,width:o.width,height:o.height,resolution:e,antialias:s,textureOptions:a}),l=F.shared.translate(-o.x,-o.y);return this._renderer.render({container:i,transform:l,target:u,clearColor:n}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}};no.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"textureGenerator"}});function p_(r){let t=!1;for(let s in r)if(r[s]==null){t=!0;break}if(!t)return r;let e=Object.create(null);for(let s in r){let i=r[s];i&&(e[s]=i)}return e}function m_(r){let t=0;for(let e=0;e<r.length;e++)r[e]==null?t++:r[e-t]=r[e];return r.length-=t,r}var g_=x(()=>{"use strict"});var x_,__,b_=x(()=>{"use strict";C();g_();x_=class kS{constructor(t){this._managedResources=[],this._managedResourceHashes=[],this._managedCollections=[],this._ready=!1,this._renderer=t}init(t){t={...kS.defaultOptions,...t},this.maxUnusedTime=t.gcMaxUnusedTime,this._frequency=t.gcFrequency,this.enabled=t.gcActive,this.now=performance.now()}get enabled(){return!!this._handler}set enabled(t){this.enabled!==t&&(t?(this._handler=this._renderer.scheduler.repeat(()=>{this._ready=!0},this._frequency,!1),this._collectionsHandler=this._renderer.scheduler.repeat(()=>{for(let e of this._managedCollections){let{context:s,collection:i,type:n}=e;n==="hash"?s[i]=p_(s[i]):s[i]=m_(s[i])}},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._collectionsHandler),this._handler=0,this._collectionsHandler=0))}prerender({container:t}){this.now=performance.now(),t.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(t.renderGroup,t.renderGroup.gcTick)}postrender(){!this._ready||!this.enabled||(this.run(),this._ready=!1)}_updateInstructionGCTick(t,e){t.instructionSet.gcTick=e,t.gcTick=e;for(let s of t.renderGroupChildren)this._updateInstructionGCTick(s,e)}addCollection(t,e,s){this._managedCollections.push({context:t,collection:e,type:s})}addResource(t,e){if(t._gcLastUsed!==-1){t._gcLastUsed=this.now,t._onTouch?.(this.now);return}let s=this._managedResources.length;t._gcData={index:s,type:e},t._gcLastUsed=this.now,t._onTouch?.(this.now),t.once("unload",this.removeResource,this),this._managedResources.push(t)}removeResource(t){let e=t._gcData;if(!e)return;let s=e.index,i=this._managedResources.length-1;if(s!==i){let n=this._managedResources[i];this._managedResources[s]=n,n._gcData.index=s}this._managedResources.length--,t._gcData=null,t._gcLastUsed=-1}addResourceHash(t,e,s,i=0){this._managedResourceHashes.push({context:t,hash:e,type:s,priority:i}),this._managedResourceHashes.sort((n,o)=>n.priority-o.priority)}run(){let t=performance.now(),e=this._managedResourceHashes;for(let i of e)this.runOnHash(i,t);let s=0;for(let i=0;i<this._managedResources.length;i++){let n=this._managedResources[i];s=this.runOnResource(n,t,s)}this._managedResources.length=s}updateRenderableGCTick(t,e){let s=t.renderGroup??t.parentRenderGroup,i=s?.instructionSet?.gcTick??-1;(s?.gcTick??0)===i&&(t._gcLastUsed=e,t._onTouch?.(e))}runOnResource(t,e,s){let i=t._gcData;return i.type==="renderable"&&this.updateRenderableGCTick(t,e),e-t._gcLastUsed<this.maxUnusedTime||!t.autoGarbageCollect?(this._managedResources[s]=t,i.index=s,s++):(t.unload(),t._gcData=null,t._gcLastUsed=-1,t.off("unload",this.removeResource,this)),s}_createHashClone(t,e){let s=Object.create(null);for(let i in t){if(i===e)break;t[i]!==null&&(s[i]=t[i])}return s}runOnHash(t,e){let{context:s,hash:i,type:n}=t,o=s[i],a=null,u=0;for(let l in o){let c=o[l];if(c===null){u++,u===1e4&&!a&&(a=this._createHashClone(o,l));continue}if(c._gcLastUsed===-1){c._gcLastUsed=e,c._onTouch?.(e),a&&(a[l]=c);continue}if(n==="renderable"&&this.updateRenderableGCTick(c,e),!(e-c._gcLastUsed<this.maxUnusedTime)&&c.autoGarbageCollect){if(n==="renderable"){let d=c,f=d.renderGroup??d.parentRenderGroup;f&&(f.structureDidChange=!0)}c.unload(),c._gcData=null,c._gcLastUsed=-1,a||(u+1!==1e4?(o[l]=null,u++):a=this._createHashClone(o,l))}else a&&(a[l]=c)}a&&(s[i]=a)}destroy(){this.enabled=!1,this._managedResources.forEach(t=>{t.off("unload",this.removeResource,this)}),this._managedResources.length=0,this._managedResourceHashes.length=0,this._managedCollections.length=0,this._renderer=null}};x_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"gc",priority:0};x_.defaultOptions={gcActive:!0,gcMaxUnusedTime:6e4,gcFrequency:3e4};__=x_});function j3(r,t,e,s){e[s++]=(r>>16&255)/255,e[s++]=(r>>8&255)/255,e[s++]=(r&255)/255,e[s++]=t}function Mr(r,t,e){let s=(r>>24&255)/255;t[e++]=(r&255)/255*s,t[e++]=(r>>8&255)/255*s,t[e++]=(r>>16&255)/255*s,t[e++]=s}var Xi=x(()=>{"use strict"});var oo,y_=x(()=>{"use strict";C();ot();Ue();Xi();us();Pe();te();oo=class{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new F,worldColor:4294967295,offset:new nt},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Mr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new oe,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Tt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new dt({uProjectionMatrix:{value:new F,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new F,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}};oo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"globalUniforms"}});var q3,ao,v_=x(()=>{"use strict";C();is();q3=1,ao=class{constructor(){this._tasks=[],this._offset=0}init(){Gt.system.add(this._update,this)}repeat(t,e,s=!0){let i=q3++,n=0;return s&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:t,duration:e,start:performance.now(),offset:n,last:performance.now(),repeat:!0,id:i}),i}cancel(t){for(let e=0;e<this._tasks.length;e++)if(this._tasks[e].id===t){this._tasks.splice(e,1);return}}_update(){let t=performance.now();for(let e=0;e<this._tasks.length;e++){let s=this._tasks[e];if(t-s.offset-s.last>=s.duration){let i=t-s.start;s.func(i),s.last=t}}}destroy(){Gt.system.remove(this._update,this),this._tasks.length=0}};ao.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"scheduler",priority:0}});function T_(r){if(!OS){if(N.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let t=[`%c %c %c %c %c PixiJS %c v${Vi} (${r}) http://www.pixijs.com/
|
|
577
|
+
`});var Lu,r_=x(()=>{"use strict";ot();Oe();Ye();te();Oc();Sr();Qx();t_();e_();Lu=class extends ae{constructor(t){let{sprite:e,...s}=t,i=new vi(e.texture),n=new dt({uFilterMatrix:{value:new F,type:"mat3x3<f32>"},uMaskClamp:{value:i.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:t.inverse?1:0,type:"f32"},uChannel:{value:t.channel==="alpha"?1:0,type:"f32"}}),o=Mt.from({vertex:{source:pd,entryPoint:"mainVertex"},fragment:{source:pd,entryPoint:"mainFragment"}}),a=Rt.from({vertex:Jx,fragment:Zx,name:"mask-filter"});super({...s,gpuProgram:o,glProgram:a,clipToViewport:!1,resources:{filterUniforms:n,uMaskTexture:e.texture.source}}),this.sprite=e,this._textureMatrix=i}set inverse(t){this.resources.filterUniforms.uniforms.uInverse=t?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}set channel(t){this.resources.filterUniforms.uniforms.uChannel=t==="alpha"?1:0}get channel(){return this.resources.filterUniforms.uniforms.uChannel===1?"alpha":"red"}apply(t,e,s,i){this._textureMatrix.texture=this.sprite.texture,t.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,t.applyFilter(this,e,s,i)}}});var X3,s_,oi,md=x(()=>{"use strict";C();$a();r_();he();pi();js();xr();ht();_r();Pe();X3=new _t,s_=class extends Ur{constructor(){super(),this.filters=[new Lu({sprite:new we(D.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(t){this.filters[0].sprite=t}get inverse(){return this.filters[0].inverse}set inverse(t){this.filters[0].inverse=t}get channel(){return this.filters[0].channel}set channel(t){this.filters[0].channel=t}},oi=class{constructor(t){this._activeMaskStage=[],this._renderer=t}push(t,e,s){let i=this._renderer;if(i.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1,maskedContainer:e}),t.inverse=e._maskOptions.inverse,t.channel=e._maskOptions.channel??"red",t.renderMaskToTexture){let n=t.mask;n.includeInBuild=!0,n.collectRenderables(s,i,null),n.includeInBuild=!1}i.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:t,maskedContainer:e,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){let e=this._renderer,s=t.mask.renderMaskToTexture;if(t.action==="pushMaskBegin"){let i=Ct.get(s_);if(i.inverse=t.inverse,i.channel=t.mask.channel,s){t.mask.mask.measurable=!0;let n=rs(t.mask.mask,!0,X3);t.mask.mask.measurable=!1,n.ceil();let o=e.renderTarget.renderTarget.colorTexture.source,a=yt.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);e.renderTarget.push(a,!0),e.globalUniforms.push({offset:n,worldColor:4294967295});let u=i.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:i,maskedContainer:t.maskedContainer,filterTexture:a})}else i.sprite=t.mask.mask,this._activeMaskStage.push({filterEffect:i,maskedContainer:t.maskedContainer})}else if(t.action==="pushMaskEnd"){let i=this._activeMaskStage[this._activeMaskStage.length-1];s&&(e.type===Tt.WEBGL&&e.renderTarget.finishRenderPass(),e.renderTarget.pop(),e.globalUniforms.pop()),e.filter.push({renderPipeId:"filter",action:"pushFilter",container:i.maskedContainer,filterEffect:i.filterEffect,canBundle:!1})}else if(t.action==="popMaskEnd"){e.filter.pop();let i=this._activeMaskStage.pop();s&&yt.returnTexture(i.filterTexture),Ct.return(i.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}};oi.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"alphaMask"}});var no,i_=x(()=>{"use strict";C();no=class{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,s){this._renderer.renderPipes.batch.break(s);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&t.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,s.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1})),this._colorStackIndex++}pop(t,e,s){this._renderer.renderPipes.batch.break(s);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,s.add({renderPipeId:"colorMask",colorMask:o,canBundle:!1}))}execute(t){this._renderer.colorMask.setMask(t.colorMask)}destroy(){this._renderer=null,this._colorStack=null}};no.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"colorMask"}});var oo,n_=x(()=>{"use strict";C();Ui();ni();oo=class{constructor(t){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=t}push(t,e,s){var i;let n=t,o=this._renderer;o.renderPipes.batch.break(s),o.renderPipes.blendMode.setBlendMode(n.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});let a=n.mask;a.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=s.instructionSize,a.collectRenderables(s,o,null),a.includeInBuild=!1,o.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});let l=s.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(i=this._maskStackHash)[c]??(i[c]=0)}pop(t,e,s){let i=t,n=this._renderer;n.renderPipes.batch.break(s),n.renderPipes.blendMode.setBlendMode(i.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:e._maskOptions.inverse,canBundle:!1});let o=this._maskHash.get(t);for(let a=0;a<o.instructionsLength;a++)s.instructions[s.instructionSize++]=s.instructions[o.instructionsStart++];s.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(t){var e;let s=this._renderer,i=s,n=s.renderTarget.renderTarget.uid,o=(e=this._maskStackHash)[n]??(e[n]=0);t.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(Dt.RENDERING_MASK_ADD,o),o++,i.colorMask.setMask(0)):t.action==="pushMaskEnd"?(t.inverse?i.stencil.setStencilMode(Dt.INVERSE_MASK_ACTIVE,o):i.stencil.setStencilMode(Dt.MASK_ACTIVE,o),i.colorMask.setMask(15)):t.action==="popMaskBegin"?(i.colorMask.setMask(0),o!==0?i.stencil.setStencilMode(Dt.RENDERING_MASK_REMOVE,o):(i.renderTarget.clear(null,ue.STENCIL),i.stencil.setStencilMode(Dt.DISABLED,o)),o--):t.action==="popMaskEnd"&&(t.inverse?i.stencil.setStencilMode(Dt.INVERSE_MASK_ACTIVE,o):i.stencil.setStencilMode(Dt.MASK_ACTIVE,o),i.colorMask.setMask(15)),this._maskStackHash[n]=o}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}};oo.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"stencilMask"}});var o_,a_,u_=x(()=>{"use strict";It();C();pt();o_=class kS{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new X(0),this.color=this._backgroundColor,this.alpha=1}init(t){t={...kS.defaultOptions,...t},this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){X.shared.setValue(t).alpha<1&&this._backgroundColor.alpha===1&&k("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};o_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"background",priority:0};o_.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};a_=o_});var Nu,ai,gd=x(()=>{"use strict";C();$a();Nc();pt();Nu={};O.handle(m.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Nu[r.name]=r.ref},r=>{delete Nu[r.name]});ai=class{constructor(t){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(t,e,s){this._blendModeStack.push(e),this.setBlendMode(t,e,s)}popBlendMode(t){this._blendModeStack.pop();let e=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,e,t)}setBlendMode(t,e,s){let i=t instanceof Vs;if(this._activeBlendMode===e){this._isAdvanced&&t&&!i&&this._renderableList?.push(t);return}this._isAdvanced&&this._endAdvancedBlendMode(s),this._activeBlendMode=e,t&&(this._isAdvanced=!!Nu[e],this._isAdvanced&&this._beginAdvancedBlendMode(t,s))}_beginAdvancedBlendMode(t,e){this._renderer.renderPipes.batch.break(e);let s=this._activeBlendMode;if(!Nu[s]){k(`Unable to assign BlendMode: '${s}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._ensureFilterEffect(s),n=t instanceof Vs,o={renderPipeId:"filter",action:"pushFilter",filterEffect:i,renderables:n?null:[t],container:n?t.root:null,canBundle:!1};this._renderableList=o.renderables,e.add(o)}_ensureFilterEffect(t){let e=this._filterHash[t];return e||(e=this._filterHash[t]=new Ur,e.filters=[new Nu[t]]),e}_endAdvancedBlendMode(t){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(let t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}};ai.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"blendMode"}});var l_,c_,h_,d_=x(()=>{"use strict";mt();C();_e();ht();l_={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},c_=class OS{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof lt||t instanceof D?{target:t,...e}:{...e,...t}}async image(t){let e=N.get().createImage();return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,OS.defaultImageOptions);let{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},l_[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(l_[e],s);if(i.convertToBlob!==void 0){let n=await i.convertToBlob({type:l_[e],quality:s});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);let e=t.target,s=this._renderer;if(e instanceof D)return s.texture.generateCanvas(e);let i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(!0),n}pixels(t){t=this._normalizeOptions(t);let e=t.target,s=this._renderer,i=e instanceof D?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof lt&&i.destroy(!0),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof D?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){t=this._normalizeOptions(t);let e=this.canvas(t),s=document.createElement("a");s.download=t.filename??"image.png",s.href=e.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){let e=t.width??200;t=this._normalizeOptions(t);let s=this.canvas(t),i=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);let n=["font-size: 1px;",`padding: ${e}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};c_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"extract"};c_.defaultImageOptions={format:"png",quality:1};h_=c_});var Hu,f_=x(()=>{"use strict";Wt();ht();Hu=class r extends D{static create(t){let{dynamic:e,textureOptions:s,...i}=t;return new r({...s,source:new st(i),dynamic:e??!1})}resize(t,e,s){return this.source.resize(t,e,s),this}}});var $3,Y3,j3,ao,p_=x(()=>{"use strict";It();C();ot();jt();he();qa();_e();f_();$3=new J,Y3=new _t,j3=[0,0,0,0],ao=class{constructor(t){this._renderer=t}generateTexture(t){t instanceof lt&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});let e=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,i=t.target,n=t.clearColor;n?n=Array.isArray(n)&&n.length===4?n:X.shared.setValue(n).toArray():n=j3;let o=t.frame?.copyTo($3)||gi(i,Y3).rectangle,a=t.defaultAnchor&&{defaultAnchor:t.defaultAnchor};o.width=Math.max(o.width,1/e)|0,o.height=Math.max(o.height,1/e)|0;let u=Hu.create({...t.textureSourceOptions,width:o.width,height:o.height,resolution:e,antialias:s,textureOptions:a}),l=F.shared.translate(-o.x,-o.y);return this._renderer.render({container:i,transform:l,target:u,clearColor:n}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}};ao.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"textureGenerator"}});function m_(r){let t=!1;for(let s in r)if(r[s]==null){t=!0;break}if(!t)return r;let e=Object.create(null);for(let s in r){let i=r[s];i&&(e[s]=i)}return e}function g_(r){let t=0;for(let e=0;e<r.length;e++)r[e]==null?t++:r[e-t]=r[e];return r.length-=t,r}var x_=x(()=>{"use strict"});var __,b_,y_=x(()=>{"use strict";C();x_();__=class LS{constructor(t){this._managedResources=[],this._managedResourceHashes=[],this._managedCollections=[],this._ready=!1,this._renderer=t}init(t){t={...LS.defaultOptions,...t},this.maxUnusedTime=t.gcMaxUnusedTime,this._frequency=t.gcFrequency,this.enabled=t.gcActive,this.now=performance.now()}get enabled(){return!!this._handler}set enabled(t){this.enabled!==t&&(t?(this._handler=this._renderer.scheduler.repeat(()=>{this._ready=!0},this._frequency,!1),this._collectionsHandler=this._renderer.scheduler.repeat(()=>{for(let e of this._managedCollections){let{context:s,collection:i,type:n}=e;n==="hash"?s[i]=m_(s[i]):s[i]=g_(s[i])}},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._collectionsHandler),this._handler=0,this._collectionsHandler=0))}prerender({container:t}){this.now=performance.now(),t.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(t.renderGroup,t.renderGroup.gcTick)}postrender(){!this._ready||!this.enabled||(this.run(),this._ready=!1)}_updateInstructionGCTick(t,e){t.instructionSet.gcTick=e,t.gcTick=e;for(let s of t.renderGroupChildren)this._updateInstructionGCTick(s,e)}addCollection(t,e,s){this._managedCollections.push({context:t,collection:e,type:s})}addResource(t,e){if(t._gcLastUsed!==-1){t._gcLastUsed=this.now,t._onTouch?.(this.now);return}let s=this._managedResources.length;t._gcData={index:s,type:e},t._gcLastUsed=this.now,t._onTouch?.(this.now),t.once("unload",this.removeResource,this),this._managedResources.push(t)}removeResource(t){let e=t._gcData;if(!e)return;let s=e.index,i=this._managedResources.length-1;if(s!==i){let n=this._managedResources[i];this._managedResources[s]=n,n._gcData.index=s}this._managedResources.length--,t._gcData=null,t._gcLastUsed=-1}addResourceHash(t,e,s,i=0){this._managedResourceHashes.push({context:t,hash:e,type:s,priority:i}),this._managedResourceHashes.sort((n,o)=>n.priority-o.priority)}run(){let t=performance.now(),e=this._managedResourceHashes;for(let i of e)this.runOnHash(i,t);let s=0;for(let i=0;i<this._managedResources.length;i++){let n=this._managedResources[i];s=this.runOnResource(n,t,s)}this._managedResources.length=s}updateRenderableGCTick(t,e){let s=t.renderGroup??t.parentRenderGroup,i=s?.instructionSet?.gcTick??-1;(s?.gcTick??0)===i&&(t._gcLastUsed=e,t._onTouch?.(e))}runOnResource(t,e,s){let i=t._gcData;return i.type==="renderable"&&this.updateRenderableGCTick(t,e),e-t._gcLastUsed<this.maxUnusedTime||!t.autoGarbageCollect?(this._managedResources[s]=t,i.index=s,s++):(t.unload(),t._gcData=null,t._gcLastUsed=-1,t.off("unload",this.removeResource,this)),s}_createHashClone(t,e){let s=Object.create(null);for(let i in t){if(i===e)break;t[i]!==null&&(s[i]=t[i])}return s}runOnHash(t,e){let{context:s,hash:i,type:n}=t,o=s[i],a=null,u=0;for(let l in o){let c=o[l];if(c===null){u++,u===1e4&&!a&&(a=this._createHashClone(o,l));continue}if(c._gcLastUsed===-1){c._gcLastUsed=e,c._onTouch?.(e),a&&(a[l]=c);continue}if(n==="renderable"&&this.updateRenderableGCTick(c,e),!(e-c._gcLastUsed<this.maxUnusedTime)&&c.autoGarbageCollect){if(n==="renderable"){let d=c,f=d.renderGroup??d.parentRenderGroup;f&&(f.structureDidChange=!0)}c.unload(),c._gcData=null,c._gcLastUsed=-1,a||(u+1!==1e4?(o[l]=null,u++):a=this._createHashClone(o,l))}else a&&(a[l]=c)}a&&(s[i]=a)}destroy(){this.enabled=!1,this._managedResources.forEach(t=>{t.off("unload",this.removeResource,this)}),this._managedResources.length=0,this._managedResourceHashes.length=0,this._managedCollections.length=0,this._renderer=null}};__.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"gc",priority:0};__.defaultOptions={gcActive:!0,gcMaxUnusedTime:6e4,gcFrequency:3e4};b_=__});function q3(r,t,e,s){e[s++]=(r>>16&255)/255,e[s++]=(r>>8&255)/255,e[s++]=(r&255)/255,e[s++]=t}function Mr(r,t,e){let s=(r>>24&255)/255;t[e++]=(r&255)/255*s,t[e++]=(r>>8&255)/255*s,t[e++]=(r>>16&255)/255*s,t[e++]=s}var Yi=x(()=>{"use strict"});var uo,v_=x(()=>{"use strict";C();ot();Ue();Yi();us();Pe();te();uo=class{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new F,worldColor:4294967295,offset:new nt},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Mr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new oe,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Tt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new dt({uProjectionMatrix:{value:new F,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new F,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}};uo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"globalUniforms"}});var K3,lo,T_=x(()=>{"use strict";C();is();K3=1,lo=class{constructor(){this._tasks=[],this._offset=0}init(){Gt.system.add(this._update,this)}repeat(t,e,s=!0){let i=K3++,n=0;return s&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:t,duration:e,start:performance.now(),offset:n,last:performance.now(),repeat:!0,id:i}),i}cancel(t){for(let e=0;e<this._tasks.length;e++)if(this._tasks[e].id===t){this._tasks.splice(e,1);return}}_update(){let t=performance.now();for(let e=0;e<this._tasks.length;e++){let s=this._tasks[e];if(t-s.offset-s.last>=s.duration){let i=t-s.start;s.func(i),s.last=t}}}destroy(){Gt.system.remove(this._update,this),this._tasks.length=0}};lo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"scheduler",priority:0}});function S_(r){if(!NS){if(N.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let t=[`%c %c %c %c %c PixiJS %c v${Xi} (${r}) http://www.pixijs.com/
|
|
578
578
|
|
|
579
|
-
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${Vi} - ${r} - http://www.pixijs.com/`);OS=!0}}var OS,S_=x(()=>{"use strict";mt();nd();OS=!1});var $i,E_=x(()=>{"use strict";C();S_();Pe();$i=class{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===Tt.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),T_(e)}}};$i.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"hello",priority:-2};$i.defaultOptions={hello:!1}});var C_,A_,w_=x(()=>{"use strict";C();xt();C_=class LS{constructor(t){this._renderer=t}init(t){t={...LS.defaultOptions,...t},this.maxUnusedTime=t.renderableGCMaxUnusedTime}get enabled(){return I("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled}set enabled(t){I("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled=t}addManagedHash(t,e){I("8.15.0","RenderableGCSystem.addManagedHash is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,e,"hash")}addManagedArray(t,e){I("8.15.0","RenderableGCSystem.addManagedArray is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,e,"array")}addRenderable(t){I("8.15.0","RenderableGCSystem.addRenderable is deprecated, please use the GCSystem instead."),this._renderer.gc.addResource(t,"renderable")}run(){I("8.15.0","RenderableGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()}destroy(){this._renderer=null}};C_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderableGC",priority:0};C_.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};A_=C_});var P_,B_,R_=x(()=>{"use strict";C();xt();P_=class xd{get count(){return this._renderer.tick}get checkCount(){return this._checkCount}set checkCount(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=t}get maxIdle(){return this._renderer.gc.maxUnusedTime/1e3*60}set maxIdle(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=t/60*1e3}get checkCountMax(){return Math.floor(this._renderer.gc._frequency/1e3)}set checkCountMax(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.")}get active(){return this._renderer.gc.enabled}set active(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=t}constructor(t){this._renderer=t,this._checkCount=0}init(t){t.textureGCActive!==xd.defaultOptions.textureGCActive&&(this.active=t.textureGCActive),t.textureGCMaxIdle!==xd.defaultOptions.textureGCMaxIdle&&(this.maxIdle=t.textureGCMaxIdle),t.textureGCCheckCountMax!==xd.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=t.textureGCCheckCountMax)}run(){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()}destroy(){this._renderer=null}};P_.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGC"};P_.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};B_=P_});var NS,uo,_d=x(()=>{"use strict";Yt();Wt();ht();NS=class HS{constructor(t={}){if(this.uid=et("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,t={...HS.defaultOptions,...t},this.stencil=t.stencil,this.depth=t.depth,this.isRoot=t.isRoot,typeof t.colorTextures=="number"){this._managedColorTextures=!0;for(let e=0;e<t.colorTextures;e++)this.colorTextures.push(new st({width:t.width,height:t.height,resolution:t.resolution,antialias:t.antialias}))}else{this.colorTextures=[...t.colorTextures.map(s=>s.source)];let e=this.colorTexture.source;this.resize(e.width,e.height,e._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(t.depthStencilTexture||this.stencil)&&(t.depthStencilTexture instanceof D||t.depthStencilTexture instanceof st?this.depthStencilTexture=t.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){let t=this._size;return t[0]=this.pixelWidth,t[1]=this.pixelHeight,t}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(t){this.resize(t.width,t.height,t._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new st({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(t,e,s=this.resolution,i=!1){this.dirtyId++,this.colorTextures.forEach((n,o)=>{i&&o===0||n.source.resize(t,e,s)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(t,e,s)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(t=>{t.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};NS.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};uo=NS});function Hu(r,t){if(!Yi.has(r)){let e=new D({source:new ne({resource:r,...t})}),s=()=>{Yi.get(r)===e&&Yi.delete(r)};e.once("destroy",s),e.source.once("destroy",s),Yi.set(r,e)}return Yi.get(r)}function K3(r){return Yi.has(r)}var Yi,bd=x(()=>{"use strict";Us();js();ht();Yi=new Map;rr.register(Yi)});var M_,D_,F_=x(()=>{"use strict";mt();C();jt();xt();_d();bd();M_=class WS{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(t){this.texture.source.autoDensity=t}get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t={...WS.defaultOptions,...t},t.view&&(I(V,"ViewSystem.view has been renamed to ViewSystem.canvas"),t.canvas=t.view),this.screen=new J(0,0,t.width,t.height),this.canvas=t.canvas||N.get().createCanvas(),this.antialias=!!t.antialias,this.texture=Hu(this.canvas,t),this.renderTarget=new uo({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.resolution=t.resolution}resize(t,e,s){this.texture.source.resize(t,e,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(t=!1){(typeof t=="boolean"?t:t?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};M_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"view",priority:0};M_.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};D_=M_});var ji,Wu,Vu=x(()=>{"use strict";Jh();ed();Nx();id();od();fd();md();s_();i_();a_();gd();h_();f_();b_();y_();v_();E_();w_();R_();F_();ji=[o_,oo,$i,D_,jn,__,B_,no,c_,Kn,A_,ao],Wu=[oi,ro,si,ri,ni,io,so,ei]});var lo,G_=x(()=>{"use strict";C();lo=class{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,s){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,s)}_createBindGroup(t,e,s){let i=this._gpu.device,n=e.layout[s],o=[],a=this._renderer;for(let c in n){let h=t.resources[c]??t.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let f=h;a.ubo.updateUniformGroup(f);let p=f.buffer;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size}}else if(h._resourceType==="buffer"){let f=h;d={buffer:a.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(h._resourceType==="bufferResource"){let f=h;d={buffer:a.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size}}else if(h._resourceType==="textureSampler"){let f=h;d=a.texture.getGpuSampler(f)}else if(h._resourceType==="textureSource"){let f=h;d=a.texture.getTextureView(f)}o.push({binding:n[c],resource:d})}let u=a.shader.getProgramData(e).bindGroups[s],l=i.createBindGroup({layout:u,entries:o});return this._hash[t._key]=l,l}destroy(){this._hash=null,this._renderer=null}};lo.extension={type:[m.WebGPUSystem],name:"bindGroup"}});var vt,ye=x(()=>{"use strict";vt=class{constructor(t){this.items=Object.create(null);let{renderer:e,type:s,onUnload:i,priority:n,name:o}=t;this._renderer=e,e.gc.addResourceHash(this,"items",s,n??0),this._onUnload=i,this.name=o}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;let s=t._gpuData[this._renderer.uid];s&&(this._onUnload?.(t,...e),s.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(e=>e&&this.remove(e,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}});var yd,co,U_=x(()=>{"use strict";C();ye();Yt();ud();yd=class{constructor(t){this.gpuBuffer=t}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}},co=class{constructor(t){this._renderer=t,this._managedBuffers=new vt({renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(t){this._gpu=t}getGPUBuffer(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(t)}updateBuffer(t){let e=this.getGPUBuffer(t),s=t.data;return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),e}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(t){t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this)}createGPUBuffer(t){let e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t._resourceId=et("resource"),t.data&&(Zn(t.data.buffer,e.getMappedRange(),t.data.byteOffset,t.data.byteLength),e.unmap()),t._gpuData[this._renderer.uid]=new yd(e),this._managedBuffers.add(t)&&(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this)),e}onBufferChange(t){this._managedBuffers.remove(t),t._updateID=0,this.createGPUBuffer(t)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}};co.extension={type:[m.WebGPUSystem],name:"buffer"}});var ho,I_=x(()=>{"use strict";C();ho=class{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}};ho.extension={type:[m.WebGPUSystem],name:"colorMask"}});var qi,k_=x(()=>{"use strict";mt();C();qi=class{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=(t.gpu?Promise.resolve(t.gpu):this._createDeviceAndAdaptor(t)).then(e=>{this.gpu=e,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){let e=await N.get().getNavigator().gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),i=await e.requestDevice({requiredFeatures:s});return{adapter:e,device:i}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}};qi.extension={type:[m.WebGPUSystem],name:"device"};qi.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1}});var fo,O_=x(()=>{"use strict";C();fo=class{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,s,i){let n=this._renderer.pipeline.getPipeline(t,e,s,i);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;let e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,s){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.gc.now,this._renderer.tick);let i=this._renderer.bindGroup.getBindGroup(e,s,t);this.renderPassEncoder.setBindGroup(t,i)}setGeometry(t,e){let s=this._renderer.pipeline.getBufferNamesToBind(t,e);for(let i in s)this._setVertexBuffer(parseInt(i,10),t.attributes[s[i]].buffer);t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(let s in t.groups){let i=t.groups[s];e||this._syncBindGroup(i),this.setBindGroup(s,i,t.gpuProgram)}}_syncBindGroup(t){for(let e in t.resources){let s=t.resources[e];s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)}}draw(t){let{geometry:e,shader:s,state:i,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,s.gpuProgram,i,n),this.setGeometry(e,s.gpuProgram),this._setShaderBindGroups(s,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(o||e.indexBuffer.data.length,u??e.instanceCount,a||0):this.renderPassEncoder.draw(o||e.getSize(),u??e.instanceCount,a||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){let t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);let e=this._boundPipeline,s={...this._boundVertexBuffer},i=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(e);for(let a in s)this._setVertexBuffer(a,s[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(i)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(t){this._gpu=t}};fo.extension={type:[m.WebGPUSystem],name:"encoder",priority:1}});var po,L_=x(()=>{"use strict";C();po=class{constructor(t){this._renderer=t}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}};po.extension={type:[m.WebGPUSystem],name:"limits"}});var mo,N_=x(()=>{"use strict";C();ii();mo=class{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:Dt.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){let s=this._renderTargetStencilState[this._activeRenderTarget.uid];s.stencilMode=t,s.stencilReference=e;let i=this._renderer;i.pipeline.setStencilMode(t),i.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}};mo.extension={type:[m.WebGPUSystem],name:"stencil"}});var Ki,vd=x(()=>{"use strict";Oh();cs();Hr();Ki=class{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!Tu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){let e=this.getUniformGroupData(t);t.buffer||(t.buffer=new zt({data:new Float32Array(e.layout.size/4),usage:ct.UNIFORM|ct.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){let e=t._signature,s=this._syncFunctionHash[e];if(!s){let i=Object.keys(t.uniformStructures).map(a=>t.uniformStructures[a]),n=this._adaptor.createUboElements(i),o=this._generateUboSync(n.uboElements);s=this._syncFunctionHash[e]={layout:n,syncFunction:o}}return this._syncFunctionHash[e]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,e,s){let i=this.getUniformGroupData(t);t.buffer||(t.buffer=new zt({data:new Float32Array(i.layout.size/4),usage:ct.UNIFORM|ct.COPY_DST}));let n=null;return e||(e=t.buffer.data,n=t.buffer.dataInt32),s||(s=0),i.syncFunction(t.uniforms,e,n,s),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;let e=this.syncUniformGroup(t);return t.buffer.update(),e}destroy(){this._syncFunctionHash=null}}});function H_(r){let t=r.map(s=>({data:s,offset:0,size:0})),e=0;for(let s=0;s<t.length;s++){let i=t[s],n=go[i.data.type].size,o=go[i.data.type].align;if(!go[i.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${i.data.type}`);i.data.size>1&&(n=Math.max(n,o)*i.data.size),e=Math.ceil(e/o)*o,i.size=n,i.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}var go,Td=x(()=>{"use strict";go={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}}});var Vr,Sd=x(()=>{"use strict";Vr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
579
|
+
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${Xi} - ${r} - http://www.pixijs.com/`);NS=!0}}var NS,E_=x(()=>{"use strict";mt();nd();NS=!1});var ji,C_=x(()=>{"use strict";C();E_();Pe();ji=class{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===Tt.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),S_(e)}}};ji.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"hello",priority:-2};ji.defaultOptions={hello:!1}});var A_,w_,P_=x(()=>{"use strict";C();xt();A_=class HS{constructor(t){this._renderer=t}init(t){t={...HS.defaultOptions,...t},this.maxUnusedTime=t.renderableGCMaxUnusedTime}get enabled(){return I("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled}set enabled(t){I("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled=t}addManagedHash(t,e){I("8.15.0","RenderableGCSystem.addManagedHash is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,e,"hash")}addManagedArray(t,e){I("8.15.0","RenderableGCSystem.addManagedArray is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,e,"array")}addRenderable(t){I("8.15.0","RenderableGCSystem.addRenderable is deprecated, please use the GCSystem instead."),this._renderer.gc.addResource(t,"renderable")}run(){I("8.15.0","RenderableGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()}destroy(){this._renderer=null}};A_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderableGC",priority:0};A_.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};w_=A_});var B_,R_,M_=x(()=>{"use strict";C();xt();B_=class xd{get count(){return this._renderer.tick}get checkCount(){return this._checkCount}set checkCount(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=t}get maxIdle(){return this._renderer.gc.maxUnusedTime/1e3*60}set maxIdle(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=t/60*1e3}get checkCountMax(){return Math.floor(this._renderer.gc._frequency/1e3)}set checkCountMax(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.")}get active(){return this._renderer.gc.enabled}set active(t){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=t}constructor(t){this._renderer=t,this._checkCount=0}init(t){t.textureGCActive!==xd.defaultOptions.textureGCActive&&(this.active=t.textureGCActive),t.textureGCMaxIdle!==xd.defaultOptions.textureGCMaxIdle&&(this.maxIdle=t.textureGCMaxIdle),t.textureGCCheckCountMax!==xd.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=t.textureGCCheckCountMax)}run(){I("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()}destroy(){this._renderer=null}};B_.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGC"};B_.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};R_=B_});var WS,co,_d=x(()=>{"use strict";Yt();Wt();ht();WS=class VS{constructor(t={}){if(this.uid=et("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,t={...VS.defaultOptions,...t},this.stencil=t.stencil,this.depth=t.depth,this.isRoot=t.isRoot,typeof t.colorTextures=="number"){this._managedColorTextures=!0;for(let e=0;e<t.colorTextures;e++)this.colorTextures.push(new st({width:t.width,height:t.height,resolution:t.resolution,antialias:t.antialias}))}else{this.colorTextures=[...t.colorTextures.map(s=>s.source)];let e=this.colorTexture.source;this.resize(e.width,e.height,e._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(t.depthStencilTexture||this.stencil)&&(t.depthStencilTexture instanceof D||t.depthStencilTexture instanceof st?this.depthStencilTexture=t.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){let t=this._size;return t[0]=this.pixelWidth,t[1]=this.pixelHeight,t}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(t){this.resize(t.width,t.height,t._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new st({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(t,e,s=this.resolution,i=!1){this.dirtyId++,this.colorTextures.forEach((n,o)=>{i&&o===0||n.source.resize(t,e,s)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(t,e,s)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(t=>{t.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};WS.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};co=WS});function Wu(r,t){if(!qi.has(r)){let e=new D({source:new ne({resource:r,...t})}),s=()=>{qi.get(r)===e&&qi.delete(r)};e.once("destroy",s),e.source.once("destroy",s),qi.set(r,e)}return qi.get(r)}function Z3(r){return qi.has(r)}var qi,bd=x(()=>{"use strict";Is();qs();ht();qi=new Map;rr.register(qi)});var D_,F_,G_=x(()=>{"use strict";mt();C();jt();xt();_d();bd();D_=class zS{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(t){this.texture.source.autoDensity=t}get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t={...zS.defaultOptions,...t},t.view&&(I(V,"ViewSystem.view has been renamed to ViewSystem.canvas"),t.canvas=t.view),this.screen=new J(0,0,t.width,t.height),this.canvas=t.canvas||N.get().createCanvas(),this.antialias=!!t.antialias,this.texture=Wu(this.canvas,t),this.renderTarget=new co({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.resolution=t.resolution}resize(t,e,s){this.texture.source.resize(t,e,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(t=!1){(typeof t=="boolean"?t:t?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};D_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"view",priority:0};D_.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};F_=D_});var Ki,Vu,zu=x(()=>{"use strict";Jh();ed();Hx();id();od();fd();md();i_();n_();u_();gd();d_();p_();y_();v_();T_();C_();P_();M_();G_();Ki=[a_,uo,ji,F_,Kn,b_,R_,ao,h_,Qn,w_,lo],Vu=[ai,io,ii,si,oi,oo,no,ri]});var ho,U_=x(()=>{"use strict";C();ho=class{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,s){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,s)}_createBindGroup(t,e,s){let i=this._gpu.device,n=e.layout[s],o=[],a=this._renderer;for(let c in n){let h=t.resources[c]??t.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let f=h;a.ubo.updateUniformGroup(f);let p=f.buffer;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size}}else if(h._resourceType==="buffer"){let f=h;d={buffer:a.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(h._resourceType==="bufferResource"){let f=h;d={buffer:a.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size}}else if(h._resourceType==="textureSampler"){let f=h;d=a.texture.getGpuSampler(f)}else if(h._resourceType==="textureSource"){let f=h;d=a.texture.getTextureView(f)}o.push({binding:n[c],resource:d})}let u=a.shader.getProgramData(e).bindGroups[s],l=i.createBindGroup({layout:u,entries:o});return this._hash[t._key]=l,l}destroy(){this._hash=null,this._renderer=null}};ho.extension={type:[m.WebGPUSystem],name:"bindGroup"}});var vt,ye=x(()=>{"use strict";vt=class{constructor(t){this.items=Object.create(null);let{renderer:e,type:s,onUnload:i,priority:n,name:o}=t;this._renderer=e,e.gc.addResourceHash(this,"items",s,n??0),this._onUnload=i,this.name=o}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;let s=t._gpuData[this._renderer.uid];s&&(this._onUnload?.(t,...e),s.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(e=>e&&this.remove(e,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}});var yd,fo,I_=x(()=>{"use strict";C();ye();Yt();ud();yd=class{constructor(t){this.gpuBuffer=t}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}},fo=class{constructor(t){this._renderer=t,this._managedBuffers=new vt({renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(t){this._gpu=t}getGPUBuffer(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(t)}updateBuffer(t){let e=this.getGPUBuffer(t),s=t.data;return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),e}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(t){t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this)}createGPUBuffer(t){let e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t._resourceId=et("resource"),t.data&&(Jn(t.data.buffer,e.getMappedRange(),t.data.byteOffset,t.data.byteLength),e.unmap()),t._gpuData[this._renderer.uid]=new yd(e),this._managedBuffers.add(t)&&(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this)),e}onBufferChange(t){this._managedBuffers.remove(t),t._updateID=0,this.createGPUBuffer(t)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}};fo.extension={type:[m.WebGPUSystem],name:"buffer"}});var po,k_=x(()=>{"use strict";C();po=class{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}};po.extension={type:[m.WebGPUSystem],name:"colorMask"}});var Zi,O_=x(()=>{"use strict";mt();C();Zi=class{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=(t.gpu?Promise.resolve(t.gpu):this._createDeviceAndAdaptor(t)).then(e=>{this.gpu=e,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){let e=await N.get().getNavigator().gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),i=await e.requestDevice({requiredFeatures:s});return{adapter:e,device:i}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}};Zi.extension={type:[m.WebGPUSystem],name:"device"};Zi.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1}});var mo,L_=x(()=>{"use strict";C();mo=class{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,s,i){let n=this._renderer.pipeline.getPipeline(t,e,s,i);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;let e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,s){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.gc.now,this._renderer.tick);let i=this._renderer.bindGroup.getBindGroup(e,s,t);this.renderPassEncoder.setBindGroup(t,i)}setGeometry(t,e){let s=this._renderer.pipeline.getBufferNamesToBind(t,e);for(let i in s)this._setVertexBuffer(parseInt(i,10),t.attributes[s[i]].buffer);t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(let s in t.groups){let i=t.groups[s];e||this._syncBindGroup(i),this.setBindGroup(s,i,t.gpuProgram)}}_syncBindGroup(t){for(let e in t.resources){let s=t.resources[e];s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)}}draw(t){let{geometry:e,shader:s,state:i,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,s.gpuProgram,i,n),this.setGeometry(e,s.gpuProgram),this._setShaderBindGroups(s,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(o||e.indexBuffer.data.length,u??e.instanceCount,a||0):this.renderPassEncoder.draw(o||e.getSize(),u??e.instanceCount,a||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){let t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);let e=this._boundPipeline,s={...this._boundVertexBuffer},i=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(e);for(let a in s)this._setVertexBuffer(a,s[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(i)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(t){this._gpu=t}};mo.extension={type:[m.WebGPUSystem],name:"encoder",priority:1}});var go,N_=x(()=>{"use strict";C();go=class{constructor(t){this._renderer=t}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}};go.extension={type:[m.WebGPUSystem],name:"limits"}});var xo,H_=x(()=>{"use strict";C();ni();xo=class{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:Dt.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){let s=this._renderTargetStencilState[this._activeRenderTarget.uid];s.stencilMode=t,s.stencilReference=e;let i=this._renderer;i.pipeline.setStencilMode(t),i.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}};xo.extension={type:[m.WebGPUSystem],name:"stencil"}});var Qi,vd=x(()=>{"use strict";Oh();cs();Hr();Qi=class{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!Su())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){let e=this.getUniformGroupData(t);t.buffer||(t.buffer=new zt({data:new Float32Array(e.layout.size/4),usage:ct.UNIFORM|ct.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){let e=t._signature,s=this._syncFunctionHash[e];if(!s){let i=Object.keys(t.uniformStructures).map(a=>t.uniformStructures[a]),n=this._adaptor.createUboElements(i),o=this._generateUboSync(n.uboElements);s=this._syncFunctionHash[e]={layout:n,syncFunction:o}}return this._syncFunctionHash[e]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,e,s){let i=this.getUniformGroupData(t);t.buffer||(t.buffer=new zt({data:new Float32Array(i.layout.size/4),usage:ct.UNIFORM|ct.COPY_DST}));let n=null;return e||(e=t.buffer.data,n=t.buffer.dataInt32),s||(s=0),i.syncFunction(t.uniforms,e,n,s),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;let e=this.syncUniformGroup(t);return t.buffer.update(),e}destroy(){this._syncFunctionHash=null}}});function W_(r){let t=r.map(s=>({data:s,offset:0,size:0})),e=0;for(let s=0;s<t.length;s++){let i=t[s],n=_o[i.data.type].size,o=_o[i.data.type].align;if(!_o[i.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${i.data.type}`);i.data.size>1&&(n=Math.max(n,o)*i.data.size),e=Math.ceil(e/o)*o,i.size=n,i.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}var _o,Td=x(()=>{"use strict";_o={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}}});var Vr,Sd=x(()=>{"use strict";Vr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
580
580
|
var matrix = uv[name].toArray(true);
|
|
581
581
|
data[offset] = matrix[0];
|
|
582
582
|
data[offset + 1] = matrix[1];
|
|
@@ -647,7 +647,7 @@ fn mainFragment(
|
|
|
647
647
|
cv[2] = v.blue;
|
|
648
648
|
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
|
649
649
|
}
|
|
650
|
-
`}]});function
|
|
650
|
+
`}]});function Xu(r,t,e,s){let i=[`
|
|
651
651
|
var v = null;
|
|
652
652
|
var v2 = null;
|
|
653
653
|
var t = 0;
|
|
@@ -659,11 +659,11 @@ fn mainFragment(
|
|
|
659
659
|
offset += ${h-n};
|
|
660
660
|
${d};
|
|
661
661
|
`)}n=h}let o=i.join(`
|
|
662
|
-
`);return new Function("uv","data","dataInt32","offset",o)}var Ed=x(()=>{"use strict";Sd()});function
|
|
662
|
+
`);return new Function("uv","data","dataInt32","offset",o)}var Ed=x(()=>{"use strict";Sd()});function bo(r,t){return`
|
|
663
663
|
for (let i = 0; i < ${r*t}; i++) {
|
|
664
664
|
data[offset + (((i / ${r})|0) * 4) + (i % ${r})] = v[i];
|
|
665
665
|
}
|
|
666
|
-
`}var Cd,
|
|
666
|
+
`}var Cd,V_,Ad=x(()=>{"use strict";Cd={f32:`
|
|
667
667
|
data[offset] = v;`,i32:`
|
|
668
668
|
dataInt32[offset] = v;`,"vec2<f32>":`
|
|
669
669
|
data[offset] = v[0];
|
|
@@ -699,12 +699,12 @@ fn mainFragment(
|
|
|
699
699
|
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
|
700
700
|
for (let i = 0; i < 16; i++) {
|
|
701
701
|
data[offset + i] = v[i];
|
|
702
|
-
}`,"mat3x2<f32>":
|
|
702
|
+
}`,"mat3x2<f32>":bo(3,2),"mat4x2<f32>":bo(4,2),"mat2x3<f32>":bo(2,3),"mat4x3<f32>":bo(4,3),"mat2x4<f32>":bo(2,4),"mat3x4<f32>":bo(3,4)},V_={...Cd,"mat2x2<f32>":`
|
|
703
703
|
data[offset] = v[0];
|
|
704
704
|
data[offset + 1] = v[1];
|
|
705
705
|
data[offset + 2] = v[2];
|
|
706
706
|
data[offset + 3] = v[3];
|
|
707
|
-
`}});function
|
|
707
|
+
`}});function z_(r,t){let{size:e,align:s}=_o[r.data.type],i=(s-e)/4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
708
708
|
v = uv.${r.data.name};
|
|
709
709
|
${t!==0?`offset += ${t};`:""}
|
|
710
710
|
|
|
@@ -720,7 +720,7 @@ fn mainFragment(
|
|
|
720
720
|
}
|
|
721
721
|
${i!==0?`arrayOffset += ${i};`:""}
|
|
722
722
|
}
|
|
723
|
-
`}var z_=x(()=>{"use strict";Td()});function X_(r){return zu(r,"uboWgsl",V_,W_)}var $_=x(()=>{"use strict";Ed();Ad();z_()});var _o,Y_=x(()=>{"use strict";C();vd();Td();$_();_o=class extends Ki{constructor(){super({createUboElements:H_,generateUboSync:X_})}};_o.extension={type:[m.WebGPUSystem],name:"ubo"}});var ms,Xu=x(()=>{"use strict";le();Yt();ms=class extends St{constructor({buffer:t,offset:e,size:s}){super(),this.uid=et("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=et("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=e|0,this.size=s,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=et("resource"),this.emit("change",this)}destroy(t=!1){this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()}}});var $u,j_=x(()=>{"use strict";$u=class{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);let e=this.byteIndex,s=e+t*4;if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=s,e}addGroup(t){let e=this.addEmptyGroup(t.length);for(let s=0;s<t.length;s++)this.data[e/4+s]=t[s];return e}destroy(){this.data=null}}});var ai,bo,q_=x(()=>{"use strict";C();cs();Xu();Hr();j_();us();ai=128,bo=class{constructor(t){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=t,this._batchBuffer=new $u({minUniformOffsetAlignment:ai});let e=256/ai;for(let s=0;s<e;s++){let i=ct.UNIFORM|ct.COPY_DST;s===0&&(i|=ct.COPY_SRC),this._buffers.push(new zt({data:this._batchBuffer.data,usage:i}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){this._bindGroupHash=Object.create(null),this._batchBuffer.clear()}getUniformBindGroup(t,e){if(!e&&this._bindGroupHash[t.uid])return this._bindGroupHash[t.uid];this._renderer.ubo.ensureUniformGroup(t);let s=t.buffer.data,i=this._batchBuffer.addEmptyGroup(s.length);return this._renderer.ubo.syncUniformGroup(t,this._batchBuffer.data,i/4),this._bindGroupHash[t.uid]=this._getBindGroup(i/ai),this._bindGroupHash[t.uid]}getUboResource(t){this._renderer.ubo.updateUniformGroup(t);let e=t.buffer.data,s=this._batchBuffer.addGroup(e);return this._getBufferResource(s/ai)}getArrayBindGroup(t){let e=this._batchBuffer.addGroup(t);return this._getBindGroup(e/ai)}getArrayBufferResource(t){let s=this._batchBuffer.addGroup(t)/ai;return this._getBufferResource(s)}_getBufferResource(t){if(!this._bufferResources[t]){let e=this._buffers[t%2];this._bufferResources[t]=new ms({buffer:e,offset:(t/2|0)*256,size:ai})}return this._bufferResources[t]}_getBindGroup(t){if(!this._bindGroups[t]){let e=new oe({0:this._getBufferResource(t)});this._bindGroups[t]=e}return this._bindGroups[t]}_uploadBindGroups(){let t=this._renderer.buffer,e=this._buffers[0];e.update(this._batchBuffer.byteIndex),t.updateBuffer(e);let s=this._renderer.gpu.device.createCommandEncoder();for(let i=1;i<this._buffers.length;i++){let n=this._buffers[i];s.copyBufferToBuffer(t.getGPUBuffer(e),ai,t.getGPUBuffer(n),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([s.finish()])}destroy(){for(let t=0;t<this._bindGroups.length;t++)this._bindGroups[t]?.destroy();this._bindGroups=null,this._bindGroupHash=null;for(let t=0;t<this._buffers.length;t++)this._buffers[t].destroy();this._buffers=null;for(let t=0;t<this._bufferResources.length;t++)this._bufferResources[t].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._renderer=null}};bo.extension={type:[m.WebGPUPipes],name:"uniformBatch"}});function Yu(r,t){for(let e in r.attributes){let s=r.attributes[e],i=t[e];i?(s.format??(s.format=i.format),s.offset??(s.offset=i.offset),s.instance??(s.instance=i.instance)):k(`Attribute ${e} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}Z3(r)}function Z3(r){let{buffers:t,attributes:e}=r,s={},i={};for(let n in t){let o=t[n];s[o.uid]=0,i[o.uid]=0}for(let n in e){let o=e[n];s[o.buffer.uid]+=Le(o.format).stride}for(let n in e){let o=e[n];o.stride??(o.stride=s[o.buffer.uid]),o.start??(o.start=i[o.buffer.uid]),i[o.buffer.uid]+=Le(o.format).stride}}var wd=x(()=>{"use strict";pt();Zs()});var Dr,Pd=x(()=>{"use strict";ii();Dr=[];Dr[Dt.NONE]=void 0;Dr[Dt.DISABLED]={stencilWriteMask:0,stencilReadMask:0};Dr[Dt.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};Dr[Dt.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};Dr[Dt.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Dr[Dt.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}}});function J3(r,t,e,s,i){return r<<24|t<<16|e<<10|s<<5|i}function tP(r,t,e,s,i){return e<<8|r<<5|s<<3|i<<1|t}var Q3,yo,K_=x(()=>{"use strict";C();pt();wd();ii();kn();Pd();Q3={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};yo=class{constructor(t){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._colorTargetCount=1,this._renderer=t}contextChange(t){this._gpu=t,this.setStencilMode(Dt.DISABLED),this._updatePipeHash()}setMultisampleCount(t){this._multisampleCount!==t&&(this._multisampleCount=t,this._updatePipeHash())}setRenderTarget(t){this._multisampleCount=t.msaaSamples,this._depthStencilAttachment=t.descriptor.depthStencilAttachment?1:0,this._colorTargetCount=t.colorTargetCount,this._updatePipeHash()}setColorMask(t){this._colorMask!==t&&(this._colorMask=t,this._updatePipeHash())}setStencilMode(t){this._stencilMode!==t&&(this._stencilMode=t,this._stencilState=Dr[t],this._updatePipeHash())}setPipeline(t,e,s,i){let n=this.getPipeline(t,e,s);i.setPipeline(n)}getPipeline(t,e,s,i){t._layoutKey||(Yu(t,e.attributeData),this._generateBufferKey(t)),i||(i=t.topology);let n=J3(t._layoutKey,e._layoutKey,s.data,s._blendModeId,Q3[i]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(t,e,s,i),this._pipeCache[n])}_createPipeline(t,e,s,i){let n=this._gpu.device,o=this._createVertexBufferLayouts(t,e),a=this._renderer.state.getColorTargets(s,this._colorTargetCount),u=this._stencilMode===Dt.RENDERING_MASK_ADD?0:this._colorMask;for(let d=0;d<a.length;d++)a[d].writeMask=u;let l=this._renderer.shader.getProgramData(e).pipeline,c={vertex:{module:this._getModule(e.vertex.source),entryPoint:e.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(e.fragment.source),entryPoint:e.fragment.entryPoint,targets:a},primitive:{topology:i,cullMode:s.cullMode},layout:l,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:s.depthTest,depthCompare:s.depthTest?"less":"always"}),n.createRenderPipeline(c)}_getModule(t){return this._moduleCache[t]||this._createModule(t)}_createModule(t){let e=this._gpu.device;return this._moduleCache[t]=e.createShaderModule({code:t}),this._moduleCache[t]}_generateBufferKey(t){let e=[],s=0,i=Object.keys(t.attributes).sort();for(let o=0;o<i.length;o++){let a=t.attributes[i[o]];e[s++]=a.offset,e[s++]=a.format,e[s++]=a.stride,e[s++]=a.instance}let n=e.join("|");return t._layoutKey=Nr(n,"geometry"),t._layoutKey}_generateAttributeLocationsKey(t){let e=[],s=0,i=Object.keys(t.attributeData).sort();for(let o=0;o<i.length;o++){let a=t.attributeData[i[o]];e[s++]=a.location}let n=e.join("|");return t._attributeLocationsKey=Nr(n,"programAttributes"),t._attributeLocationsKey}getBufferNamesToBind(t,e){let s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bindingNamesCache[s])return this._bindingNamesCache[s];let i=this._createVertexBufferLayouts(t,e),n=Object.create(null),o=e.attributeData;for(let a=0;a<i.length;a++){let l=Object.values(i[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[s]=n,n}_createVertexBufferLayouts(t,e){e._attributeLocationsKey||this._generateAttributeLocationsKey(e);let s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bufferLayoutsCache[s])return this._bufferLayoutsCache[s];let i=[];return t.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in e.attributeData){let l=t.attributes[u];(l.divisor??1)!==1&&k(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:e.attributeData[u].location,offset:l.offset,format:l.format}))}a.length&&i.push(o)}),this._bufferLayoutsCache[s]=i,i}_updatePipeHash(){let t=tP(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount);this._pipeStateCaches[t]||(this._pipeStateCaches[t]=Object.create(null)),this._pipeCache=this._pipeStateCaches[t]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}};yo.extension={type:[m.WebGPUSystem],name:"pipeline"}});function Z_(r,t,e,s,i,n){let o=n?1:-1;return r.identity(),r.a=1/s*2,r.d=o*(1/i*2),r.tx=-1-t*r.a,r.ty=-o-e*r.d,r}var Q_=x(()=>{"use strict"});function J_(r){let t=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement&&document.body.contains(t)}var tb=x(()=>{"use strict"});var gs,ju=x(()=>{"use strict";ot();jt();Fi();Q_();zh();js();Wt();ht();bd();tb();_d();gs=class{constructor(t){this.rootViewPort=new J,this.viewport=new J,this.mipLevel=0,this.layer=0,this.onRenderTargetChange=new Gi("onRenderTargetChange"),this.projectionMatrix=new F,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=t,t.gc.addCollection(this,"_gpuRenderTargetHash","hash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:t,clear:e,clearColor:s,frame:i,mipLevel:n,layer:o}){this._renderTargetStack.length=0,this.push(t,e,s,i,n??0,o??0),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=J_(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(t,e=!0,s,i,n=0,o=0){let a=this.getRenderTarget(t),u=this.renderTarget!==a;this.renderTarget=a,this.renderSurface=t;let l=this.getGpuRenderTarget(a);(a.pixelWidth!==l.width||a.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(a),l.width=a.pixelWidth,l.height=a.pixelHeight);let c=a.colorTexture,h=this.viewport,d=c.arrayLayerCount||1;if((o|0)!==o&&(o|=0),o<0||o>=d)throw new Error(`[RenderTargetSystem] layer ${o} is out of bounds (arrayLayerCount=${d}).`);this.mipLevel=n|0,this.layer=o|0;let f=Math.max(c.pixelWidth>>n,1),p=Math.max(c.pixelHeight>>n,1);if(!i&&t instanceof D&&(i=t.frame),i){let g=c._resolution,_=1<<Math.max(n|0,0),b=i.x*g+.5|0,y=i.y*g+.5|0,v=i.width*g+.5|0,T=i.height*g+.5|0,S=Math.floor(b/_),E=Math.floor(y/_),w=Math.ceil(v/_),M=Math.ceil(T/_);S=Math.min(Math.max(S,0),f-1),E=Math.min(Math.max(E,0),p-1),w=Math.min(Math.max(w,1),f-S),M=Math.min(Math.max(M,1),p-E),h.x=S,h.y=E,h.width=w,h.height=M}else h.x=0,h.y=0,h.width=f,h.height=p;return Z_(this.projectionMatrix,0,0,h.width/c.resolution,h.height/c.resolution,!a.isRoot),this.adaptor.startRenderPass(a,e,s,h,n,o),u&&this.onRenderTargetChange.emit(a),a}clear(t,e=ue.ALL,s,i=this.mipLevel,n=this.layer){e&&(t&&(t=this.getRenderTarget(t)),this.adaptor.clear(t||this.renderTarget,e,s,this.viewport,i,n))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(t,e=ue.ALL,s,i,n=0,o=0){let a=this.bind(t,e,s,i,n,o);return this._renderTargetStack.push({renderTarget:a,frame:i,mipLevel:n,layer:o}),a}pop(){this._renderTargetStack.pop();let t=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(t.renderTarget,!1,null,t.frame,t.mipLevel,t.layer)}getRenderTarget(t){return t.isTexture&&(t=t.source),this._renderSurfaceToRenderTargetHash.get(t)??this._initRenderTarget(t)}copyToTexture(t,e,s,i,n){s.x<0&&(i.width+=s.x,n.x-=s.x,s.x=0),s.y<0&&(i.height+=s.y,n.y-=s.y,s.y=0);let{pixelWidth:o,pixelHeight:a}=t;return i.width=Math.min(i.width,o-s.x),i.height=Math.min(i.height,a-s.y),this.adaptor.copyToTexture(t,e,s,i,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport,0,this.layer))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((t,e)=>{t!==e&&t.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(t){let e=null;return ne.test(t)&&(t=Hu(t).source),t instanceof uo?e=t:t instanceof st&&(e=new uo({colorTextures:[t]}),t.source instanceof ne&&(e.isRoot=!0),t.once("destroy",()=>{e.destroy(),this._renderSurfaceToRenderTargetHash.delete(t);let s=this._gpuRenderTargetHash[e.uid];s&&(this._gpuRenderTargetHash[e.uid]=null,this.adaptor.destroyGpuRenderTarget(s))})),this._renderSurfaceToRenderTargetHash.set(t,e),e}getGpuRenderTarget(t){return this._gpuRenderTargetHash[t.uid]||(this._gpuRenderTargetHash[t.uid]=this.adaptor.initGpuRenderTarget(t))}resetState(){this.renderTarget=null,this.renderSurface=null}}});var qu,eb=x(()=>{"use strict";qu=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}});var Ku,rb=x(()=>{"use strict";Fi();js();Wt();eb();Ku=class{init(t,e){this._renderer=t,this._renderTargetSystem=e}copyToTexture(t,e,s,i,n){let o=this._renderer,a=this._getGpuColorTexture(t),u=o.texture.getGpuSource(e.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:s},{texture:u,origin:n},i),e}startRenderPass(t,e=!0,s,i,n=0,o=0){let u=this._renderTargetSystem.getGpuRenderTarget(t);if(o!==0&&u.msaaTextures?.length)throw new Error("[RenderTargetSystem] Rendering to array layers is not supported with MSAA render targets.");if(n>0&&u.msaaTextures?.length)throw new Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.");let l=this.getDescriptor(t,e,s,n,o);u.descriptor=l,this._renderer.pipeline.setRenderTarget(u),this._renderer.encoder.beginRenderPass(u),this._renderer.encoder.setViewport(i)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);return e.contexts[0]?e.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(t.colorTextures[0].source)}getDescriptor(t,e,s,i=0,n=0){typeof e=="boolean"&&(e=e?ue.ALL:ue.NONE);let o=this._renderTargetSystem,a=o.getGpuRenderTarget(t),u=t.colorTextures.map((h,d)=>{let f=a.contexts[d],p,g;if(f){if(n!==0)throw new Error("[RenderTargetSystem] Rendering to array layers is not supported for canvas targets.");p=f.getCurrentTexture().createView()}else p=this._renderer.texture.getGpuSource(h).createView({dimension:"2d",baseMipLevel:i,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1});let _=!1;a.msaaTextures[d]&&(g=p,p=this._renderer.texture.getTextureView(a.msaaTextures[d]),_=a.msaaTextures[d].transient);let b=e&ue.COLOR?"clear":"load";return s??(s=o.defaultClearColor),{view:p,resolveTarget:g,clearValue:s,storeOp:_?"discard":"store",loadOp:b}}),l;if((t.stencil||t.depth)&&!t.depthStencilTexture&&(t.ensureDepthStencilTexture(),t.depthStencilTexture.source.sampleCount=a.msaa?4:1,t.depthStencilTexture.source.transient=!!a.msaaTextures[0]?.transient),t.depthStencilTexture){let h=e&ue.STENCIL?"clear":"load",d=e&ue.DEPTH?"clear":"load",f=t.depthStencilTexture.source.transient?"discard":"store";l={view:this._renderer.texture.getGpuSource(t.depthStencilTexture.source).createView({dimension:"2d",baseMipLevel:i,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1}),stencilStoreOp:f,stencilLoadOp:h,depthClearValue:1,depthLoadOp:d,depthStoreOp:f}}return{colorAttachments:u,depthStencilAttachment:l}}clear(t,e=!0,s,i,n=0,o=0){if(!e)return;let{gpu:a,encoder:u}=this._renderer,l=a.device;if(u.commandEncoder===null){let h=l.createCommandEncoder(),d=this.getDescriptor(t,e,s,n,o),f=h.beginRenderPass(d);f.setViewport(i.x,i.y,i.width,i.height,0,1),f.end();let p=h.finish();l.queue.submit([p])}else this.startRenderPass(t,e,s,i,n,o)}initGpuRenderTarget(t){t.isRoot=!0;let e=new qu;return e.colorTargetCount=t.colorTextures.length,t.colorTextures.forEach((s,i)=>{if(s instanceof ne){let n=s.resource.getContext("webgpu"),o=s.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o})}catch(a){console.error(a)}e.contexts[i]=n}if(e.msaa=s.source.antialias,s.source.antialias){let n=new st({width:0,height:0,sampleCount:4,transient:s.source.transient,arrayLayerCount:s.source.arrayLayerCount});e.msaaTextures[i]=n}}),e.msaa&&(e.msaaSamples=4,t.depthStencilTexture&&(t.depthStencilTexture.source.sampleCount=4,t.depthStencilTexture.source.transient=!!e.msaaTextures[0]?.transient)),e}destroyGpuRenderTarget(t){t.contexts.forEach(e=>{e.unconfigure()}),t.msaaTextures.forEach(e=>{e.destroy()}),t.msaaTextures.length=0,t.contexts.length=0}ensureDepthStencilTexture(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);t.depthStencilTexture&&e.msaa&&(t.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);e.width=t.width,e.height=t.height,e.msaa&&t.colorTextures.forEach((s,i)=>{e.msaaTextures[i]?.resize(s.source.width,s.source.height,s.source._resolution)})}}});var vo,sb=x(()=>{"use strict";C();ju();rb();vo=class extends gs{constructor(t){super(t),this.adaptor=new Ku,this.adaptor.init(t,this)}};vo.extension={type:[m.WebGPUSystem],name:"renderTarget"}});var To,ib=x(()=>{"use strict";C();To=class{constructor(){this._gpuProgramData=Object.create(null)}contextChange(t){this._gpu=t}getProgramData(t){return this._gpuProgramData[t._layoutKey]||this._createGPUProgramData(t)}_createGPUProgramData(t){let e=this._gpu.device,s=t.gpuLayout.map(n=>e.createBindGroupLayout({entries:n})),i={bindGroupLayouts:s};return this._gpuProgramData[t._layoutKey]={bindGroups:s,pipeline:e.createPipelineLayout(i)},this._gpuProgramData[t._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}};To.extension={type:[m.WebGPUSystem],name:"shader"}});var Be,nb=x(()=>{"use strict";Be={};Be.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};Be.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};Be.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};Be.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};Be.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};Be.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};Be["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};Be["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};Be["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};Be.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};Be.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};Be.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}}});var So,ob=x(()=>{"use strict";C();je();nb();So=class{constructor(){this.defaultState=new Ut,this.defaultState.blend=!0}contextChange(t){this.gpu=t}getColorTargets(t,e){let s=Be[t.blendMode]||Be.normal,i=[],n={format:"bgra8unorm",writeMask:0,blend:s};for(let o=0;o<e;o++)i[o]=n;return i}destroy(){this.gpu=null}};So.extension={type:[m.WebGPUSystem],name:"state"}});var ab,ub=x(()=>{"use strict";ab={type:"image",upload(r,t,e,s=0){let i=r.resource,n=(r.pixelWidth|0)*(r.pixelHeight|0),o=i.byteLength/n;e.device.queue.writeTexture({texture:t,origin:{x:0,y:0,z:s}},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelWidth*o},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1})}}});var Bd,eP,lb,cb=x(()=>{"use strict";Bd={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},eP={blockBytes:4,blockWidth:1,blockHeight:1},lb={type:"compressed",upload(r,t,e,s=0){let i=r.pixelWidth,n=r.pixelHeight,o=Bd[r.format]||eP;for(let a=0;a<r.resource.length;a++){let u=r.resource[a],l=Math.ceil(i/o.blockWidth)*o.blockBytes;e.device.queue.writeTexture({texture:t,mipLevel:a,origin:{x:0,y:0,z:s}},u,{offset:0,bytesPerRow:l},{width:Math.ceil(i/o.blockWidth)*o.blockWidth,height:Math.ceil(n/o.blockHeight)*o.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),n=Math.max(n>>1,1)}}}});function hb(r){return{type:"cube",upload(t,e,s){let i=t.faces;for(let n=0;n<VS.length;n++){let o=VS[n],a=i[o];(r[a.uploadMethodId]||r.image).upload(a,e,s,n)}}}}var VS,db=x(()=>{"use strict";VS=["right","left","top","bottom","front","back"]});var Zu,Rd=x(()=>{"use strict";mt();pt();Zu={type:"image",upload(r,t,e,s=0){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let u=N.get().createCanvas(i.width,i.height);u.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=u,k("ImageSource: Image element passed, converting to canvas and replacing resource.")}let n=Math.min(t.width,r.resourceWidth||r.pixelWidth),o=Math.min(t.height,r.resourceHeight||r.pixelHeight),a=r.alphaMode==="premultiply-alpha-on-upload";e.device.queue.copyExternalImageToTexture({source:i},{texture:t,origin:{x:0,y:0,z:s},premultipliedAlpha:a},{width:n,height:o})}}});var fb,pb=x(()=>{"use strict";Rd();fb={type:"video",upload(r,t,e,s){Zu.upload(r,t,e,s)}}});var Qu,mb=x(()=>{"use strict";Qu=class{constructor(t){this.device=t,this.sampler=t.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(t){let e=this.pipelines[t];return e||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
723
|
+
`}var X_=x(()=>{"use strict";Td()});function $_(r){return Xu(r,"uboWgsl",z_,V_)}var Y_=x(()=>{"use strict";Ed();Ad();X_()});var yo,j_=x(()=>{"use strict";C();vd();Td();Y_();yo=class extends Qi{constructor(){super({createUboElements:W_,generateUboSync:$_})}};yo.extension={type:[m.WebGPUSystem],name:"ubo"}});var ms,$u=x(()=>{"use strict";le();Yt();ms=class extends St{constructor({buffer:t,offset:e,size:s}){super(),this.uid=et("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=et("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=e|0,this.size=s,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=et("resource"),this.emit("change",this)}destroy(t=!1){this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()}}});var Yu,q_=x(()=>{"use strict";Yu=class{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);let e=this.byteIndex,s=e+t*4;if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=s,e}addGroup(t){let e=this.addEmptyGroup(t.length);for(let s=0;s<t.length;s++)this.data[e/4+s]=t[s];return e}destroy(){this.data=null}}});var ui,vo,K_=x(()=>{"use strict";C();cs();$u();Hr();q_();us();ui=128,vo=class{constructor(t){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=t,this._batchBuffer=new Yu({minUniformOffsetAlignment:ui});let e=256/ui;for(let s=0;s<e;s++){let i=ct.UNIFORM|ct.COPY_DST;s===0&&(i|=ct.COPY_SRC),this._buffers.push(new zt({data:this._batchBuffer.data,usage:i}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){this._bindGroupHash=Object.create(null),this._batchBuffer.clear()}getUniformBindGroup(t,e){if(!e&&this._bindGroupHash[t.uid])return this._bindGroupHash[t.uid];this._renderer.ubo.ensureUniformGroup(t);let s=t.buffer.data,i=this._batchBuffer.addEmptyGroup(s.length);return this._renderer.ubo.syncUniformGroup(t,this._batchBuffer.data,i/4),this._bindGroupHash[t.uid]=this._getBindGroup(i/ui),this._bindGroupHash[t.uid]}getUboResource(t){this._renderer.ubo.updateUniformGroup(t);let e=t.buffer.data,s=this._batchBuffer.addGroup(e);return this._getBufferResource(s/ui)}getArrayBindGroup(t){let e=this._batchBuffer.addGroup(t);return this._getBindGroup(e/ui)}getArrayBufferResource(t){let s=this._batchBuffer.addGroup(t)/ui;return this._getBufferResource(s)}_getBufferResource(t){if(!this._bufferResources[t]){let e=this._buffers[t%2];this._bufferResources[t]=new ms({buffer:e,offset:(t/2|0)*256,size:ui})}return this._bufferResources[t]}_getBindGroup(t){if(!this._bindGroups[t]){let e=new oe({0:this._getBufferResource(t)});this._bindGroups[t]=e}return this._bindGroups[t]}_uploadBindGroups(){let t=this._renderer.buffer,e=this._buffers[0];e.update(this._batchBuffer.byteIndex),t.updateBuffer(e);let s=this._renderer.gpu.device.createCommandEncoder();for(let i=1;i<this._buffers.length;i++){let n=this._buffers[i];s.copyBufferToBuffer(t.getGPUBuffer(e),ui,t.getGPUBuffer(n),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([s.finish()])}destroy(){for(let t=0;t<this._bindGroups.length;t++)this._bindGroups[t]?.destroy();this._bindGroups=null,this._bindGroupHash=null;for(let t=0;t<this._buffers.length;t++)this._buffers[t].destroy();this._buffers=null;for(let t=0;t<this._bufferResources.length;t++)this._bufferResources[t].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._renderer=null}};vo.extension={type:[m.WebGPUPipes],name:"uniformBatch"}});function ju(r,t){for(let e in r.attributes){let s=r.attributes[e],i=t[e];i?(s.format??(s.format=i.format),s.offset??(s.offset=i.offset),s.instance??(s.instance=i.instance)):k(`Attribute ${e} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}Q3(r)}function Q3(r){let{buffers:t,attributes:e}=r,s={},i={};for(let n in t){let o=t[n];s[o.uid]=0,i[o.uid]=0}for(let n in e){let o=e[n];s[o.buffer.uid]+=Le(o.format).stride}for(let n in e){let o=e[n];o.stride??(o.stride=s[o.buffer.uid]),o.start??(o.start=i[o.buffer.uid]),i[o.buffer.uid]+=Le(o.format).stride}}var wd=x(()=>{"use strict";pt();Qs()});var Dr,Pd=x(()=>{"use strict";ni();Dr=[];Dr[Dt.NONE]=void 0;Dr[Dt.DISABLED]={stencilWriteMask:0,stencilReadMask:0};Dr[Dt.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};Dr[Dt.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};Dr[Dt.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Dr[Dt.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}}});function tP(r,t,e,s,i){return r<<24|t<<16|e<<10|s<<5|i}function eP(r,t,e,s,i){return e<<8|r<<5|s<<3|i<<1|t}var J3,To,Z_=x(()=>{"use strict";C();pt();wd();ni();Ln();Pd();J3={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};To=class{constructor(t){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._colorTargetCount=1,this._renderer=t}contextChange(t){this._gpu=t,this.setStencilMode(Dt.DISABLED),this._updatePipeHash()}setMultisampleCount(t){this._multisampleCount!==t&&(this._multisampleCount=t,this._updatePipeHash())}setRenderTarget(t){this._multisampleCount=t.msaaSamples,this._depthStencilAttachment=t.descriptor.depthStencilAttachment?1:0,this._colorTargetCount=t.colorTargetCount,this._updatePipeHash()}setColorMask(t){this._colorMask!==t&&(this._colorMask=t,this._updatePipeHash())}setStencilMode(t){this._stencilMode!==t&&(this._stencilMode=t,this._stencilState=Dr[t],this._updatePipeHash())}setPipeline(t,e,s,i){let n=this.getPipeline(t,e,s);i.setPipeline(n)}getPipeline(t,e,s,i){t._layoutKey||(ju(t,e.attributeData),this._generateBufferKey(t)),i||(i=t.topology);let n=tP(t._layoutKey,e._layoutKey,s.data,s._blendModeId,J3[i]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(t,e,s,i),this._pipeCache[n])}_createPipeline(t,e,s,i){let n=this._gpu.device,o=this._createVertexBufferLayouts(t,e),a=this._renderer.state.getColorTargets(s,this._colorTargetCount),u=this._stencilMode===Dt.RENDERING_MASK_ADD?0:this._colorMask;for(let d=0;d<a.length;d++)a[d].writeMask=u;let l=this._renderer.shader.getProgramData(e).pipeline,c={vertex:{module:this._getModule(e.vertex.source),entryPoint:e.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(e.fragment.source),entryPoint:e.fragment.entryPoint,targets:a},primitive:{topology:i,cullMode:s.cullMode},layout:l,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:s.depthTest,depthCompare:s.depthTest?"less":"always"}),n.createRenderPipeline(c)}_getModule(t){return this._moduleCache[t]||this._createModule(t)}_createModule(t){let e=this._gpu.device;return this._moduleCache[t]=e.createShaderModule({code:t}),this._moduleCache[t]}_generateBufferKey(t){let e=[],s=0,i=Object.keys(t.attributes).sort();for(let o=0;o<i.length;o++){let a=t.attributes[i[o]];e[s++]=a.offset,e[s++]=a.format,e[s++]=a.stride,e[s++]=a.instance}let n=e.join("|");return t._layoutKey=Nr(n,"geometry"),t._layoutKey}_generateAttributeLocationsKey(t){let e=[],s=0,i=Object.keys(t.attributeData).sort();for(let o=0;o<i.length;o++){let a=t.attributeData[i[o]];e[s++]=a.location}let n=e.join("|");return t._attributeLocationsKey=Nr(n,"programAttributes"),t._attributeLocationsKey}getBufferNamesToBind(t,e){let s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bindingNamesCache[s])return this._bindingNamesCache[s];let i=this._createVertexBufferLayouts(t,e),n=Object.create(null),o=e.attributeData;for(let a=0;a<i.length;a++){let l=Object.values(i[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[s]=n,n}_createVertexBufferLayouts(t,e){e._attributeLocationsKey||this._generateAttributeLocationsKey(e);let s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bufferLayoutsCache[s])return this._bufferLayoutsCache[s];let i=[];return t.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in e.attributeData){let l=t.attributes[u];(l.divisor??1)!==1&&k(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:e.attributeData[u].location,offset:l.offset,format:l.format}))}a.length&&i.push(o)}),this._bufferLayoutsCache[s]=i,i}_updatePipeHash(){let t=eP(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount);this._pipeStateCaches[t]||(this._pipeStateCaches[t]=Object.create(null)),this._pipeCache=this._pipeStateCaches[t]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}};To.extension={type:[m.WebGPUSystem],name:"pipeline"}});function Q_(r,t,e,s,i,n){let o=n?1:-1;return r.identity(),r.a=1/s*2,r.d=o*(1/i*2),r.tx=-1-t*r.a,r.ty=-o-e*r.d,r}var J_=x(()=>{"use strict"});function tb(r){let t=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement&&document.body.contains(t)}var eb=x(()=>{"use strict"});var gs,qu=x(()=>{"use strict";ot();jt();Ui();J_();zh();qs();Wt();ht();bd();eb();_d();gs=class{constructor(t){this.rootViewPort=new J,this.viewport=new J,this.mipLevel=0,this.layer=0,this.onRenderTargetChange=new Ii("onRenderTargetChange"),this.projectionMatrix=new F,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=t,t.gc.addCollection(this,"_gpuRenderTargetHash","hash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:t,clear:e,clearColor:s,frame:i,mipLevel:n,layer:o}){this._renderTargetStack.length=0,this.push(t,e,s,i,n??0,o??0),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=tb(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(t,e=!0,s,i,n=0,o=0){let a=this.getRenderTarget(t),u=this.renderTarget!==a;this.renderTarget=a,this.renderSurface=t;let l=this.getGpuRenderTarget(a);(a.pixelWidth!==l.width||a.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(a),l.width=a.pixelWidth,l.height=a.pixelHeight);let c=a.colorTexture,h=this.viewport,d=c.arrayLayerCount||1;if((o|0)!==o&&(o|=0),o<0||o>=d)throw new Error(`[RenderTargetSystem] layer ${o} is out of bounds (arrayLayerCount=${d}).`);this.mipLevel=n|0,this.layer=o|0;let f=Math.max(c.pixelWidth>>n,1),p=Math.max(c.pixelHeight>>n,1);if(!i&&t instanceof D&&(i=t.frame),i){let g=c._resolution,_=1<<Math.max(n|0,0),b=i.x*g+.5|0,y=i.y*g+.5|0,v=i.width*g+.5|0,T=i.height*g+.5|0,S=Math.floor(b/_),E=Math.floor(y/_),w=Math.ceil(v/_),M=Math.ceil(T/_);S=Math.min(Math.max(S,0),f-1),E=Math.min(Math.max(E,0),p-1),w=Math.min(Math.max(w,1),f-S),M=Math.min(Math.max(M,1),p-E),h.x=S,h.y=E,h.width=w,h.height=M}else h.x=0,h.y=0,h.width=f,h.height=p;return Q_(this.projectionMatrix,0,0,h.width/c.resolution,h.height/c.resolution,!a.isRoot),this.adaptor.startRenderPass(a,e,s,h,n,o),u&&this.onRenderTargetChange.emit(a),a}clear(t,e=ue.ALL,s,i=this.mipLevel,n=this.layer){e&&(t&&(t=this.getRenderTarget(t)),this.adaptor.clear(t||this.renderTarget,e,s,this.viewport,i,n))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(t,e=ue.ALL,s,i,n=0,o=0){let a=this.bind(t,e,s,i,n,o);return this._renderTargetStack.push({renderTarget:a,frame:i,mipLevel:n,layer:o}),a}pop(){this._renderTargetStack.pop();let t=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(t.renderTarget,!1,null,t.frame,t.mipLevel,t.layer)}getRenderTarget(t){return t.isTexture&&(t=t.source),this._renderSurfaceToRenderTargetHash.get(t)??this._initRenderTarget(t)}copyToTexture(t,e,s,i,n){s.x<0&&(i.width+=s.x,n.x-=s.x,s.x=0),s.y<0&&(i.height+=s.y,n.y-=s.y,s.y=0);let{pixelWidth:o,pixelHeight:a}=t;return i.width=Math.min(i.width,o-s.x),i.height=Math.min(i.height,a-s.y),this.adaptor.copyToTexture(t,e,s,i,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport,0,this.layer))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((t,e)=>{t!==e&&t.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(t){let e=null;return ne.test(t)&&(t=Wu(t).source),t instanceof co?e=t:t instanceof st&&(e=new co({colorTextures:[t]}),t.source instanceof ne&&(e.isRoot=!0),t.once("destroy",()=>{e.destroy(),this._renderSurfaceToRenderTargetHash.delete(t);let s=this._gpuRenderTargetHash[e.uid];s&&(this._gpuRenderTargetHash[e.uid]=null,this.adaptor.destroyGpuRenderTarget(s))})),this._renderSurfaceToRenderTargetHash.set(t,e),e}getGpuRenderTarget(t){return this._gpuRenderTargetHash[t.uid]||(this._gpuRenderTargetHash[t.uid]=this.adaptor.initGpuRenderTarget(t))}resetState(){this.renderTarget=null,this.renderSurface=null}}});var Ku,rb=x(()=>{"use strict";Ku=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}});var Zu,sb=x(()=>{"use strict";Ui();qs();Wt();rb();Zu=class{init(t,e){this._renderer=t,this._renderTargetSystem=e}copyToTexture(t,e,s,i,n){let o=this._renderer,a=this._getGpuColorTexture(t),u=o.texture.getGpuSource(e.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:s},{texture:u,origin:n},i),e}startRenderPass(t,e=!0,s,i,n=0,o=0){let u=this._renderTargetSystem.getGpuRenderTarget(t);if(o!==0&&u.msaaTextures?.length)throw new Error("[RenderTargetSystem] Rendering to array layers is not supported with MSAA render targets.");if(n>0&&u.msaaTextures?.length)throw new Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.");let l=this.getDescriptor(t,e,s,n,o);u.descriptor=l,this._renderer.pipeline.setRenderTarget(u),this._renderer.encoder.beginRenderPass(u),this._renderer.encoder.setViewport(i)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);return e.contexts[0]?e.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(t.colorTextures[0].source)}getDescriptor(t,e,s,i=0,n=0){typeof e=="boolean"&&(e=e?ue.ALL:ue.NONE);let o=this._renderTargetSystem,a=o.getGpuRenderTarget(t),u=t.colorTextures.map((h,d)=>{let f=a.contexts[d],p,g;if(f){if(n!==0)throw new Error("[RenderTargetSystem] Rendering to array layers is not supported for canvas targets.");p=f.getCurrentTexture().createView()}else p=this._renderer.texture.getGpuSource(h).createView({dimension:"2d",baseMipLevel:i,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1});let _=!1;a.msaaTextures[d]&&(g=p,p=this._renderer.texture.getTextureView(a.msaaTextures[d]),_=a.msaaTextures[d].transient);let b=e&ue.COLOR?"clear":"load";return s??(s=o.defaultClearColor),{view:p,resolveTarget:g,clearValue:s,storeOp:_?"discard":"store",loadOp:b}}),l;if((t.stencil||t.depth)&&!t.depthStencilTexture&&(t.ensureDepthStencilTexture(),t.depthStencilTexture.source.sampleCount=a.msaa?4:1,t.depthStencilTexture.source.transient=!!a.msaaTextures[0]?.transient),t.depthStencilTexture){let h=e&ue.STENCIL?"clear":"load",d=e&ue.DEPTH?"clear":"load",f=t.depthStencilTexture.source.transient?"discard":"store";l={view:this._renderer.texture.getGpuSource(t.depthStencilTexture.source).createView({dimension:"2d",baseMipLevel:i,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1}),stencilStoreOp:f,stencilLoadOp:h,depthClearValue:1,depthLoadOp:d,depthStoreOp:f}}return{colorAttachments:u,depthStencilAttachment:l}}clear(t,e=!0,s,i,n=0,o=0){if(!e)return;let{gpu:a,encoder:u}=this._renderer,l=a.device;if(u.commandEncoder===null){let h=l.createCommandEncoder(),d=this.getDescriptor(t,e,s,n,o),f=h.beginRenderPass(d);f.setViewport(i.x,i.y,i.width,i.height,0,1),f.end();let p=h.finish();l.queue.submit([p])}else this.startRenderPass(t,e,s,i,n,o)}initGpuRenderTarget(t){t.isRoot=!0;let e=new Ku;return e.colorTargetCount=t.colorTextures.length,t.colorTextures.forEach((s,i)=>{if(s instanceof ne){let n=s.resource.getContext("webgpu"),o=s.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o})}catch(a){console.error(a)}e.contexts[i]=n}if(e.msaa=s.source.antialias,s.source.antialias){let n=new st({width:0,height:0,sampleCount:4,transient:s.source.transient,arrayLayerCount:s.source.arrayLayerCount});e.msaaTextures[i]=n}}),e.msaa&&(e.msaaSamples=4,t.depthStencilTexture&&(t.depthStencilTexture.source.sampleCount=4,t.depthStencilTexture.source.transient=!!e.msaaTextures[0]?.transient)),e}destroyGpuRenderTarget(t){t.contexts.forEach(e=>{e.unconfigure()}),t.msaaTextures.forEach(e=>{e.destroy()}),t.msaaTextures.length=0,t.contexts.length=0}ensureDepthStencilTexture(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);t.depthStencilTexture&&e.msaa&&(t.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(t){let e=this._renderTargetSystem.getGpuRenderTarget(t);e.width=t.width,e.height=t.height,e.msaa&&t.colorTextures.forEach((s,i)=>{e.msaaTextures[i]?.resize(s.source.width,s.source.height,s.source._resolution)})}}});var So,ib=x(()=>{"use strict";C();qu();sb();So=class extends gs{constructor(t){super(t),this.adaptor=new Zu,this.adaptor.init(t,this)}};So.extension={type:[m.WebGPUSystem],name:"renderTarget"}});var Eo,nb=x(()=>{"use strict";C();Eo=class{constructor(){this._gpuProgramData=Object.create(null)}contextChange(t){this._gpu=t}getProgramData(t){return this._gpuProgramData[t._layoutKey]||this._createGPUProgramData(t)}_createGPUProgramData(t){let e=this._gpu.device,s=t.gpuLayout.map(n=>e.createBindGroupLayout({entries:n})),i={bindGroupLayouts:s};return this._gpuProgramData[t._layoutKey]={bindGroups:s,pipeline:e.createPipelineLayout(i)},this._gpuProgramData[t._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}};Eo.extension={type:[m.WebGPUSystem],name:"shader"}});var Be,ob=x(()=>{"use strict";Be={};Be.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};Be.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};Be.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};Be.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};Be.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};Be.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};Be["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};Be["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};Be["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};Be.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};Be.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};Be.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}}});var Co,ab=x(()=>{"use strict";C();je();ob();Co=class{constructor(){this.defaultState=new Ut,this.defaultState.blend=!0}contextChange(t){this.gpu=t}getColorTargets(t,e){let s=Be[t.blendMode]||Be.normal,i=[],n={format:"bgra8unorm",writeMask:0,blend:s};for(let o=0;o<e;o++)i[o]=n;return i}destroy(){this.gpu=null}};Co.extension={type:[m.WebGPUSystem],name:"state"}});var ub,lb=x(()=>{"use strict";ub={type:"image",upload(r,t,e,s=0){let i=r.resource,n=(r.pixelWidth|0)*(r.pixelHeight|0),o=i.byteLength/n;e.device.queue.writeTexture({texture:t,origin:{x:0,y:0,z:s}},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelWidth*o},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1})}}});var Bd,rP,cb,hb=x(()=>{"use strict";Bd={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},rP={blockBytes:4,blockWidth:1,blockHeight:1},cb={type:"compressed",upload(r,t,e,s=0){let i=r.pixelWidth,n=r.pixelHeight,o=Bd[r.format]||rP;for(let a=0;a<r.resource.length;a++){let u=r.resource[a],l=Math.ceil(i/o.blockWidth)*o.blockBytes;e.device.queue.writeTexture({texture:t,mipLevel:a,origin:{x:0,y:0,z:s}},u,{offset:0,bytesPerRow:l},{width:Math.ceil(i/o.blockWidth)*o.blockWidth,height:Math.ceil(n/o.blockHeight)*o.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),n=Math.max(n>>1,1)}}}});function db(r){return{type:"cube",upload(t,e,s){let i=t.faces;for(let n=0;n<XS.length;n++){let o=XS[n],a=i[o];(r[a.uploadMethodId]||r.image).upload(a,e,s,n)}}}}var XS,fb=x(()=>{"use strict";XS=["right","left","top","bottom","front","back"]});var Qu,Rd=x(()=>{"use strict";mt();pt();Qu={type:"image",upload(r,t,e,s=0){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let u=N.get().createCanvas(i.width,i.height);u.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=u,k("ImageSource: Image element passed, converting to canvas and replacing resource.")}let n=Math.min(t.width,r.resourceWidth||r.pixelWidth),o=Math.min(t.height,r.resourceHeight||r.pixelHeight),a=r.alphaMode==="premultiply-alpha-on-upload";e.device.queue.copyExternalImageToTexture({source:i},{texture:t,origin:{x:0,y:0,z:s},premultipliedAlpha:a},{width:n,height:o})}}});var pb,mb=x(()=>{"use strict";Rd();pb={type:"video",upload(r,t,e,s){Qu.upload(r,t,e,s)}}});var Ju,gb=x(()=>{"use strict";Ju=class{constructor(t){this.device=t,this.sampler=t.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(t){let e=this.pipelines[t];return e||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
724
724
|
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
|
725
725
|
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
726
726
|
|
|
@@ -744,7 +744,7 @@ fn mainFragment(
|
|
|
744
744
|
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
|
745
745
|
return textureSample(img, imgSampler, texCoord);
|
|
746
746
|
}
|
|
747
|
-
`})),e=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:t}]}}),this.pipelines[t]=e),e}generateMipmap(t){let e=this._getMipmapPipeline(t.format);if(t.dimension==="3d"||t.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let s=t,i=t.depthOrArrayLayers||1,n=t.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:i},format:t.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:t.mipLevelCount-1};s=this.device.createTexture(u)}let o=this.device.createCommandEncoder({}),a=e.getBindGroupLayout(0);for(let u=0;u<i;++u){let l=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<t.mipLevelCount;++h){let d=s.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),f=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),p=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});f.setPipeline(e),f.setBindGroup(0,p),f.draw(3,1,0,0),f.end(),l=d}}if(!n){let u={width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:i};for(let l=1;l<t.mipLevelCount;++l)o.copyTextureToTexture({texture:s,mipLevel:l-1},{texture:t,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([o.finish()]),n||s.destroy(),t}}});var Eo,gb,Md,Dd=x(()=>{"use strict";mt();C();ye();te();Ks();us();ub();cb();db();Rd();pb();mb();Eo=class{constructor(t){this.textureView=null,this.gpuTexture=t}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null}},gb=class zS{constructor(t){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._renderer=t,t.gc.addCollection(this,"_bindGroupHash","hash"),this._managedTextures=new vt({renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"gpuTextureSource"});let e={image:Zu,buffer:ab,video:fb,compressed:lb,...zS.uploadExtensions};this._uploads={...e,cube:hb(e)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(t){this._gpu=t}initSource(t){return t._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(t)}_initSource(t){if(t.autoGenerateMipmaps){let l=Math.max(t.pixelWidth,t.pixelHeight);t.mipLevelCount=Math.floor(Math.log2(l))+1}let e;t.sampleCount>1?(e=GPUTextureUsage.RENDER_ATTACHMENT,t.transient&&this._renderer.device.extensions.transientAttachment&&(e|=GPUTextureUsage.TRANSIENT_ATTACHMENT)):(e=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.uploadMethodId!=="compressed"&&(e|=GPUTextureUsage.RENDER_ATTACHMENT,e|=GPUTextureUsage.COPY_SRC));let s=Bd[t.format]||{blockBytes:4,blockWidth:1,blockHeight:1},i=Math.ceil(t.pixelWidth/s.blockWidth)*s.blockWidth,n=Math.ceil(t.pixelHeight/s.blockHeight)*s.blockHeight,o={label:t.label,size:{width:i,height:n,depthOrArrayLayers:t.arrayLayerCount},format:t.format,sampleCount:t.sampleCount,mipLevelCount:t.mipLevelCount,dimension:t.dimension,usage:e},a=this._gpu.device.createTexture(o);return t._gpuData[this._renderer.uid]=new Eo(a),this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceResize,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),a}onSourceUpdate(t){let e=this.getGpuSource(t);e&&(this._uploads[t.uploadMethodId]&&this._uploads[t.uploadMethodId].upload(t,e,this._gpu),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t))}onUpdateMipmaps(t){this._mipmapGenerator||(this._mipmapGenerator=new Qu(this._gpu.device));let e=this.getGpuSource(t);this._mipmapGenerator.generateMipmap(e)}onSourceUnload(t){t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceResize,this),t.off("updateMipmaps",this.onUpdateMipmaps,this)}onSourceResize(t){t._gcLastUsed=this._renderer.gc.now;let e=t._gpuData[this._renderer.uid],s=e?.gpuTexture;s?(s.width!==t.pixelWidth||s.height!==t.pixelHeight)&&(e.destroy(),this._bindGroupHash[t.uid]=null,t._gpuData[this._renderer.uid]=null,this.initSource(t)):this.initSource(t)}_initSampler(t){return this._gpuSamplers[t._resourceId]=this._gpu.device.createSampler(t),this._gpuSamplers[t._resourceId]}getGpuSampler(t){return this._gpuSamplers[t._resourceId]||this._initSampler(t)}getGpuSource(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]?.gpuTexture||this.initSource(t)}getTextureBindGroup(t){return this._bindGroupHash[t.uid]||this._createTextureBindGroup(t)}_createTextureBindGroup(t){let e=t.source;return this._bindGroupHash[t.uid]=new oe({0:e,1:e.style,2:new dt({uTextureMatrix:{type:"mat3x3<f32>",value:t.textureMatrix.mapCoord}})}),this._bindGroupHash[t.uid]}getTextureView(t){let e=t.source;e._gcLastUsed=this._renderer.gc.now;let s=e._gpuData[this._renderer.uid];return s||(this.initSource(e),s=e._gpuData[this._renderer.uid]),s.textureView||(s.textureView=s.gpuTexture.createView({dimension:e.viewDimension})),s.textureView}generateCanvas(t){let e=this._renderer,s=e.gpu.device.createCommandEncoder(),i=N.get().createCanvas();i.width=t.source.pixelWidth,i.height=t.source.pixelHeight;let n=i.getContext("webgpu");return n.configure({device:e.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:N.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),s.copyTextureToTexture({texture:e.texture.getGpuSource(t.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:i.width,height:i.height}),e.gpu.device.queue.submit([s.finish()]),i}getPixels(t){let e=this.generateCanvas(t),s=be.getOptimalCanvasAndContext(e.width,e.height),i=s.context;i.drawImage(e,0,0);let{width:n,height:o}=e,a=i.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return be.returnCanvasAndContext(s),{pixels:u,width:n,height:o}}destroy(){this._managedTextures.destroy();for(let t of Object.keys(this._bindGroupHash)){let e=Number(t);this._bindGroupHash[e]?.destroy()}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null}};gb.extension={type:[m.WebGPUSystem],name:"texture"};gb.uploadExtensions=Object.create(null);Md=gb;O.handleByMap(m.TextureUploaderWebGPU,Md.uploadExtensions)});var jS={};Ec(jS,{WebGPURenderer:()=>Fd});var rP,sP,iP,XS,$S,YS,Fd,xb=x(()=>{"use strict";C();Mx();Gx();Ux();Ui();Vu();Pe();G_();U_();I_();k_();O_();L_();N_();Y_();q_();K_();sb();ib();ob();Dd();rP=[...ji,_o,fo,qi,po,co,Md,vo,To,So,yo,ho,mo,lo],sP=[...Wu,bo],iP=[zn,Vn,Wn],XS=[],$S=[],YS=[];O.handleByNamedList(m.WebGPUSystem,XS);O.handleByNamedList(m.WebGPUPipes,$S);O.handleByNamedList(m.WebGPUPipesAdaptor,YS);O.add(...rP,...sP,...iP);Fd=class extends Er{constructor(){let t={name:"webgpu",type:Tt.WEBGPU,systems:XS,renderPipes:$S,renderPipeAdaptors:YS};super(t)}}});var Co,_b=x(()=>{"use strict";C();ot();fs();Nn();Hn();Wi();ps();Iu();lr();te();Co=class{contextChange(t){let e=new dt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),s=t.limits.maxBatchableTextures,i=Ar({name:"graphics",bits:[Oi,Ni(s),Hi,Pr]});this.shader=new Vt({glProgram:i,resources:{localUniforms:e,batchSamplers:zi(s)}})}execute(t,e){let s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a.geometry,i.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}};Co.extension={type:[m.WebGLPipesAdaptor],name:"graphics"}});var Ao,bb=x(()=>{"use strict";C();ot();fs();Wi();ps();Zh();lr();ht();pt();Ao=class{init(){let t=Ar({name:"mesh",bits:[Hi,Fx,Pr]});this._shader=new Vt({glProgram:t,resources:{uTexture:D.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new F}}}})}execute(t,e){let s=t.renderer,i=e._shader;if(i){if(!i.glProgram){k("Mesh shader has no glProgram",e.shader);return}}else{i=this._shader;let n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Ao.extension={type:[m.WebGLPipesAdaptor],name:"mesh"}});var wo,yb=x(()=>{"use strict";C();je();wo=class{constructor(){this._tempState=Ut.for2d(),this._didUploadHash={}}init(t){t.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(t,e,s){let i=t.renderer,n=this._didUploadHash[s.uid];i.shader.bind(s,n),n||(this._didUploadHash[s.uid]=!0),i.shader.updateUniformGroup(i.globalUniforms.uniformGroup),i.geometry.bind(e,s.glProgram)}execute(t,e){let s=t.renderer;this._tempState.blendMode=e.blendMode,s.state.set(this._tempState);let i=e.textures.textures;for(let n=0;n<e.textures.count;n++)s.texture.bind(i[n],n);s.geometry.draw(e.topology,e.size,e.start)}};wo.extension={type:[m.WebGLPipesAdaptor],name:"batch"}});var Po,vb=x(()=>{"use strict";Po=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Po||{})});var Ju,Tb=x(()=>{"use strict";Ju=class{constructor(t,e){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.type=e}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}});var Bo,Sb=x(()=>{"use strict";C();ye();Hr();vb();Tb();Bo=class{constructor(t){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=t,this._managedBuffers=new vt({renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this.createGLBuffer(t)}bind(t){let{_gl:e}=this,s=this.getGlBuffer(t);e.bindBuffer(s.type,s.buffer)}bindBufferBase(t,e){let{_gl:s}=this;this._boundBufferBases[e]!==t&&(this._boundBufferBases[e]=t,t._lastBindBaseLocation=e,s.bindBufferBase(s.UNIFORM_BUFFER,e,t.buffer))}nextBindBase(t){this._bindCallId++,this._minBaseLocation=0,t&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(t){let e=this.getLastBindBaseLocation(t);if(e>=this._minBaseLocation)return t._lastBindCallId=this._bindCallId,e;let s=0,i=this._nextBindBaseIndex;for(;s<2;){i>=this._maxBindings&&(i=this._minBaseLocation,s++);let n=this._boundBufferBases[i];if(n&&n._lastBindCallId===this._bindCallId){i++;continue}break}return e=i,this._nextBindBaseIndex=i+1,s>=2?-1:(t._lastBindCallId=this._bindCallId,this._boundBufferBases[e]=null,e)}getLastBindBaseLocation(t){let e=t._lastBindBaseLocation;return this._boundBufferBases[e]===t?e:-1}bindBufferRange(t,e,s,i){let{_gl:n}=this;s||(s=0),e||(e=0),this._boundBufferBases[e]=null,n.bindBufferRange(n.UNIFORM_BUFFER,e||0,t.buffer,s*256,i||256)}updateBuffer(t){let{_gl:e}=this,s=this.getGlBuffer(t);if(t._updateID===s.updateID)return s;s.updateID=t._updateID,e.bindBuffer(s.type,s.buffer);let i=t.data,n=t.descriptor.usage&ct.STATIC?e.STATIC_DRAW:e.DYNAMIC_DRAW;return i?s.byteLength>=i.byteLength?e.bufferSubData(s.type,0,i,0,t._updateSize/i.BYTES_PER_ELEMENT):(s.byteLength=i.byteLength,e.bufferData(s.type,i,n)):(s.byteLength=t.descriptor.size,e.bufferData(s.type,s.byteLength,n)),s}destroyAll(t=!1){this._managedBuffers.removeAll(t)}onBufferUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];s&&(e||this._gl.deleteBuffer(s.buffer))}createGLBuffer(t){let{_gl:e}=this,s=Po.ARRAY_BUFFER;t.descriptor.usage&ct.INDEX?s=Po.ELEMENT_ARRAY_BUFFER:t.descriptor.usage&ct.UNIFORM&&(s=Po.UNIFORM_BUFFER);let i=new Ju(e.createBuffer(),s);return t._gpuData[this._renderer.uid]=i,this._managedBuffers.add(t),i}resetState(){this._boundBufferBases=Object.create(null)}};Bo.extension={type:[m.WebGLSystem],name:"buffer"}});var Eb,Cb,Ab=x(()=>{"use strict";mt();C();pt();Eb=class qS{constructor(t){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=t,this.extensions=Object.create(null),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}init(t){t={...qS.defaultOptions,...t};let e=this.multiView=t.multiView;if(t.context&&e&&(k("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),e=!1),e?this.canvas=N.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,t.context)this.initFromContext(t.context);else{let s=this._renderer.background.alpha<1,i=t.premultipliedAlpha??!0,n=t.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(t.preferWebGLVersion,{alpha:s,premultipliedAlpha:i,antialias:n,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference??"default"})}}ensureCanvasSize(t){if(!this.multiView){t!==this.canvas&&k("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:e}=this;(e.width<t.width||e.height<t.height)&&(e.width=Math.max(t.width,t.width),e.height=Math.max(t.height,t.height))}initFromContext(t){this.gl=t,this.webGLVersion=t instanceof N.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(t),this._renderer.runners.contextChange.emit(t);let e=this._renderer.view.canvas;e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(t,e){let s,i=this.canvas;if(t===2&&(s=i.getContext("webgl2",e)),!s&&(s=i.getContext("webgl",e),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){let{gl:t}=this,e={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"),bptc:t.getExtension("EXT_texture_compression_bptc"),rgtc:t.getExtension("EXT_texture_compression_rgtc"),loseContext:t.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...e,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"),vertexAttribDivisorANGLE:t.getExtension("ANGLE_instanced_arrays"),srgb:t.getExtension("EXT_sRGB")};else{this.extensions={...e,colorBufferFloat:t.getExtension("EXT_color_buffer_float")};let s=t.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(t){t.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){let t=this._renderer.view.canvas;this._renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(t){let e=t.getContextAttributes();e&&!e.stencil&&k("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let s=this.supports,i=this.webGLVersion===2,n=this.extensions;s.uint32Indices=i||!!n.uint32ElementIndex,s.uniformBufferObject=i,s.vertexArrayObject=i||!!n.vertexArrayObject,s.srgbTextures=i||!!n.srgb,s.nonPowOf2wrapping=i,s.nonPowOf2mipmaps=i,s.msaa=i,s.uint32Indices||k("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};Eb.extension={type:[m.WebGLSystem],name:"context"};Eb.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};Cb=Eb});var tl,Ro,KS,bt,el=x(()=>{"use strict";tl=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(tl||{}),Ro=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Ro||{}),KS=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(KS||{}),bt=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(bt||{})});function wb(r){return ZS[r]??ZS.float32}var ZS,Pb=x(()=>{"use strict";el();ZS={uint8x2:bt.UNSIGNED_BYTE,uint8x4:bt.UNSIGNED_BYTE,sint8x2:bt.BYTE,sint8x4:bt.BYTE,unorm8x2:bt.UNSIGNED_BYTE,unorm8x4:bt.UNSIGNED_BYTE,snorm8x2:bt.BYTE,snorm8x4:bt.BYTE,uint16x2:bt.UNSIGNED_SHORT,uint16x4:bt.UNSIGNED_SHORT,sint16x2:bt.SHORT,sint16x4:bt.SHORT,unorm16x2:bt.UNSIGNED_SHORT,unorm16x4:bt.UNSIGNED_SHORT,snorm16x2:bt.SHORT,snorm16x4:bt.SHORT,float16x2:bt.HALF_FLOAT,float16x4:bt.HALF_FLOAT,float32:bt.FLOAT,float32x2:bt.FLOAT,float32x3:bt.FLOAT,float32x4:bt.FLOAT,uint32:bt.UNSIGNED_INT,uint32x2:bt.UNSIGNED_INT,uint32x3:bt.UNSIGNED_INT,uint32x4:bt.UNSIGNED_INT,sint32:bt.INT,sint32x2:bt.INT,sint32x3:bt.INT,sint32x4:bt.INT}});var nP,Gd,Mo,Bb=x(()=>{"use strict";C();ye();Zs();wd();Pb();nP={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Gd=class{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}},Mo=class{constructor(t){this._renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new vt({renderer:t,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){let t=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);let e=this._renderer.context.extensions.vertexArrayObject;e&&(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=i=>e.bindVertexArrayOES(i),t.deleteVertexArray=i=>e.deleteVertexArrayOES(i));let s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(t.drawArraysInstanced=(i,n,o,a)=>{s.drawArraysInstancedANGLE(i,n,o,a)},t.drawElementsInstanced=(i,n,o,a,u)=>{s.drawElementsInstancedANGLE(i,n,o,a,u)},t.vertexAttribDivisor=(i,n)=>s.vertexAttribDivisorANGLE(i,n)),this._activeGeometry=null,this._activeVao=null}bind(t,e){let s=this.gl;this._activeGeometry=t;let i=this.getVao(t,e);this._activeVao!==i&&(this._activeVao=i,s.bindVertexArray(i)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){let t=this._activeGeometry,e=this._renderer.buffer;for(let s=0;s<t.buffers.length;s++){let i=t.buffers[s];e.updateBuffer(i)}t._gcLastUsed=this._renderer.gc.now}checkCompatibility(t,e){let s=t.attributes,i=e._attributeData;for(let n in i)if(!s[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(t,e){let s=t.attributes,i=e._attributeData,n=["g",t.uid];for(let o in s)i[o]&&n.push(o,i[o].location);return n.join("-")}getVao(t,e){return t._gpuData[this._renderer.uid]?.vaoCache[e._key]||this.initGeometryVao(t,e)}initGeometryVao(t,e,s=!0){let i=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(e),this.checkCompatibility(t,e);let o=this.getSignature(t,e),a=t._gpuData[this._renderer.uid];a||(a=new Gd,t._gpuData[this._renderer.uid]=a,this._managedGeometries.add(t));let u=a.vaoCache,l=u[o];if(l)return u[e._key]=l,l;Yu(t,e._attributeData);let c=t.buffers;l=i.createVertexArray(),i.bindVertexArray(l);for(let h=0;h<c.length;h++){let d=c[h];n.bind(d)}return this.activateVao(t,e),u[e._key]=l,u[o]=l,i.bindVertexArray(null),l}onGeometryUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];if(!s)return;let i=s.vaoCache;if(!e)for(let n in i)this._activeVao!==i[n]&&this.resetState(),this.gl.deleteVertexArray(i[n])}destroyAll(t=!1){this._managedGeometries.removeAll(t)}activateVao(t,e){let s=this._renderer.gl,i=this._renderer.buffer,n=t.attributes;t.indexBuffer&&i.bind(t.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=i.getGlBuffer(l),h=e._attributeData[a];if(h){o!==c&&(i.bind(l),o=c);let d=h.location;s.enableVertexAttribArray(d);let f=Le(u.format),p=wb(u.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(d,f.size,p,u.stride,u.offset):s.vertexAttribPointer(d,f.size,p,f.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let g=u.divisor??1;s.vertexAttribDivisor(d,g)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,e,s,i){let{gl:n}=this._renderer,o=this._activeGeometry,a=nP[t||o.topology];if(i??(i=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;i!==1?n.drawElementsInstanced(a,e||o.indexBuffer.data.length,l,(s||0)*u,i):n.drawElements(a,e||o.indexBuffer.data.length,l,(s||0)*u)}else i!==1?n.drawArraysInstanced(a,s||0,e||o.getSize(),i):n.drawArrays(a,s||0,e||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}};Mo.extension={type:[m.WebGLSystem],name:"geometry"}});var oP,Rb,Mb,Db=x(()=>{"use strict";C();pt();Qs();lr();je();Wt();ht();Oe();oP=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),Rb=class QS{constructor(t){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=t}init(t={}){let{useBackBuffer:e,antialias:s}={...QS.defaultOptions,...t};this.useBackBuffer=e,this._antialias=s,this._renderer.context.supports.msaa||(k("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=Ut.for2d();let i=new Rt({vertex:`
|
|
747
|
+
`})),e=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:t}]}}),this.pipelines[t]=e),e}generateMipmap(t){let e=this._getMipmapPipeline(t.format);if(t.dimension==="3d"||t.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let s=t,i=t.depthOrArrayLayers||1,n=t.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:i},format:t.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:t.mipLevelCount-1};s=this.device.createTexture(u)}let o=this.device.createCommandEncoder({}),a=e.getBindGroupLayout(0);for(let u=0;u<i;++u){let l=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<t.mipLevelCount;++h){let d=s.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),f=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),p=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});f.setPipeline(e),f.setBindGroup(0,p),f.draw(3,1,0,0),f.end(),l=d}}if(!n){let u={width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:i};for(let l=1;l<t.mipLevelCount;++l)o.copyTextureToTexture({texture:s,mipLevel:l-1},{texture:t,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([o.finish()]),n||s.destroy(),t}}});var Ao,xb,Md,Dd=x(()=>{"use strict";mt();C();ye();te();Zs();us();lb();hb();fb();Rd();mb();gb();Ao=class{constructor(t){this.textureView=null,this.gpuTexture=t}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null}},xb=class $S{constructor(t){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._renderer=t,t.gc.addCollection(this,"_bindGroupHash","hash"),this._managedTextures=new vt({renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"gpuTextureSource"});let e={image:Qu,buffer:ub,video:pb,compressed:cb,...$S.uploadExtensions};this._uploads={...e,cube:db(e)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(t){this._gpu=t}initSource(t){return t._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(t)}_initSource(t){if(t.autoGenerateMipmaps){let l=Math.max(t.pixelWidth,t.pixelHeight);t.mipLevelCount=Math.floor(Math.log2(l))+1}let e;t.sampleCount>1?(e=GPUTextureUsage.RENDER_ATTACHMENT,t.transient&&this._renderer.device.extensions.transientAttachment&&(e|=GPUTextureUsage.TRANSIENT_ATTACHMENT)):(e=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.uploadMethodId!=="compressed"&&(e|=GPUTextureUsage.RENDER_ATTACHMENT,e|=GPUTextureUsage.COPY_SRC));let s=Bd[t.format]||{blockBytes:4,blockWidth:1,blockHeight:1},i=Math.ceil(t.pixelWidth/s.blockWidth)*s.blockWidth,n=Math.ceil(t.pixelHeight/s.blockHeight)*s.blockHeight,o={label:t.label,size:{width:i,height:n,depthOrArrayLayers:t.arrayLayerCount},format:t.format,sampleCount:t.sampleCount,mipLevelCount:t.mipLevelCount,dimension:t.dimension,usage:e},a=this._gpu.device.createTexture(o);return t._gpuData[this._renderer.uid]=new Ao(a),this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceResize,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),a}onSourceUpdate(t){let e=this.getGpuSource(t);e&&(this._uploads[t.uploadMethodId]&&this._uploads[t.uploadMethodId].upload(t,e,this._gpu),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t))}onUpdateMipmaps(t){this._mipmapGenerator||(this._mipmapGenerator=new Ju(this._gpu.device));let e=this.getGpuSource(t);this._mipmapGenerator.generateMipmap(e)}onSourceUnload(t){t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceResize,this),t.off("updateMipmaps",this.onUpdateMipmaps,this)}onSourceResize(t){t._gcLastUsed=this._renderer.gc.now;let e=t._gpuData[this._renderer.uid],s=e?.gpuTexture;s?(s.width!==t.pixelWidth||s.height!==t.pixelHeight)&&(e.destroy(),this._bindGroupHash[t.uid]=null,t._gpuData[this._renderer.uid]=null,this.initSource(t)):this.initSource(t)}_initSampler(t){return this._gpuSamplers[t._resourceId]=this._gpu.device.createSampler(t),this._gpuSamplers[t._resourceId]}getGpuSampler(t){return this._gpuSamplers[t._resourceId]||this._initSampler(t)}getGpuSource(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]?.gpuTexture||this.initSource(t)}getTextureBindGroup(t){return this._bindGroupHash[t.uid]||this._createTextureBindGroup(t)}_createTextureBindGroup(t){let e=t.source;return this._bindGroupHash[t.uid]=new oe({0:e,1:e.style,2:new dt({uTextureMatrix:{type:"mat3x3<f32>",value:t.textureMatrix.mapCoord}})}),this._bindGroupHash[t.uid]}getTextureView(t){let e=t.source;e._gcLastUsed=this._renderer.gc.now;let s=e._gpuData[this._renderer.uid];return s||(this.initSource(e),s=e._gpuData[this._renderer.uid]),s.textureView||(s.textureView=s.gpuTexture.createView({dimension:e.viewDimension})),s.textureView}generateCanvas(t){let e=this._renderer,s=e.gpu.device.createCommandEncoder(),i=N.get().createCanvas();i.width=t.source.pixelWidth,i.height=t.source.pixelHeight;let n=i.getContext("webgpu");return n.configure({device:e.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:N.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),s.copyTextureToTexture({texture:e.texture.getGpuSource(t.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:i.width,height:i.height}),e.gpu.device.queue.submit([s.finish()]),i}getPixels(t){let e=this.generateCanvas(t),s=be.getOptimalCanvasAndContext(e.width,e.height),i=s.context;i.drawImage(e,0,0);let{width:n,height:o}=e,a=i.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return be.returnCanvasAndContext(s),{pixels:u,width:n,height:o}}destroy(){this._managedTextures.destroy();for(let t of Object.keys(this._bindGroupHash)){let e=Number(t);this._bindGroupHash[e]?.destroy()}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null}};xb.extension={type:[m.WebGPUSystem],name:"texture"};xb.uploadExtensions=Object.create(null);Md=xb;O.handleByMap(m.TextureUploaderWebGPU,Md.uploadExtensions)});var KS={};Ec(KS,{WebGPURenderer:()=>Fd});var sP,iP,nP,YS,jS,qS,Fd,_b=x(()=>{"use strict";C();Dx();Ux();Ix();ki();zu();Pe();U_();I_();k_();O_();L_();N_();H_();j_();K_();Z_();ib();nb();ab();Dd();sP=[...Ki,yo,mo,Zi,go,fo,Md,So,Eo,Co,To,po,xo,ho],iP=[...Vu,vo],nP=[$n,Xn,zn],YS=[],jS=[],qS=[];O.handleByNamedList(m.WebGPUSystem,YS);O.handleByNamedList(m.WebGPUPipes,jS);O.handleByNamedList(m.WebGPUPipesAdaptor,qS);O.add(...sP,...iP,...nP);Fd=class extends Er{constructor(){let t={name:"webgpu",type:Tt.WEBGPU,systems:YS,renderPipes:jS,renderPipeAdaptors:qS};super(t)}}});var wo,bb=x(()=>{"use strict";C();ot();fs();Wn();Vn();zi();ps();ku();lr();te();wo=class{contextChange(t){let e=new dt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),s=t.limits.maxBatchableTextures,i=Ar({name:"graphics",bits:[Ni,Wi(s),Vi,Pr]});this.shader=new Vt({glProgram:i,resources:{localUniforms:e,batchSamplers:$i(s)}})}execute(t,e){let s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a.geometry,i.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}};wo.extension={type:[m.WebGLPipesAdaptor],name:"graphics"}});var Po,yb=x(()=>{"use strict";C();ot();fs();zi();ps();Zh();lr();ht();pt();Po=class{init(){let t=Ar({name:"mesh",bits:[Vi,Gx,Pr]});this._shader=new Vt({glProgram:t,resources:{uTexture:D.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new F}}}})}execute(t,e){let s=t.renderer,i=e._shader;if(i){if(!i.glProgram){k("Mesh shader has no glProgram",e.shader);return}}else{i=this._shader;let n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Po.extension={type:[m.WebGLPipesAdaptor],name:"mesh"}});var Bo,vb=x(()=>{"use strict";C();je();Bo=class{constructor(){this._tempState=Ut.for2d(),this._didUploadHash={}}init(t){t.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(t,e,s){let i=t.renderer,n=this._didUploadHash[s.uid];i.shader.bind(s,n),n||(this._didUploadHash[s.uid]=!0),i.shader.updateUniformGroup(i.globalUniforms.uniformGroup),i.geometry.bind(e,s.glProgram)}execute(t,e){let s=t.renderer;this._tempState.blendMode=e.blendMode,s.state.set(this._tempState);let i=e.textures.textures;for(let n=0;n<e.textures.count;n++)s.texture.bind(i[n],n);s.geometry.draw(e.topology,e.size,e.start)}};Bo.extension={type:[m.WebGLPipesAdaptor],name:"batch"}});var Ro,Tb=x(()=>{"use strict";Ro=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Ro||{})});var tl,Sb=x(()=>{"use strict";tl=class{constructor(t,e){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.type=e}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}});var Mo,Eb=x(()=>{"use strict";C();ye();Hr();Tb();Sb();Mo=class{constructor(t){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=t,this._managedBuffers=new vt({renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this.createGLBuffer(t)}bind(t){let{_gl:e}=this,s=this.getGlBuffer(t);e.bindBuffer(s.type,s.buffer)}bindBufferBase(t,e){let{_gl:s}=this;this._boundBufferBases[e]!==t&&(this._boundBufferBases[e]=t,t._lastBindBaseLocation=e,s.bindBufferBase(s.UNIFORM_BUFFER,e,t.buffer))}nextBindBase(t){this._bindCallId++,this._minBaseLocation=0,t&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(t){let e=this.getLastBindBaseLocation(t);if(e>=this._minBaseLocation)return t._lastBindCallId=this._bindCallId,e;let s=0,i=this._nextBindBaseIndex;for(;s<2;){i>=this._maxBindings&&(i=this._minBaseLocation,s++);let n=this._boundBufferBases[i];if(n&&n._lastBindCallId===this._bindCallId){i++;continue}break}return e=i,this._nextBindBaseIndex=i+1,s>=2?-1:(t._lastBindCallId=this._bindCallId,this._boundBufferBases[e]=null,e)}getLastBindBaseLocation(t){let e=t._lastBindBaseLocation;return this._boundBufferBases[e]===t?e:-1}bindBufferRange(t,e,s,i){let{_gl:n}=this;s||(s=0),e||(e=0),this._boundBufferBases[e]=null,n.bindBufferRange(n.UNIFORM_BUFFER,e||0,t.buffer,s*256,i||256)}updateBuffer(t){let{_gl:e}=this,s=this.getGlBuffer(t);if(t._updateID===s.updateID)return s;s.updateID=t._updateID,e.bindBuffer(s.type,s.buffer);let i=t.data,n=t.descriptor.usage&ct.STATIC?e.STATIC_DRAW:e.DYNAMIC_DRAW;return i?s.byteLength>=i.byteLength?e.bufferSubData(s.type,0,i,0,t._updateSize/i.BYTES_PER_ELEMENT):(s.byteLength=i.byteLength,e.bufferData(s.type,i,n)):(s.byteLength=t.descriptor.size,e.bufferData(s.type,s.byteLength,n)),s}destroyAll(t=!1){this._managedBuffers.removeAll(t)}onBufferUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];s&&(e||this._gl.deleteBuffer(s.buffer))}createGLBuffer(t){let{_gl:e}=this,s=Ro.ARRAY_BUFFER;t.descriptor.usage&ct.INDEX?s=Ro.ELEMENT_ARRAY_BUFFER:t.descriptor.usage&ct.UNIFORM&&(s=Ro.UNIFORM_BUFFER);let i=new tl(e.createBuffer(),s);return t._gpuData[this._renderer.uid]=i,this._managedBuffers.add(t),i}resetState(){this._boundBufferBases=Object.create(null)}};Mo.extension={type:[m.WebGLSystem],name:"buffer"}});var Cb,Ab,wb=x(()=>{"use strict";mt();C();pt();Cb=class ZS{constructor(t){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=t,this.extensions=Object.create(null),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}init(t){t={...ZS.defaultOptions,...t};let e=this.multiView=t.multiView;if(t.context&&e&&(k("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),e=!1),e?this.canvas=N.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,t.context)this.initFromContext(t.context);else{let s=this._renderer.background.alpha<1,i=t.premultipliedAlpha??!0,n=t.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(t.preferWebGLVersion,{alpha:s,premultipliedAlpha:i,antialias:n,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference??"default"})}}ensureCanvasSize(t){if(!this.multiView){t!==this.canvas&&k("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:e}=this;(e.width<t.width||e.height<t.height)&&(e.width=Math.max(t.width,t.width),e.height=Math.max(t.height,t.height))}initFromContext(t){this.gl=t,this.webGLVersion=t instanceof N.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(t),this._renderer.runners.contextChange.emit(t);let e=this._renderer.view.canvas;e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(t,e){let s,i=this.canvas;if(t===2&&(s=i.getContext("webgl2",e)),!s&&(s=i.getContext("webgl",e),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){let{gl:t}=this,e={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"),bptc:t.getExtension("EXT_texture_compression_bptc"),rgtc:t.getExtension("EXT_texture_compression_rgtc"),loseContext:t.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...e,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"),vertexAttribDivisorANGLE:t.getExtension("ANGLE_instanced_arrays"),srgb:t.getExtension("EXT_sRGB")};else{this.extensions={...e,colorBufferFloat:t.getExtension("EXT_color_buffer_float")};let s=t.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(t){t.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){let t=this._renderer.view.canvas;this._renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(t){let e=t.getContextAttributes();e&&!e.stencil&&k("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let s=this.supports,i=this.webGLVersion===2,n=this.extensions;s.uint32Indices=i||!!n.uint32ElementIndex,s.uniformBufferObject=i,s.vertexArrayObject=i||!!n.vertexArrayObject,s.srgbTextures=i||!!n.srgb,s.nonPowOf2wrapping=i,s.nonPowOf2mipmaps=i,s.msaa=i,s.uint32Indices||k("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};Cb.extension={type:[m.WebGLSystem],name:"context"};Cb.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};Ab=Cb});var el,Do,QS,bt,rl=x(()=>{"use strict";el=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(el||{}),Do=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Do||{}),QS=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(QS||{}),bt=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(bt||{})});function Pb(r){return JS[r]??JS.float32}var JS,Bb=x(()=>{"use strict";rl();JS={uint8x2:bt.UNSIGNED_BYTE,uint8x4:bt.UNSIGNED_BYTE,sint8x2:bt.BYTE,sint8x4:bt.BYTE,unorm8x2:bt.UNSIGNED_BYTE,unorm8x4:bt.UNSIGNED_BYTE,snorm8x2:bt.BYTE,snorm8x4:bt.BYTE,uint16x2:bt.UNSIGNED_SHORT,uint16x4:bt.UNSIGNED_SHORT,sint16x2:bt.SHORT,sint16x4:bt.SHORT,unorm16x2:bt.UNSIGNED_SHORT,unorm16x4:bt.UNSIGNED_SHORT,snorm16x2:bt.SHORT,snorm16x4:bt.SHORT,float16x2:bt.HALF_FLOAT,float16x4:bt.HALF_FLOAT,float32:bt.FLOAT,float32x2:bt.FLOAT,float32x3:bt.FLOAT,float32x4:bt.FLOAT,uint32:bt.UNSIGNED_INT,uint32x2:bt.UNSIGNED_INT,uint32x3:bt.UNSIGNED_INT,uint32x4:bt.UNSIGNED_INT,sint32:bt.INT,sint32x2:bt.INT,sint32x3:bt.INT,sint32x4:bt.INT}});var oP,Gd,Fo,Rb=x(()=>{"use strict";C();ye();Qs();wd();Bb();oP={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Gd=class{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}},Fo=class{constructor(t){this._renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new vt({renderer:t,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){let t=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);let e=this._renderer.context.extensions.vertexArrayObject;e&&(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=i=>e.bindVertexArrayOES(i),t.deleteVertexArray=i=>e.deleteVertexArrayOES(i));let s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(t.drawArraysInstanced=(i,n,o,a)=>{s.drawArraysInstancedANGLE(i,n,o,a)},t.drawElementsInstanced=(i,n,o,a,u)=>{s.drawElementsInstancedANGLE(i,n,o,a,u)},t.vertexAttribDivisor=(i,n)=>s.vertexAttribDivisorANGLE(i,n)),this._activeGeometry=null,this._activeVao=null}bind(t,e){let s=this.gl;this._activeGeometry=t;let i=this.getVao(t,e);this._activeVao!==i&&(this._activeVao=i,s.bindVertexArray(i)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){let t=this._activeGeometry,e=this._renderer.buffer;for(let s=0;s<t.buffers.length;s++){let i=t.buffers[s];e.updateBuffer(i)}t._gcLastUsed=this._renderer.gc.now}checkCompatibility(t,e){let s=t.attributes,i=e._attributeData;for(let n in i)if(!s[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(t,e){let s=t.attributes,i=e._attributeData,n=["g",t.uid];for(let o in s)i[o]&&n.push(o,i[o].location);return n.join("-")}getVao(t,e){return t._gpuData[this._renderer.uid]?.vaoCache[e._key]||this.initGeometryVao(t,e)}initGeometryVao(t,e,s=!0){let i=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(e),this.checkCompatibility(t,e);let o=this.getSignature(t,e),a=t._gpuData[this._renderer.uid];a||(a=new Gd,t._gpuData[this._renderer.uid]=a,this._managedGeometries.add(t));let u=a.vaoCache,l=u[o];if(l)return u[e._key]=l,l;ju(t,e._attributeData);let c=t.buffers;l=i.createVertexArray(),i.bindVertexArray(l);for(let h=0;h<c.length;h++){let d=c[h];n.bind(d)}return this.activateVao(t,e),u[e._key]=l,u[o]=l,i.bindVertexArray(null),l}onGeometryUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];if(!s)return;let i=s.vaoCache;if(!e)for(let n in i)this._activeVao!==i[n]&&this.resetState(),this.gl.deleteVertexArray(i[n])}destroyAll(t=!1){this._managedGeometries.removeAll(t)}activateVao(t,e){let s=this._renderer.gl,i=this._renderer.buffer,n=t.attributes;t.indexBuffer&&i.bind(t.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=i.getGlBuffer(l),h=e._attributeData[a];if(h){o!==c&&(i.bind(l),o=c);let d=h.location;s.enableVertexAttribArray(d);let f=Le(u.format),p=Pb(u.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(d,f.size,p,u.stride,u.offset):s.vertexAttribPointer(d,f.size,p,f.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let g=u.divisor??1;s.vertexAttribDivisor(d,g)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,e,s,i){let{gl:n}=this._renderer,o=this._activeGeometry,a=oP[t||o.topology];if(i??(i=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;i!==1?n.drawElementsInstanced(a,e||o.indexBuffer.data.length,l,(s||0)*u,i):n.drawElements(a,e||o.indexBuffer.data.length,l,(s||0)*u)}else i!==1?n.drawArraysInstanced(a,s||0,e||o.getSize(),i):n.drawArrays(a,s||0,e||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}};Fo.extension={type:[m.WebGLSystem],name:"geometry"}});var aP,Mb,Db,Fb=x(()=>{"use strict";C();pt();Js();lr();je();Wt();ht();Oe();aP=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),Mb=class tE{constructor(t){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=t}init(t={}){let{useBackBuffer:e,antialias:s}={...tE.defaultOptions,...t};this.useBackBuffer=e,this._antialias=s,this._renderer.context.supports.msaa||(k("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=Ut.for2d();let i=new Rt({vertex:`
|
|
748
748
|
attribute vec2 aPosition;
|
|
749
749
|
out vec2 vUv;
|
|
750
750
|
|
|
@@ -763,7 +763,7 @@ fn mainFragment(
|
|
|
763
763
|
|
|
764
764
|
void main() {
|
|
765
765
|
finalColor = texture(uTexture, vUv);
|
|
766
|
-
}`,name:"big-triangle"});this._bigTriangleShader=new Vt({glProgram:i,resources:{uTexture:D.WHITE.source}})}renderStart(t){let e=this._renderer.renderTarget.getRenderTarget(t.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!e.isRoot,this._useBackBufferThisRender){let s=this._renderer.renderTarget.getRenderTarget(t.target);this._targetTexture=s.colorTexture,t.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){let t=this._renderer;t.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(t.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,t.encoder.draw({geometry:
|
|
766
|
+
}`,name:"big-triangle"});this._bigTriangleShader=new Vt({glProgram:i,resources:{uTexture:D.WHITE.source}})}renderStart(t){let e=this._renderer.renderTarget.getRenderTarget(t.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!e.isRoot,this._useBackBufferThisRender){let s=this._renderer.renderTarget.getRenderTarget(t.target);this._targetTexture=s.colorTexture,t.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){let t=this._renderer;t.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(t.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,t.encoder.draw({geometry:aP,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(t){return this._backBufferTexture=this._backBufferTexture||new D({source:new st({width:t.width,height:t.height,resolution:t._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(t.width,t.height,t._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};Mb.extension={type:[m.WebGLSystem],name:"backBuffer",priority:1};Mb.defaultOptions={useBackBuffer:!1};Db=Mb});var Go,Gb=x(()=>{"use strict";C();Go=class{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.gl.colorMask(!!(t&8),!!(t&4),!!(t&2),!!(t&1)))}};Go.extension={type:[m.WebGLSystem],name:"colorMask"}});var Uo,Ub=x(()=>{"use strict";C();Uo=class{constructor(t){this.commandFinished=Promise.resolve(),this._renderer=t}setGeometry(t,e){this._renderer.geometry.bind(t,e.glProgram)}finishRenderPass(){}draw(t){let e=this._renderer,{geometry:s,shader:i,state:n,skipSync:o,topology:a,size:u,start:l,instanceCount:c}=t;e.shader.bind(i,o),e.geometry.bind(s,e.shader._activeProgram),n&&e.state.set(n),e.geometry.draw(a,u,l,c??s.instanceCount)}destroy(){this._renderer=null}};Uo.extension={type:[m.WebGLSystem],name:"encoder"}});var Io,Ib=x(()=>{"use strict";C();ld();Io=class{constructor(t){this._renderer=t}contextChange(){let t=this._renderer.gl;this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=Du(this.maxTextures,t);let e=this._renderer.context.webGLVersion===2;this.maxUniformBindings=e?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0}destroy(){}};Io.extension={type:[m.WebGLSystem],name:"limits"}});var ko,kb=x(()=>{"use strict";C();Pd();ni();ko=class{constructor(t){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:Dt.NONE},this._renderTargetStencilState=Object.create(null),t.renderTarget.onRenderTargetChange.add(this)}contextChange(t){this._gl=t,this._comparisonFuncMapping={always:t.ALWAYS,never:t.NEVER,equal:t.EQUAL,"not-equal":t.NOTEQUAL,less:t.LESS,"less-equal":t.LEQUAL,greater:t.GREATER,"greater-equal":t.GEQUAL},this._stencilOpsMapping={keep:t.KEEP,zero:t.ZERO,replace:t.REPLACE,invert:t.INVERT,"increment-clamp":t.INCR,"decrement-clamp":t.DECR,"increment-wrap":t.INCR_WRAP,"decrement-wrap":t.DECR_WRAP},this.resetState()}onRenderTargetChange(t){if(this._activeRenderTarget===t)return;this._activeRenderTarget=t;let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:Dt.DISABLED,stencilReference:0}),this.setStencilMode(e.stencilMode,e.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=Dt.NONE,this._stencilCache.stencilReference=0}setStencilMode(t,e){let s=this._renderTargetStencilState[this._activeRenderTarget.uid],i=this._gl,n=Dr[t],o=this._stencilCache;if(s.stencilMode=t,s.stencilReference=e,t===Dt.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,i.disable(i.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,i.enable(i.STENCIL_TEST)),(t!==o.stencilMode||o.stencilReference!==e)&&(o.stencilMode=t,o.stencilReference=e,i.stencilFunc(this._comparisonFuncMapping[n.stencilBack.compare],e,255),i.stencilOp(i.KEEP,i.KEEP,this._stencilOpsMapping[n.stencilBack.passOp]))}};ko.extension={type:[m.WebGLSystem],name:"stencil"}});function Ob(r){let t=r.map(n=>({data:n,offset:0,size:0})),e=16,s=0,i=0;for(let n=0;n<t.length;n++){let o=t[n];if(s=Ud[o.data.type],!s)throw new Error(`Unknown type ${o.data.type}`);o.data.size>1&&(s=Math.max(s,e)*o.data.size);let a=s===12?16:s;o.size=s;let u=i%e;u>0&&e-u<a?i+=(e-u)%16:i+=(s-u%s)%s,o.offset=i,i+=s}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}var Ud,Id=x(()=>{"use strict";Ud={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64}});function Lb(r,t){let e=Math.max(Ud[r.data.type]/16,1),s=r.data.value.length/r.data.size,i=(4-s%4)%4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
767
767
|
v = uv.${r.data.name};
|
|
768
768
|
offset += ${t};
|
|
769
769
|
|
|
@@ -779,7 +779,7 @@ fn mainFragment(
|
|
|
779
779
|
}
|
|
780
780
|
${i!==0?`arrayOffset += ${i};`:""}
|
|
781
781
|
}
|
|
782
|
-
`}var
|
|
782
|
+
`}var Nb=x(()=>{"use strict";Id()});function Hb(r){return Xu(r,"uboStd40",Lb,Cd)}var Wb=x(()=>{"use strict";Ed();Ad();Nb()});var Oo,Vb=x(()=>{"use strict";C();vd();Id();Wb();Oo=class extends Qi{constructor(){super({createUboElements:Ob,generateUboSync:Hb})}};Oo.extension={type:[m.WebGLSystem],name:"ubo"}});var sl,zb=x(()=>{"use strict";sl=class{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this._attachedMipLevel=0,this._attachedLayer=0,this.msaaRenderBuffer=[]}}});var il,Xb=x(()=>{"use strict";jt();pt();qs();Ui();zb();il=class{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new J}init(t,e){this._renderer=t,this._renderTargetSystem=e,t.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new J;let t=this._renderer.gl;this._drawBuffersCache=[];for(let e=1;e<=16;e++)this._drawBuffersCache[e]=Array.from({length:e},(s,i)=>t.COLOR_ATTACHMENT0+i)}copyToTexture(t,e,s,i,n){let o=this._renderTargetSystem,a=this._renderer,u=o.getGpuRenderTarget(t),l=a.gl;return this.finishRenderPass(t),l.bindFramebuffer(l.FRAMEBUFFER,u.resolveTargetFramebuffer),a.texture.bind(e,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,n.x,n.y,s.x,s.y,i.width,i.height),e}startRenderPass(t,e=!0,s,i,n=0,o=0){let a=this._renderTargetSystem,u=t.colorTexture,l=a.getGpuRenderTarget(t);if(o!==0&&this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to array layers requires WebGL2.");if(n>0){if(l.msaa)throw new Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.");if(this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to mip levels requires WebGL2.")}let c=i.y;t.isRoot&&(c=u.pixelHeight-i.height-i.y),t.colorTextures.forEach(f=>{this._renderer.texture.unbind(f)});let h=this._renderer.gl;h.bindFramebuffer(h.FRAMEBUFFER,l.framebuffer),!t.isRoot&&(l._attachedMipLevel!==n||l._attachedLayer!==o)&&(t.colorTextures.forEach((f,p)=>{let g=this._renderer.texture.getGlSource(f);if(g.target===h.TEXTURE_2D){if(o!==0)throw new Error("[RenderTargetSystem] layer must be 0 when rendering to 2D textures in WebGL.");h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0+p,h.TEXTURE_2D,g.texture,n)}else if(g.target===h.TEXTURE_2D_ARRAY){if(this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to 2D array textures requires WebGL2.");h.framebufferTextureLayer(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0+p,g.texture,n,o)}else if(g.target===h.TEXTURE_CUBE_MAP){if(o<0||o>5)throw new Error("[RenderTargetSystem] Cube map layer must be between 0 and 5.");h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0+p,h.TEXTURE_CUBE_MAP_POSITIVE_X+o,g.texture,n)}else throw new Error("[RenderTargetSystem] Unsupported texture target for render-to-layer in WebGL.")}),l._attachedMipLevel=n,l._attachedLayer=o),t.colorTextures.length>1&&this._setDrawBuffers(t,h);let d=this._viewPortCache;(d.x!==i.x||d.y!==c||d.width!==i.width||d.height!==i.height)&&(d.x=i.x,d.y=c,d.width=i.width,d.height=i.height,h.viewport(i.x,c,i.width,i.height)),!l.depthStencilRenderBuffer&&(t.stencil||t.depth)&&this._initStencil(l),this.clear(t,e,s)}finishRenderPass(t){let s=this._renderTargetSystem.getGpuRenderTarget(t);if(!s.msaa)return;let i=this._renderer.gl;i.bindFramebuffer(i.FRAMEBUFFER,s.resolveTargetFramebuffer),i.bindFramebuffer(i.READ_FRAMEBUFFER,s.framebuffer),i.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,i.COLOR_BUFFER_BIT,i.NEAREST),i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(t){let s=this._renderer.gl,i=new sl;return i._attachedMipLevel=0,i._attachedLayer=0,t.colorTexture instanceof ne?(this._renderer.context.ensureCanvasSize(t.colorTexture.resource),i.framebuffer=null,i):(this._initColor(t,i),s.bindFramebuffer(s.FRAMEBUFFER,null),i)}destroyGpuRenderTarget(t){let e=this._renderer.gl;t.framebuffer&&(e.deleteFramebuffer(t.framebuffer),t.framebuffer=null),t.resolveTargetFramebuffer&&(e.deleteFramebuffer(t.resolveTargetFramebuffer),t.resolveTargetFramebuffer=null),t.depthStencilRenderBuffer&&(e.deleteRenderbuffer(t.depthStencilRenderBuffer),t.depthStencilRenderBuffer=null),t.msaaRenderBuffer.forEach(s=>{e.deleteRenderbuffer(s)}),t.msaaRenderBuffer=null}clear(t,e,s,i,n=0,o=0){if(!e)return;if(o!==0)throw new Error("[RenderTargetSystem] Clearing array layers is not supported in WebGL renderer.");let a=this._renderTargetSystem;typeof e=="boolean"&&(e=e?ue.ALL:ue.NONE);let u=this._renderer.gl;if(e&ue.COLOR){s??(s=a.defaultClearColor);let l=this._clearColorCache,c=s;(l[0]!==c[0]||l[1]!==c[1]||l[2]!==c[2]||l[3]!==c[3])&&(l[0]=c[0],l[1]=c[1],l[2]=c[2],l[3]=c[3],u.clearColor(c[0],c[1],c[2],c[3]))}u.clear(e)}resizeGpuRenderTarget(t){if(t.isRoot)return;let s=this._renderTargetSystem.getGpuRenderTarget(t);this._resizeColor(t,s),(t.stencil||t.depth)&&this._resizeStencil(s)}_initColor(t,e){let s=this._renderer,i=s.gl,n=i.createFramebuffer();if(e.resolveTargetFramebuffer=n,i.bindFramebuffer(i.FRAMEBUFFER,n),e.width=t.colorTexture.source.pixelWidth,e.height=t.colorTexture.source.pixelHeight,t.colorTextures.forEach((a,u)=>{let l=a.source;l.antialias&&(s.context.supports.msaa?e.msaa=!0:k("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(l,0);let c=s.texture.getGlSource(l),h=c.texture;if(c.target===i.TEXTURE_2D)i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,i.TEXTURE_2D,h,0);else if(c.target===i.TEXTURE_2D_ARRAY){if(s.context.webGLVersion<2)throw new Error("[RenderTargetSystem] TEXTURE_2D_ARRAY requires WebGL2.");i.framebufferTextureLayer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,h,0,0)}else if(c.target===i.TEXTURE_CUBE_MAP)i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+u,i.TEXTURE_CUBE_MAP_POSITIVE_X,h,0);else throw new Error("[RenderTargetSystem] Unsupported texture target for framebuffer attachment.")}),e.msaa){let a=i.createFramebuffer();e.framebuffer=a,i.bindFramebuffer(i.FRAMEBUFFER,a),t.colorTextures.forEach((u,l)=>{let c=i.createRenderbuffer();e.msaaRenderBuffer[l]=c})}else e.framebuffer=n;this._resizeColor(t,e)}_resizeColor(t,e){let s=t.colorTexture.source;if(e.width=s.pixelWidth,e.height=s.pixelHeight,e._attachedMipLevel=0,e._attachedLayer=0,t.colorTextures.forEach((i,n)=>{n!==0&&i.source.resize(s.width,s.height,s._resolution)}),e.msaa){let i=this._renderer,n=i.gl,o=e.framebuffer;n.bindFramebuffer(n.FRAMEBUFFER,o),t.colorTextures.forEach((a,u)=>{let l=a.source;i.texture.bindSource(l,0);let h=i.texture.getGlSource(l).internalFormat,d=e.msaaRenderBuffer[u];n.bindRenderbuffer(n.RENDERBUFFER,d),n.renderbufferStorageMultisample(n.RENDERBUFFER,4,h,l.pixelWidth,l.pixelHeight),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+u,n.RENDERBUFFER,d)})}}_initStencil(t){if(t.framebuffer===null)return;let e=this._renderer.gl,s=e.createRenderbuffer();t.depthStencilRenderBuffer=s,e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,s),this._resizeStencil(t)}_resizeStencil(t){let e=this._renderer.gl;e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilRenderBuffer),t.msaa?e.renderbufferStorageMultisample(e.RENDERBUFFER,4,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,this._renderer.context.webGLVersion===2?e.DEPTH24_STENCIL8:e.DEPTH_STENCIL,t.width,t.height)}prerender(t){let e=t.colorTexture.resource;this._renderer.context.multiView&&ne.test(e)&&this._renderer.context.ensureCanvasSize(e)}postrender(t){if(this._renderer.context.multiView&&ne.test(t.colorTexture.resource)){let e=this._renderer.context.canvas,s=t.colorTexture;s.context2D.drawImage(e,0,s.pixelHeight-e.height)}}_setDrawBuffers(t,e){let s=t.colorTextures.length,i=this._drawBuffersCache[s];if(this._renderer.context.webGLVersion===1){let n=this._renderer.context.extensions.drawBuffers;n?n.drawBuffersWEBGL(i):k("[RenderTexture] This WebGL1 context does not support rendering to multiple targets")}else e.drawBuffers(i)}}});var Lo,$b=x(()=>{"use strict";C();qu();Xb();Lo=class extends gs{constructor(t){super(t),this.adaptor=new il,this.adaptor.init(t,this)}};Lo.extension={type:[m.WebGLSystem],name:"renderTarget"}});function Yb(r,t){let e=[],s=[`
|
|
783
783
|
var g = s.groups;
|
|
784
784
|
var sS = r.shader;
|
|
785
785
|
var p = s.glProgram;
|
|
@@ -806,10 +806,10 @@ fn mainFragment(
|
|
|
806
806
|
`)),t._gl.uniform1i(f.location,n),e.push(`
|
|
807
807
|
tS.bind(resources[${c}], ${n});
|
|
808
808
|
`),n++)}}}let a=[...s,...e].join(`
|
|
809
|
-
`);return new Function("r","s","sD",a)}var
|
|
809
|
+
`);return new Function("r","s","sD",a)}var jb=x(()=>{"use strict";$u();te();Wt()});var qb,nl,Kb=x(()=>{"use strict";qb=class{},nl=class{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}});function kd(r,t,e){let s=r.createShader(t);return r.shaderSource(s,e),r.compileShader(s),s}var Zb=x(()=>{"use strict"});function Qb(r){let t=new Array(r);for(let e=0;e<t.length;e++)t[e]=!1;return t}function ol(r,t){switch(r){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 Qb(2*t);case"bvec3":return Qb(3*t);case"bvec4":return Qb(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}var Od=x(()=>{"use strict"});function Nd(r,t){if(!Ld){let e=Object.keys(eE);Ld={};for(let s=0;s<e.length;++s){let i=e[s];Ld[r[i]]=eE[i]}}return Ld[t]}function Jb(r,t){let e=Nd(r,t);return uP[e]||"float32"}var Ld,eE,uP,Hd=x(()=>{"use strict";Ld=null,eE={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"},uP={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"}});function t0(r,t,e=!1){let s={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES);for(let o=0;o<i;o++){let a=t.getActiveAttrib(r,o);if(a.name.startsWith("gl_"))continue;let u=Jb(t,a.type);s[a.name]={location:0,format:u,stride:Le(u).stride,offset:0,instance:!1,start:0}}let n=Object.keys(s);if(e){n.sort((o,a)=>o>a?1:-1);for(let o=0;o<n.length;o++)s[n[o]].location=o,t.bindAttribLocation(r,o,n[o]);t.linkProgram(r)}else for(let o=0;o<n.length;o++)s[n[o]].location=t.getAttribLocation(r,n[o]);return s}var e0=x(()=>{"use strict";Qs();Hd()});function r0(r,t){if(!t.ACTIVE_UNIFORM_BLOCKS)return{};let e={},s=t.getProgramParameter(r,t.ACTIVE_UNIFORM_BLOCKS);for(let i=0;i<s;i++){let n=t.getActiveUniformBlockName(r,i),o=t.getUniformBlockIndex(r,n),a=t.getActiveUniformBlockParameter(r,i,t.UNIFORM_BLOCK_DATA_SIZE);e[n]={name:n,index:o,size:a}}return e}var s0=x(()=>{"use strict"});function i0(r,t){let e={},s=t.getProgramParameter(r,t.ACTIVE_UNIFORMS);for(let i=0;i<s;i++){let n=t.getActiveUniform(r,i),o=n.name.replace(/\[.*?\]$/,""),a=!!n.name.match(/\[.*?\]$/),u=Nd(t,n.type);e[o]={name:o,index:i,type:u,size:n.size,isArray:a,value:ol(u,n.size)}}return e}var n0=x(()=>{"use strict";Od();Hd()});function rE(r,t){let e=r.getShaderSource(t);if(e===null){console.error("PixiJS Error: Could not retrieve shader source (WebGL context may be lost).");return}let s=e.split(`
|
|
810
810
|
`).map((c,h)=>`${h}: ${c}`),i=r.getShaderInfoLog(t)??"",n=i.split(`
|
|
811
811
|
`),o={},a=n.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!o[c]?(o[c]=!0,!0):!1),u=[""];a.forEach(c=>{s[c-1]=`%c${s[c-1]}%c`,u.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});let l=s.join(`
|
|
812
|
-
`);u[0]=l,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...u),console.groupEnd()}function
|
|
812
|
+
`);u[0]=l,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...u),console.groupEnd()}function o0(r,t,e,s){r.getProgramParameter(t,r.LINK_STATUS)||(r.getShaderParameter(e,r.COMPILE_STATUS)||rE(r,e),r.getShaderParameter(s,r.COMPILE_STATUS)||rE(r,s),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(t)))}var a0=x(()=>{"use strict"});function u0(r,t){let e=kd(r,r.VERTEX_SHADER,t.vertex),s=kd(r,r.FRAGMENT_SHADER,t.fragment),i=r.createProgram();r.attachShader(i,e),r.attachShader(i,s);let n=t.transformFeedbackVaryings;n&&(typeof r.transformFeedbackVaryings!="function"?k("TransformFeedback is not supported but TransformFeedbackVaryings are given."):r.transformFeedbackVaryings(i,n.names,n.bufferMode==="separate"?r.SEPARATE_ATTRIBS:r.INTERLEAVED_ATTRIBS)),r.linkProgram(i),r.getProgramParameter(i,r.LINK_STATUS)||o0(r,i,e,s),t._attributeData=t0(i,r,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertex)),t._uniformData=i0(i,r),t._uniformBlockData=r0(i,r),r.deleteShader(e),r.deleteShader(s);let o={};for(let u in t._uniformData){let l=t._uniformData[u];o[u]={location:r.getUniformLocation(i,u),value:ol(l.type,l.size)}}return new nl(i,o)}var l0=x(()=>{"use strict";pt();Kb();Zb();Od();e0();s0();n0();a0()});var Wd,No,c0=x(()=>{"use strict";C();jb();l0();Wd={textureCount:0,blockIndex:0},No=class{constructor(t){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=t}contextChange(t){this._gl=t,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(t,e){if(this._setProgram(t.glProgram),e)return;Wd.textureCount=0,Wd.blockIndex=0;let s=this._shaderSyncFunctions[t.glProgram._key];s||(s=this._shaderSyncFunctions[t.glProgram._key]=this._generateShaderSync(t,this)),this._renderer.buffer.nextBindBase(!!t.glProgram.transformFeedbackVaryings),s(this._renderer,t,Wd)}updateUniformGroup(t){this._renderer.uniformGroup.updateUniformGroup(t,this._activeProgram,Wd)}bindUniformBlock(t,e,s=0){let i=this._renderer.buffer,n=this._getProgramData(this._activeProgram),o=t._bufferResource;o||this._renderer.ubo.updateUniformGroup(t);let a=t.buffer,u=i.updateBuffer(a),l=i.freeLocationForBufferBase(u);if(o){let{offset:h,size:d}=t;h===0&&d===a.data.byteLength?i.bindBufferBase(u,l):i.bindBufferRange(u,l,h)}else i.getLastBindBaseLocation(u)!==l&&i.bindBufferBase(u,l);let c=this._activeProgram._uniformBlockData[e].index;n.uniformBlockBindings[s]!==l&&(n.uniformBlockBindings[s]=l,this._renderer.gl.uniformBlockBinding(n.program,c,l))}_setProgram(t){if(this._activeProgram===t)return;this._activeProgram=t;let e=this._getProgramData(t);this._gl.useProgram(e.program)}_getProgramData(t){return this._programDataHash[t._key]||this._createProgramData(t)}_createProgramData(t){let e=t._key;return this._programDataHash[e]=u0(this._gl,t),this._programDataHash[e]}destroy(){for(let t of Object.keys(this._programDataHash))this._programDataHash[t].destroy();this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null}_generateShaderSync(t,e){return Yb(t,e)}resetState(){this._activeProgram=null}};No.extension={type:[m.WebGLSystem],name:"shader"}});var h0,d0,f0=x(()=>{"use strict";h0={f32:`if (cv !== v) {
|
|
813
813
|
cu.value = v;
|
|
814
814
|
gl.uniform1f(location, v);
|
|
815
815
|
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
@@ -881,7 +881,7 @@ fn mainFragment(
|
|
|
881
881
|
cv[2] = v[2];
|
|
882
882
|
cv[3] = v[3];
|
|
883
883
|
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
884
|
-
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},
|
|
884
|
+
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},d0={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"}});function p0(r,t){let e=[`
|
|
885
885
|
var v = null;
|
|
886
886
|
var cv = null;
|
|
887
887
|
var cu = null;
|
|
@@ -894,26 +894,26 @@ fn mainFragment(
|
|
|
894
894
|
renderer.shader.updateUniformGroup(uv.${s});
|
|
895
895
|
`):r.uniforms[s]instanceof ms&&e.push(`
|
|
896
896
|
renderer.shader.bindBufferResource(uv.${s}, "${s}");
|
|
897
|
-
`);continue}let i=r.uniformStructures[s],n=!1;for(let o=0;o<Vr.length;o++){let a=Vr[o];if(i.type===a.type&&a.test(i)){e.push(`name = "${s}";`,Vr[o].uniform),n=!0;break}}if(!n){let a=(i.size===1?
|
|
897
|
+
`);continue}let i=r.uniformStructures[s],n=!1;for(let o=0;o<Vr.length;o++){let a=Vr[o];if(i.type===a.type&&a.test(i)){e.push(`name = "${s}";`,Vr[o].uniform),n=!0;break}}if(!n){let a=(i.size===1?h0:d0)[i.type].replace("location",`ud["${s}"].location`);e.push(`
|
|
898
898
|
cu = ud["${s}"];
|
|
899
899
|
cv = cu.value;
|
|
900
900
|
v = uv["${s}"];
|
|
901
901
|
${a};`)}}return new Function("ud","uv","renderer","syncData",e.join(`
|
|
902
|
-
`))}var p0=x(()=>{"use strict";Xu();te();Sd();d0()});var Lo,m0=x(()=>{"use strict";C();p0();Lo=class{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,s){let i=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==i.uniformDirtyGroups[t.uid])&&(i.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(i.uniformData,t.uniforms,this._renderer,s))}_getUniformSyncFunction(t,e){return this._uniformGroupSyncHash[t._signature]?.[e._key]||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){let s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),i=this._getSignature(t,e._uniformData,"u");return this._cache[i]||(this._cache[i]=this._generateUniformsSync(t,e._uniformData)),s[e._key]=this._cache[i],s[e._key]}_generateUniformsSync(t,e){return f0(t,e)}_getSignature(t,e,s){let i=t.uniforms,n=[`${s}-`];for(let o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}};Lo.extension={type:[m.WebGLSystem],name:"uniformGroup"}});function g0(r){let t={};if(t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof N.get().getWebGLRenderingContext()))t.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],t.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else{let s=r.getExtension("EXT_blend_minmax");s&&(t.min=[r.ONE,r.ONE,r.ONE,r.ONE,s.MIN_EXT,s.MIN_EXT],t.max=[r.ONE,r.ONE,r.ONE,r.ONE,s.MAX_EXT,s.MAX_EXT])}return t}var x0=x(()=>{"use strict";mt()});var uP,lP,cP,hP,dP,fP,eE,b0,y0=x(()=>{"use strict";C();je();x0();uP=0,lP=1,cP=2,hP=3,dP=4,fP=5,eE=class _0{constructor(t){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[uP]=this.setBlend,this.map[lP]=this.setOffset,this.map[cP]=this.setCullFace,this.map[hP]=this.setDepthTest,this.map[dP]=this.setFrontFace,this.map[fP]=this.setDepthMask,this.checks=[],this.defaultState=Ut.for2d(),t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){this._invertFrontFace=!t.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(t){this.gl=t,this.blendModesMap=g0(t),this.resetState()}set(t){if(t||(t=this.defaultState),this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e>>=1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t||(t=this.defaultState);for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(_0._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(_0._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this._cullFace=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(t){this._frontFace=t,this._frontFaceDirty=!1;let e=this._invertFrontFace?!t:t;this._glFrontFace!==e&&(this._glFrontFace=e,this.gl.frontFace(this.gl[e?"CW":"CCW"]))}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;let e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){let s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};eE.extension={type:[m.WebGLSystem],name:"state"};b0=eE});var Zi,Vd=x(()=>{"use strict";el();Zi=class{constructor(t){this.target=Ro.TEXTURE_2D,this._layerInitMask=0,this.texture=t,this.width=-1,this.height=-1,this.type=bt.UNSIGNED_BYTE,this.internalFormat=tl.RGBA,this.format=tl.RGBA,this.samplerType=0}destroy(){}}});var v0,T0=x(()=>{"use strict";v0={id:"buffer",upload(r,t,e,s,i,n=!1){let o=i||t.target;!n&&t.width===r.width&&t.height===r.height?e.texSubImage2D(o,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(o,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}}});var pP,S0,E0=x(()=>{"use strict";pP={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},S0={id:"compressed",upload(r,t,e,s,i,n){let o=i??t.target;e.pixelStorei(e.UNPACK_ALIGNMENT,4);let a=r.pixelWidth,u=r.pixelHeight,l=!!pP[r.format];for(let c=0;c<r.resource.length;c++){let h=r.resource[c];l?e.compressedTexImage2D(o,c,t.internalFormat,a,u,0,h):e.texImage2D(o,c,t.internalFormat,a,u,0,t.format,t.type,h),a=Math.max(a>>1,1),u=Math.max(u>>1,1)}}}});function C0(r){return{id:"cube",upload(t,e,s,i){let n=t.faces;for(let o=0;o<rE.length;o++){let a=rE[o],u=n[a];(r[u.uploadMethodId]||r.image).upload(u,e,s,i,Ro.TEXTURE_CUBE_MAP_POSITIVE_X+o,(e._layerInitMask&1<<o)===0),e._layerInitMask|=1<<o}e.width=t.pixelWidth,e.height=t.pixelHeight}}}var rE,A0=x(()=>{"use strict";el();rE=["right","left","top","bottom","front","back"]});function mP(r,t,e,s,i,n,o,a,u,l){if(!l){u&&r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,null),r.texSubImage2D(t,0,0,0,n,o,e.format,e.type,a);return}if(!u){r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,a)}function gP(r,t,e,s,i,n,o,a,u,l){if(!l){u&&r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,null),r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}if(!u){r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}r.texImage2D(t,0,e.internalFormat,e.format,e.type,a)}var ol,zd=x(()=>{"use strict";ol={id:"image",upload(r,t,e,s,i,n=!1){let o=i||t.target,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight,h=s===2,d=n||t.width!==a||t.height!==u,f=l>=a&&c>=u,p=r.resource;(h?mP:gP)(e,o,t,a,u,l,c,p,d,f),t.width=a,t.height=u}}});function al(){let{userAgent:r}=N.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(r)}var Xd=x(()=>{"use strict";mt()});var xP,w0,P0=x(()=>{"use strict";Xd();zd();xP=al(),w0={id:"video",upload(r,t,e,s,i,n=xP){if(!r.isValid){let o=i??t.target;e.texImage2D(o,0,t.internalFormat,1,1,0,t.format,t.type,null);return}ol.upload(r,t,e,s,i,n)}}});var $d,B0,ul,R0,M0=x(()=>{"use strict";$d={linear:9729,nearest:9728},B0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},ul={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},R0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519}});function Yd(r,t,e,s,i,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=ul[o?"clamp-to-edge":r.addressModeU],c=ul[o?"clamp-to-edge":r.addressModeV],h=ul[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,h)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,$d[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){let l=B0[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,$d[r.minFilter]);if(s&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,R0[r.compare])}var D0=x(()=>{"use strict";M0()});function F0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var G0=x(()=>{"use strict"});function U0(r,t){let e={},s=r.RGBA;return r instanceof N.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...e,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var I0=x(()=>{"use strict";mt()});function k0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var O0=x(()=>{"use strict"});function L0(r){return{"2d":r.TEXTURE_2D,cube:r.TEXTURE_CUBE_MAP,"1d":null,"3d":r?.TEXTURE_3D||null,"2d-array":r?.TEXTURE_2D_ARRAY||null,"cube-array":r?.TEXTURE_CUBE_MAP_ARRAY||null}}var N0=x(()=>{"use strict"});function _P(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let t=r.length;for(let e=0;e<t;e+=4){let s=r[e+3];if(s!==0){let i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}var sE=x(()=>{"use strict"});var bP,H0,jd,W0=x(()=>{"use strict";mt();C();ye();ht();Vd();T0();E0();A0();zd();P0();D0();G0();I0();O0();N0();bP=4,H0=class iE{constructor(t){this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=t,this._managedTextures=new vt({renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"});let e={image:ol,buffer:v0,video:w0,compressed:S0,...iE.uploadExtensions};this._uploads={...e,cube:C0(e)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=U0(t,this._renderer.context.extensions),this._mapFormatToType=k0(t),this._mapFormatToFormat=F0(t),this._mapViewDimensionToGlTarget=L0(t)),this._managedTextures.removeAll(!0),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let e=0;e<16;e++)this.bind(D.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){let s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){let s=this._gl;if(t._gcLastUsed=this._renderer.gc.now,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t||(t=D.EMPTY.source);let i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){let s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}let i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){let e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);let o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){let e=this._gl,s=new Zi(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],s.target=this._mapViewDimensionToGlTarget[t.viewDimension],s.target===null)throw new Error(`Unsupported view dimension: ${t.viewDimension} with this webgl version: ${this._renderer.context.webGLVersion}`);if(t.uploadMethodId==="cube"&&(s.target=e.TEXTURE_CUBE_MAP),t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){let n=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(n))+1}return t._gpuData[this._renderer.uid]=s,this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){let s=this._gl,i=this.getGlSource(t);s.bindTexture(i.target,i.texture),this._boundTextures[this._activeTextureLocation]=t,Yd(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.target,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];s&&(e||(this.unbind(t),this._gl.deleteTexture(s.texture)),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this))}onSourceUpdate(t){let e=this._gl,s=this.getGlSource(t);e.bindTexture(s.target,s.texture),this._boundTextures[this._activeTextureLocation]=t;let i=t.alphaMode==="premultiply-alpha-on-upload";if(this._premultiplyAlpha!==i&&(this._premultiplyAlpha=i,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i)),this._uploads[t.uploadMethodId])this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion);else if(s.target===e.TEXTURE_2D)this._initEmptyTexture2D(s,t);else if(s.target===e.TEXTURE_2D_ARRAY)this._initEmptyTexture2DArray(s,t);else if(s.target===e.TEXTURE_CUBE_MAP)this._initEmptyTextureCube(s,t);else throw new Error("[GlTextureSystem] Unsupported texture target for empty allocation.");this._applyMipRange(s,t),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);let s=this.getGlSource(t);this._gl.generateMipmap(s.target)}_initEmptyTexture2D(t,e){let s=this._gl;s.texImage2D(s.TEXTURE_2D,0,t.internalFormat,e.pixelWidth,e.pixelHeight,0,t.format,t.type,null);let i=Math.max(e.pixelWidth>>1,1),n=Math.max(e.pixelHeight>>1,1);for(let o=1;o<e.mipLevelCount;o++)s.texImage2D(s.TEXTURE_2D,o,t.internalFormat,i,n,0,t.format,t.type,null),i=Math.max(i>>1,1),n=Math.max(n>>1,1)}_initEmptyTexture2DArray(t,e){if(this._renderer.context.webGLVersion!==2)throw new Error("[GlTextureSystem] TEXTURE_2D_ARRAY requires WebGL2.");let s=this._gl,i=Math.max(e.arrayLayerCount|0,1);s.texImage3D(s.TEXTURE_2D_ARRAY,0,t.internalFormat,e.pixelWidth,e.pixelHeight,i,0,t.format,t.type,null);let n=Math.max(e.pixelWidth>>1,1),o=Math.max(e.pixelHeight>>1,1);for(let a=1;a<e.mipLevelCount;a++)s.texImage3D(s.TEXTURE_2D_ARRAY,a,t.internalFormat,n,o,i,0,t.format,t.type,null),n=Math.max(n>>1,1),o=Math.max(o>>1,1)}_initEmptyTextureCube(t,e){let s=this._gl,i=6;for(let a=0;a<i;a++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,t.internalFormat,e.pixelWidth,e.pixelHeight,0,t.format,t.type,null);let n=Math.max(e.pixelWidth>>1,1),o=Math.max(e.pixelHeight>>1,1);for(let a=1;a<e.mipLevelCount;a++){for(let u=0;u<i;u++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+u,a,t.internalFormat,n,o,0,t.format,t.type,null);n=Math.max(n>>1,1),o=Math.max(o>>1,1)}}_applyMipRange(t,e){if(this._renderer.context.webGLVersion!==2||e.mipLevelCount<=1)return;let s=this._gl,i=Math.max((e.mipLevelCount|0)-1,0);s.texParameteri(t.target,s.TEXTURE_BASE_LEVEL,0),s.texParameteri(t.target,s.TEXTURE_MAX_LEVEL,i)}_initSampler(t){let e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,Yd(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this._initSource(t)}generateCanvas(t){let{pixels:e,width:s,height:i}=this.getPixels(t),n=N.get().createCanvas();n.width=s,n.height=i;let o=n.getContext("2d");if(o){let a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){let e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(bP*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this._managedTextures.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(D.EMPTY.source),this._boundSamplers=Object.create(null);let t=this._gl;this._premultiplyAlpha=!1,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}};H0.extension={type:[m.WebGLSystem],name:"texture"};H0.uploadExtensions=Object.create(null);jd=H0;O.handleByMap(m.TextureUploaderWebGL,jd.uploadExtensions)});var uE={};Ec(uE,{WebGLRenderer:()=>qd});var yP,vP,TP,nE,oE,aE,qd,V0=x(()=>{"use strict";C();_b();bb();yb();Ui();Vu();Pe();Sb();Ab();Bb();Db();Fb();Gb();Ub();Ib();Wb();Xb();l0();m0();y0();W0();yP=[...ji,Io,Mb,Cb,Go,Bo,jd,ko,Mo,Lo,Oo,Fo,b0,Uo,Do],vP=[...Wu],TP=[wo,Ao,Co],nE=[],oE=[],aE=[];O.handleByNamedList(m.WebGLSystem,nE);O.handleByNamedList(m.WebGLPipes,oE);O.handleByNamedList(m.WebGLPipesAdaptor,aE);O.add(...yP,...vP,...TP);qd=class extends Er{constructor(){let t={name:"webgl",type:Tt.WEBGL,systems:nE,renderPipes:oE,renderPipeAdaptors:aE};super(t)}}});var z0,X0,lE=x(()=>{"use strict";z0=1e-4,X0=1e-4});function $0(r){let t=r.length;if(t<6)return 1;let e=0;for(let s=0,i=r[t-2],n=r[t-1];s<t;s+=2){let o=r[s],a=r[s+1];e+=(o-i)*(a+n),i=o,n=a}return e<0?-1:1}var Y0=x(()=>{"use strict"});function cE(r,t,e,s,i,n,o,a){let u=r-e*i,l=t-s*i,c=r+e*n,h=t+s*n,d,f;o?(d=s,f=-e):(d=-s,f=e);let p=u+d,g=l+f,_=c+d,b=h+f;return a.push(p,g),a.push(_,b),2}function Qi(r,t,e,s,i,n,o,a){let u=e-r,l=s-t,c=Math.atan2(u,l),h=Math.atan2(i-r,n-t);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,f=h-c,p=Math.abs(f),g=Math.sqrt(u*u+l*l),_=(15*p*Math.sqrt(g)/Math.PI>>0)+1,b=f/_;if(d+=b,a){o.push(r,t),o.push(e,s);for(let y=1,v=d;y<_;y++,v+=b)o.push(r,t),o.push(r+Math.sin(v)*g,t+Math.cos(v)*g);o.push(r,t),o.push(i,n)}else{o.push(e,s),o.push(r,t);for(let y=1,v=d;y<_;y++,v+=b)o.push(r+Math.sin(v)*g,t+Math.cos(v)*g),o.push(r,t);o.push(i,n),o.push(r,t)}return _*2}function Ji(r,t,e,s,i,n){let o=1e-4;if(r.length===0)return;let a=t,u=a.alignment;if(t.alignment!==.5){let L=$0(r);e&&(L*=-1),u=(u-.5)*L+.5}let l=new nt(r[0],r[1]),c=new nt(r[r.length-2],r[r.length-1]),h=s,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let L=(l.x+c.x)*.5,K=(c.y+l.y)*.5;r.unshift(L,K),r.push(L,K)}let f=i,p=r.length/2,g=r.length,_=f.length/2,b=a.width/2,y=b*b,v=a.miterLimit*a.miterLimit,T=r[0],S=r[1],E=r[2],w=r[3],M=0,P=0,R=-(S-w),A=T-E,G=0,H=0,W=Math.sqrt(R*R+A*A);R/=W,A/=W,R*=b,A*=b;let $=u,B=(1-$)*2,U=$*2;h||(a.cap==="round"?g+=Qi(T-R*(B-U)*.5,S-A*(B-U)*.5,T-R*B,S-A*B,T+R*U,S+A*U,f,!0)+2:a.cap==="square"&&(g+=cE(T,S,R,A,B,U,!0,f))),f.push(T-R*B,S-A*B),f.push(T+R*U,S+A*U);for(let L=1;L<p-1;++L){T=r[(L-1)*2],S=r[(L-1)*2+1],E=r[L*2],w=r[L*2+1],M=r[(L+1)*2],P=r[(L+1)*2+1],R=-(S-w),A=T-E,W=Math.sqrt(R*R+A*A),R/=W,A/=W,R*=b,A*=b,G=-(w-P),H=E-M,W=Math.sqrt(G*G+H*H),G/=W,H/=W,G*=b,H*=b;let K=E-T,gt=S-w,ft=E-M,Y=P-w,Q=K*ft+gt*Y,j=gt*ft-Y*K,Pt=j<0;if(Math.abs(j)<.001*Math.abs(Q)){f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),Q>=0&&(a.join==="round"?g+=Qi(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+4:g+=2,f.push(E-G*U,w-H*U),f.push(E+G*B,w+H*B));continue}let Ht=(-R+T)*(-A+w)-(-R+E)*(-A+S),Me=(-G+M)*(-H+w)-(-G+E)*(-H+P),De=(K*Me-ft*Ht)/j,se=(Y*Ht-gt*Me)/j,Fe=(De-E)*(De-E)+(se-w)*(se-w),ie=E+(De-E)*B,tr=w+(se-w)*B,er=E-(De-E)*U,mr=w-(se-w)*U,Fs=Math.min(K*K+gt*gt,ft*ft+Y*Y),ts=Pt?B:U,ka=Fs+ts*ts*y;Fe<=ka?a.join==="bevel"||Fe/y>v?(Pt?(f.push(ie,tr),f.push(E+R*U,w+A*U),f.push(ie,tr),f.push(E+G*U,w+H*U)):(f.push(E-R*B,w-A*B),f.push(er,mr),f.push(E-G*B,w-H*B),f.push(er,mr)),g+=2):a.join==="round"?Pt?(f.push(ie,tr),f.push(E+R*U,w+A*U),g+=Qi(E,w,E+R*U,w+A*U,E+G*U,w+H*U,f,!0)+4,f.push(ie,tr),f.push(E+G*U,w+H*U)):(f.push(E-R*B,w-A*B),f.push(er,mr),g+=Qi(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+4,f.push(E-G*B,w-H*B),f.push(er,mr)):(f.push(ie,tr),f.push(er,mr)):(f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),a.join==="round"?Pt?g+=Qi(E,w,E+R*U,w+A*U,E+G*U,w+H*U,f,!0)+2:g+=Qi(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+2:a.join==="miter"&&Fe/y<=v&&(Pt?(f.push(er,mr),f.push(er,mr)):(f.push(ie,tr),f.push(ie,tr)),g+=2),f.push(E-G*B,w-H*B),f.push(E+G*U,w+H*U),g+=2)}T=r[(p-2)*2],S=r[(p-2)*2+1],E=r[(p-1)*2],w=r[(p-1)*2+1],R=-(S-w),A=T-E,W=Math.sqrt(R*R+A*A),R/=W,A/=W,R*=b,A*=b,f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),h||(a.cap==="round"?g+=Qi(E-R*(B-U)*.5,w-A*(B-U)*.5,E-R*B,w-A*B,E+R*U,w+A*U,f,!1)+2:a.cap==="square"&&(g+=cE(E,w,R,A,B,U,!1,f)));let z=1e-4*1e-4;for(let L=_;L<g+_-2;++L)T=f[L*2],S=f[L*2+1],E=f[(L+1)*2],w=f[(L+1)*2+1],M=f[(L+2)*2],P=f[(L+2)*2+1],!(Math.abs(T*(w-P)+E*(P-S)+M*(S-w))<z)&&n.push(L,L+1,L+2)}var ll=x(()=>{"use strict";Ue();Y0()});function dE(r,t){for(let e=0;e<t.length;e++){let s=t[e];r.addColorStop(s.offset,s.color)}}function fE(r,t){let e=N.get().createCanvas(r,t),s=e.getContext("2d");return{canvas:e,context:s}}function SP(r){let t=r[0]??{};return(typeof t=="number"||r[1])&&(I("8.5.2","use options object instead"),t={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??Nt.defaultLinearOptions.textureSize}),t}var hE,q0,Nt,zr=x(()=>{"use strict";It();mt();ot();Ci();ht();Yt();xt();Ls();hE=[{offset:0,color:"white"},{offset:1,color:"black"}],q0=class j0{constructor(...t){this.uid=et("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let e=SP(t);e={...e.type==="radial"?j0.defaultRadialOptions:j0.defaultLinearOptions,...xe(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(i=>{this.addColorStop(i.offset,i.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:X.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:s,y:i}=this.end,n=s-t,o=i-e,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let _=t;t=s,s=_,n*=-1}if(o<0){let _=e;e=i,i=_,o*=-1}}let u=this.colorStops.length?this.colorStops:hE,l=this._textureSize,{canvas:c,context:h}=fE(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);dE(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new D({source:new ke({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),p=Math.atan2(o,n),g=new F;g.scale(f/l,1),g.rotate(p),g.translate(t,e),this.textureSpace==="local"&&g.scale(l,l),this.transform=g}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let t=this.colorStops.length?this.colorStops:hE,e=this._textureSize,{canvas:s,context:i}=fE(e,e),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,f=e/(c*2),p=(n-h)*f,g=(o-d)*f,_=i.createRadialGradient(p,g,l*f,(a-h)*f,(u-d)*f,c*f);dE(_,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=_,i.translate(p,g),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-p,-g),i.fillRect(0,0,e,e),this.texture=new D({source:new ke({resource:s,addressMode:this._wrapMode})});let b=new F;this.textureSpace==="local"?b.scale(2*c,2*c):b.scale(1/f,1/f),b.translate(h,d),this.transform=b}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};q0.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};q0.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,rotation:0,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};Nt=q0});function EP(r){return r.texture!==void 0}var pE,hr,No=x(()=>{"use strict";ot();Yt();pE={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},hr=class{constructor(t,e){this.uid=et("fillPattern"),this._tick=0,this.transform=new F;let s=EP(t)?t:{texture:t,repetition:e};this.texture=s.texture,this.textureSpace=s.textureSpace??"global";let i=s.repetition;i&&(this.texture.source.style.addressModeU=pE[i].addressModeU,this.texture.source.style.addressModeV=pE[i].addressModeV)}setTransform(t){if(t){if(this.transform.equals(t))return;this.transform.copyFrom(t)}else{if(this.transform.isIdentity())return;this.transform.identity()}this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}});function cl(r,t,e,s,i,n,o,a=null){let u=0;e*=t,i*=n;let l=a.a,c=a.b,h=a.c,d=a.d,f=a.tx,p=a.ty;for(;u<o;){let g=r[e],_=r[e+1];s[i]=l*g+h*_+f,s[i+1]=c*g+d*_+p,i+=n,e+=t,u++}}function hl(r,t,e,s){let i=0;for(t*=e;i<s;)r[t]=0,r[t+1]=0,t+=e,i++}var Kd=x(()=>{"use strict"});function Ho(r,t,e,s,i){let n=t.a,o=t.b,a=t.c,u=t.d,l=t.tx,c=t.ty;e||(e=0),s||(s=2),i||(i=r.length/s-e);let h=e*s;for(let d=0;d<i;d++){let f=r[h],p=r[h+1];r[h]=n*f+a*p+l,r[h+1]=o*f+u*p+c,h+=s}}var Zd=x(()=>{"use strict"});var CP,ui,Qd=x(()=>{"use strict";ot();ks();CP=new F,ui=class{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let t=this.baseColor,e=t>>16|t&65280|(t&255)<<16,s=this.renderable;return s?Ie(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||CP}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}});var tn,K0,Z0,Q0=x(()=>{"use strict";C();tn={extension:{type:m.ShapeBuilder,name:"circle"},build(r,t){let e,s,i,n,o,a;if(r.type==="circle"){let T=r;if(o=a=T.radius,o<=0)return!1;e=T.x,s=T.y,i=n=0}else if(r.type==="ellipse"){let T=r;if(o=T.halfWidth,a=T.halfHeight,o<=0||a<=0)return!1;e=T.x,s=T.y,i=n=0}else{let T=r,S=T.width/2,E=T.height/2;e=T.x+S,s=T.y+E,o=a=Math.max(0,Math.min(T.radius,Math.min(S,E))),i=S-o,n=E-a}if(i<0||n<0)return!1;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(i?4:0)+(n?4:0);if(l===0)return!1;if(u===0)return t[0]=t[6]=e+i,t[1]=t[3]=s+n,t[2]=t[4]=e-i,t[5]=t[7]=s-n,!0;let c=0,h=u*4+(i?2:0)+2,d=h,f=l,p=i+o,g=n,_=e+p,b=e-p,y=s+g;if(t[c++]=_,t[c++]=y,t[--h]=y,t[--h]=b,n){let T=s-g;t[d++]=b,t[d++]=T,t[--f]=T,t[--f]=_}for(let T=1;T<u;T++){let S=Math.PI/2*(T/u),E=i+Math.cos(S)*o,w=n+Math.sin(S)*a,M=e+E,P=e-E,R=s+w,A=s-w;t[c++]=M,t[c++]=R,t[--h]=R,t[--h]=P,t[d++]=P,t[d++]=A,t[--f]=A,t[--f]=M}p=i,g=n+a,_=e+p,b=e-p,y=s+g;let v=s-g;return t[c++]=_,t[c++]=y,t[--f]=v,t[--f]=_,i&&(t[c++]=b,t[c++]=y,t[--f]=v,t[--f]=b),!0},triangulate(r,t,e,s,i,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=s;t[u*e]=o,t[u*e+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)t[u*e]=r[c],t[u*e+1]=r[c+1],c>0&&(i[n++]=u,i[n++]=l,i[n++]=u-1),u++;i[n++]=l+1,i[n++]=l,i[n++]=u-1}},K0={...tn,extension:{...tn.extension,name:"ellipse"}},Z0={...tn,extension:{...tn.extension,name:"roundedRectangle"}}});function J0(r,t,e,s){let i=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=t||Math.abs(n-a)<i&&Math.abs(o-u)<i,c=e,h=r.length/2,d=c.length/2;for(let f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)s.push(d+f,d+f+1);l&&s.push(d+h-1,d)}var ty=x(()=>{"use strict"});function dl(r,t,e,s,i,n,o){let a=ux(r,t,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+i,n[o++]=a[l+1]+i,n[o++]=a[l+2]+i;let u=i*s;for(let l=0;l<r.length;l+=2)e[u]=r[l],e[u+1]=r[l+1],u+=s}var Jd=x(()=>{"use strict";lx()});var AP,ey,ry=x(()=>{"use strict";C();Jd();AP=[],ey={extension:{type:m.ShapeBuilder,name:"polygon"},build(r,t){for(let e=0;e<r.points.length;e++)t[e]=r.points[e];return!0},triangulate(r,t,e,s,i,n){dl(r,AP,t,e,s,i,n)}}});var sy,iy=x(()=>{"use strict";C();sy={extension:{type:m.ShapeBuilder,name:"rectangle"},build(r,t){let e=r,s=e.x,i=e.y,n=e.width,o=e.height;return n>0&&o>0?(t[0]=s,t[1]=i,t[2]=s+n,t[3]=i,t[4]=s+n,t[5]=i+o,t[6]=s,t[7]=i+o,!0):!1},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[6],t[s+o+1]=r[7],o+=e,t[s+o]=r[4],t[s+o+1]=r[5],o+=e;let a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2,i[n++]=a+1,i[n++]=a+3,i[n++]=a+2}}});var ny,oy=x(()=>{"use strict";C();ny={extension:{type:m.ShapeBuilder,name:"triangle"},build(r,t){return t[0]=r.x,t[1]=r.y,t[2]=r.x2,t[3]=r.y2,t[4]=r.x3,t[5]=r.y3,!0},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[4],t[s+o+1]=r[5];let a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2}}});function fl(r,t,e,s){let i=t.matrix?r.copyFrom(t.matrix).invert():r.identity();if(t.textureSpace==="local"){let o=e.getBounds(PP);t.width&&o.pad(t.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,f=i.a,p=i.b,g=i.c,_=i.d;i.a*=l,i.b*=l,i.c*=c,i.d*=c,i.tx=h*f+d*g+i.tx,i.ty=h*p+d*_+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let n=t.texture.source.style;return!(t.fill instanceof Nt)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),s&&i.append(wP.copyFrom(s).invert()),i}var wP,PP,tf=x(()=>{"use strict";ot();jt();zr();wP=new F,PP=new J});function ay(r,t){let{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i<r.instructions.length;i++){let n=r.instructions[i];if(n.action==="texture")MP(n.data,s,e);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&mE(l.shapePath,u,!0,s,e),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),mE(a,u,o,s,e)}}}function MP(r,t,e){let s=[],i=Fr.rectangle,n=BP;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!i.build(n,s))return;let{vertices:a,uvs:u,indices:l}=e,c=l.length,h=a.length/2;o&&Ho(s,o),i.triangulate(s,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let p=Ct.get(ui);p.indexOffset=c,p.indexSize=l.length-c,p.attributeOffset=h,p.attributeSize=a.length/2-h,p.baseColor=r.style,p.alpha=r.alpha,p.texture=d,p.geometryData=e,t.push(p)}function mE(r,t,e,s,i){let{vertices:n,uvs:o,indices:a}=i;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Fr[u.type];if(!d.build(u,h))return;let f=a.length,p=n.length/2,g="triangle-list";if(l&&Ho(h,l),e){let v=u.closePath??!0,T=t;T.pixelLine?(J0(h,v,n,a),g="line-list"):Ji(h,T,!1,v,n,a)}else if(c){let v=[],T=h.slice();DP(c).forEach(E=>{v.push(T.length/2),T.push(...E)}),dl(T,v,n,2,p,a,f)}else d.triangulate(h,n,2,p,a,f);let _=o.length/2,b=t.texture;if(b!==D.WHITE){let v=fl(RP,t,u,l);cl(n,2,p,o,_,2,n.length/2-p,v)}else hl(o,_,2,n.length/2-p);let y=Ct.get(ui);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=p,y.attributeSize=n.length/2-p,y.baseColor=t.color,y.alpha=t.alpha,y.texture=b,y.geometryData=i,y.topology=g,s.push(y)})}function DP(r){let t=[];for(let e=0;e<r.length;e++){let s=r[e].shape,i=[];Fr[s.type].build(s,i)&&t.push(i)}return t}var Fr,BP,RP,Wo=x(()=>{"use strict";C();ot();jt();Kd();Zd();ht();xr();Qd();Q0();ll();ty();ry();iy();oy();tf();Jd();Fr={};O.handleByMap(m.ShapeBuilder,Fr);O.add(sy,ey,ny,tn,K0,Z0);BP=new J,RP=new F});function IP(r,t,e){r.beginPath();for(let s=0;s<e.length;s+=3){let i=e[s]*2,n=e[s+1]*2,o=e[s+2]*2;r.moveTo(t[i],t[i+1]),r.lineTo(t[n],t[n+1]),r.lineTo(t[o],t[o+1]),r.closePath()}r.fill()}function kP(r){return`#${(r&16777215).toString(16).padStart(6,"0")}`}function OP(r,t,e,s,i,n){n=Math.max(0,Math.min(n,Math.min(s,i)/2)),r.moveTo(t+n,e),r.lineTo(t+s-n,e),r.quadraticCurveTo(t+s,e,t+s,e+n),r.lineTo(t+s,e+i-n),r.quadraticCurveTo(t+s,e+i,t+s-n,e+i),r.lineTo(t+n,e+i),r.quadraticCurveTo(t,e+i,t,e+i-n),r.lineTo(t,e+n),r.quadraticCurveTo(t,e,t+n,e)}function rf(r,t){switch(t.type){case"rectangle":{let e=t;r.rect(e.x,e.y,e.width,e.height);break}case"roundedRectangle":{let e=t;OP(r,e.x,e.y,e.width,e.height,e.radius);break}case"circle":{let e=t;r.arc(e.x,e.y,e.radius,0,Math.PI*2);break}case"ellipse":{let e=t;r.ellipse?r.ellipse(e.x,e.y,e.halfWidth,e.halfHeight,0,0,Math.PI*2):(r.save(),r.translate(e.x,e.y),r.scale(e.halfWidth,e.halfHeight),r.arc(0,0,1,0,Math.PI*2),r.restore());break}case"triangle":{let e=t;r.moveTo(e.x,e.y),r.lineTo(e.x2,e.y2),r.lineTo(e.x3,e.y3),r.closePath();break}default:{let e=t,s=e.points;if(!s?.length)break;r.moveTo(s[0],s[1]);for(let i=2;i<s.length;i+=2)r.lineTo(s[i],s[i+1]);e.closePath&&r.closePath();break}}}function LP(r,t){if(!t?.length)return!1;for(let e=0;e<t.length;e++){let s=t[e];if(!s?.shape)continue;let i=s.transform,n=i&&!i.isIdentity();n&&(r.save(),r.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),rf(r,s.shape),n&&r.restore()}return!0}function NP(r,t,e,s){let i=r.fill;if(i instanceof Nt){i.buildGradient();let o=i.texture;if(o){let a=Z.getTintedPattern(o,t),u=e?uy.copyFrom(e).scale(o.source.pixelWidth,o.source.pixelHeight):uy.copyFrom(i.transform);return s&&!r.textureSpace&&u.append(s),Z.applyPatternTransform(a,u),a}}if(i instanceof hr){let o=Z.getTintedPattern(i.texture,t);return Z.applyPatternTransform(o,i.transform,!1),o}let n=r.texture;if(n&&n!==D.WHITE){if(!n.source.resource)return FP;let o=Z.getTintedPattern(n,t),a=e?uy.copyFrom(e).scale(n.source.pixelWidth,n.source.pixelHeight):r.matrix;return Z.applyPatternTransform(o,a),o}return kP(t)}var FP,ef,GP,UP,uy,Vo,ly=x(()=>{"use strict";C();Ns();ot();Lr();ht();Os();ks();ll();zr();No();Wo();tf();FP="#808080",ef=new F,GP=new F,UP=new F,uy=new F;Vo=class{constructor(){this.shader=null}contextChange(t){}execute(t,e){let s=t.renderer,i=s.canvasContext,n=i.activeContext,o=e.groupTransform,a=s.globalUniforms.globalUniformData?.worldColor??4294967295,u=e.groupColorAlpha,l=(a>>>24&255)/255,c=(u>>>24&255)/255,h=s.filter?.alphaMultiplier??1,d=l*c*h;if(d<=0)return;let f=a&16777215,p=u&16777215,g=Te(Ie(p,f)),_=s._roundPixels|e._roundPixels;n.save(),i.setContextTransform(o,_===1),i.setBlendMode(e.groupBlendMode);let b=e.context.instructions;for(let y=0;y<b.length;y++){let v=b[y];if(v.action==="texture"){let A=v.data,G=A.image,H=G?Z.getCanvasSource(G):null;if(!H)continue;let W=A.alpha*d;if(W<=0)continue;let $=Ie(A.style,g);n.globalAlpha=W;let B=H;$!==16777215&&(B=Z.getTintedCanvas({texture:G},$));let U=G.frame,z=G.source._resolution??G.source.resolution??1,L=U.x*z,K=U.y*z,gt=U.width*z,ft=U.height*z;B!==H&&(L=0,K=0);let Y=A.transform,Q=Y&&!Y.isIdentity(),j=G.rotate;Q||j?(ef.copyFrom(o),Q&&ef.append(Y),j&&q.matrixAppendRotationInv(ef,j,A.dx,A.dy,A.dw,A.dh),i.setContextTransform(ef,_===1)):i.setContextTransform(o,_===1),n.drawImage(B,L,K,B===H?gt:B.width,B===H?ft:B.height,j?0:A.dx,j?0:A.dy,A.dw,A.dh),(Q||j)&&i.setContextTransform(o,_===1);continue}let T=v.data,S=T?.path?.shapePath;if(!S?.shapePrimitives?.length)continue;let E=T.style,w=Ie(E.color,g),M=E.alpha*d;if(M<=0)continue;let P=v.action==="stroke";if(n.globalAlpha=M,P){let A=E;n.lineWidth=A.width,n.lineCap=A.cap,n.lineJoin=A.join,n.miterLimit=A.miterLimit}let R=S.shapePrimitives;if(!P&&T.hole?.shapePath?.shapePrimitives?.length){let A=R[R.length-1];A.holes=T.hole.shapePath.shapePrimitives}for(let A=0;A<R.length;A++){let G=R[A];if(!G?.shape)continue;let H=G.transform,W=H&&!H.isIdentity(),$=E.texture&&E.texture!==D.WHITE,B=E.textureSpace==="global"?H:null,U=$?fl(GP,E,G.shape,B):null,z=W?UP.copyFrom(o).append(H):o,L=NP(E,w,U,z);if(W&&(n.save(),n.transform(H.a,H.b,H.c,H.d,H.tx,H.ty)),P){let K=E;if(K.alignment!==.5&&!K.pixelLine){let ft=[],Y=[],Q=[];if(Fr[G.shape.type]?.build(G.shape,ft)){let Pt=G.shape.closePath??!0;Ji(ft,K,!1,Pt,Y,Q),n.fillStyle=L,IP(n,Y,Q)}else n.strokeStyle=L,n.beginPath(),rf(n,G.shape),n.stroke()}else n.strokeStyle=L,n.beginPath(),rf(n,G.shape),n.stroke()}else n.fillStyle=L,n.beginPath(),rf(n,G.shape),LP(n,G.holes)?n.fill("evenodd"):n.fill();W&&n.restore()}}n.restore()}destroy(){this.shader=null}};Vo.extension={type:[m.CanvasPipesAdaptor],name:"graphics"}});var cy,hy,dy=x(()=>{"use strict";C();Ns();ot();Os();ks();Lr();cy=class en{static _getPatternRepeat(t,e){let s=t&&t!=="clamp-to-edge",i=e&&e!=="clamp-to-edge";return s&&i?"repeat":s?"repeat-x":i?"repeat-y":"no-repeat"}start(t,e,s){}execute(t,e){let s=e.elements;if(!s||!s.length)return;let i=t.renderer,n=i.canvasContext,o=n.activeContext;for(let a=0;a<s.length;a++){let u=s[a];if(!u.packAsQuad)continue;let l=u,c=l.texture,h=c?Z.getCanvasSource(c):null;if(!h)continue;let d=c.source.style,f=n.smoothProperty,p=d.scaleMode!=="nearest";o[f]!==p&&(o[f]=p),n.setBlendMode(e.blendMode);let g=i.globalUniforms.globalUniformData?.worldColor??4294967295,_=l.color,b=(g>>>24&255)/255,y=(_>>>24&255)/255,v=i.filter?.alphaMultiplier??1,T=b*y*v;if(T<=0)continue;o.globalAlpha=T;let S=g&16777215,E=_&16777215,w=Te(Ie(E,S)),M=c.frame,P=d.addressModeU??d.addressMode,R=d.addressModeV??d.addressMode,A=en._getPatternRepeat(P,R),G=c.source._resolution??c.source.resolution??1,H=l.renderable?.renderGroup?.isCachedAsTexture,W=M.x*G,$=M.y*G,B=M.width*G,U=M.height*G,z=l.bounds,L=i.renderTarget.renderTarget.isRoot,K=z.minX,gt=z.minY,ft=z.maxX-z.minX,Y=z.maxY-z.minY,Q=c.rotate,j=c.uvs,Pt=Math.min(j.x0,j.x1,j.x2,j.x3,j.y0,j.y1,j.y2,j.y3),Ht=Math.max(j.x0,j.x1,j.x2,j.x3,j.y0,j.y1,j.y2,j.y3),Me=A!=="no-repeat"&&(Pt<0||Ht>1),se=Q&&!(!Me&&(w!==16777215||Q));se?(en._tempPatternMatrix.copyFrom(l.transform),q.matrixAppendRotationInv(en._tempPatternMatrix,Q,K,gt,ft,Y),n.setContextTransform(en._tempPatternMatrix,l.roundPixels===1,void 0,H&&L)):n.setContextTransform(l.transform,l.roundPixels===1,void 0,H&&L);let Fe=ft,ie=Y,tr=se?0:K,er=se?0:gt;if(!se&&l.roundPixels===1&&(tr|=0,er|=0),Me){let mr=h,Fs=w!==16777215&&!Q,ts=M.width<=c.source.width&&M.height<=c.source.height;Fs&&ts&&(mr=Z.getTintedCanvas({texture:c},w));let ka=o.createPattern(mr,A);if(!ka)continue;let yp=Fe,M1=ie;if(yp===0||M1===0)continue;let D1=1/yp,F1=1/M1,G1=(j.x1-j.x0)*D1,U1=(j.y1-j.y0)*D1,I1=(j.x3-j.x0)*F1,k1=(j.y3-j.y0)*F1,sw=j.x0-G1*tr-I1*er,iw=j.y0-U1*tr-k1*er,vp=c.source.pixelWidth,Tp=c.source.pixelHeight;en._tempPatternMatrix.set(G1*vp,U1*Tp,I1*vp,k1*Tp,sw*vp,iw*Tp),Z.applyPatternTransform(ka,en._tempPatternMatrix),o.fillStyle=ka,o.fillRect(tr,er,Fe,ie)}else{let Fs=w!==16777215||Q?Z.getTintedCanvas({texture:c},w):h,ts=Fs!==h;o.drawImage(Fs,ts?0:W,ts?0:$,ts?Fs.width:B,ts?Fs.height:U,tr,er,Fe,ie)}}}};cy._tempPatternMatrix=new F;cy.extension={type:[m.CanvasPipesAdaptor],name:"batch"};hy=cy});var zo,fy=x(()=>{"use strict";C();zo=class{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,s){this._renderer.renderPipes.batch.break(s);let i=this._colorStack;i[this._colorStackIndex]=i[this._colorStackIndex-1]&t.mask;let n=this._colorStack[this._colorStackIndex];n!==this._currentColor&&(this._currentColor=n,s.add({renderPipeId:"colorMask",colorMask:n,canBundle:!1})),this._colorStackIndex++}pop(t,e,s){this._renderer.renderPipes.batch.break(s);let i=this._colorStack;this._colorStackIndex--;let n=i[this._colorStackIndex-1];n!==this._currentColor&&(this._currentColor=n,s.add({renderPipeId:"colorMask",colorMask:n,canBundle:!1}))}execute(t){}destroy(){this._renderer=null,this._colorStack=null}};zo.extension={type:[m.CanvasPipes],name:"colorMask"}});function gE(r){let t=[];return r.replace(HP,(e,s,i)=>{let n=s.toLowerCase(),o=s,a=VP(i);for(n==="m"&&a.length>2&&(t.push([o,...a.splice(0,2)]),n="l",o=o==="m"?"l":"L");;){if(a.length===py[n])return t.push([o,...a]),"";if(a.length<py[n])throw new Error("malformed path data");t.push([o,...a.splice(0,py[n])])}}),t}function VP(r){let t=r.match(WP);return t?t.map(Number):[]}var py,HP,WP,xE=x(()=>{"use strict";py={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},HP=/([astvzqmhlc])([^astvzqmhlc]*)/gi,WP=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi});function my(r,t){let e=gE(r),s=[],i=null,n=0,o=0;for(let a=0;a<e.length;a++){let u=e[a],l=u[0],c=u;switch(l){case"M":n=c[1],o=c[2],t.moveTo(n,o);break;case"m":n+=c[1],o+=c[2],t.moveTo(n,o);break;case"H":n=c[1],t.lineTo(n,o);break;case"h":n+=c[1],t.lineTo(n,o);break;case"V":o=c[1],t.lineTo(n,o);break;case"v":o+=c[1],t.lineTo(n,o);break;case"L":n=c[1],o=c[2],t.lineTo(n,o);break;case"l":n+=c[1],o+=c[2],t.lineTo(n,o);break;case"C":n=c[5],o=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case"c":t.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case"S":n=c[3],o=c[4],t.bezierCurveToShort(c[1],c[2],n,o);break;case"s":t.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"Q":n=c[3],o=c[4],t.quadraticCurveTo(c[1],c[2],n,o);break;case"q":t.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"T":n=c[1],o=c[2],t.quadraticCurveToShort(n,o);break;case"t":n+=c[1],o+=c[2],t.quadraticCurveToShort(n,o);break;case"A":n=c[6],o=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"a":n+=c[6],o+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"Z":case"z":t.closePath(),s.length>0&&(i=s.pop(),i?(n=i.startX,o=i.startY):(n=0,o=0)),i=null;break;default:k(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&i===null&&(i={startX:n,startY:o},s.push(i))}return t}var gy=x(()=>{"use strict";xE();pt()});var sf,nf,_y,rn,pl=x(()=>{"use strict";C();Ru();dd();qa();ye();xt();xr();Wo();sf=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Ct.return(t)}),this.graphicsData&&Ct.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},nf=class{constructor(){this.instructions=new ss}init(t){let e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new eo({maxTextures:e}),this.instructions.reset()}get geometry(){return I(kp,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},_y=class xy{constructor(t){this._renderer=t,this._managedContexts=new vt({renderer:t,type:"resource",name:"graphicsContext"})}init(t){xy.defaultOptions.bezierSmoothness=t?.bezierSmoothness??xy.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){let e=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&s.reset(),ay(t,s);let i=t.batchMode;t.customShader||i==="no-batch"?s.isBatchable=!1:i==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){let e=Ct.get(nf,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:i,geometryData:n}=s;s.graphicsData=e;let o=n.vertices.length,a=n.indices.length;for(let h=0;h<i.length;h++)i[h].applyTransform=!1;let u=e.batcher;u.ensureAttributeBuffer(o),u.ensureIndexBuffer(a),u.begin();for(let h=0;h<i.length;h++){let d=i[h];u.add(d)}u.finish(e.instructions);let l=u.geometry;l.indexBuffer.setDataWithSize(u.indexBuffer,u.indexSize,!0),l.buffers[0].setDataWithSize(u.attributeBuffer.float32View,u.attributeSize,!0);let c=u.batches;for(let h=0;h<c.length;h++){let d=c[h];d.bindGroup=Ii(d.textures.textures,d.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){let e=new sf;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};_y.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"graphicsContext"};_y.defaultOptions={bezierSmoothness:.5};rn=_y});function ml(r,t,e,s,i,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??rn.defaultOptions.bezierSmoothness)),d=(XP-h)/1;return d*=d,$P(t,e,s,i,n,o,a,u,r,d),r}function $P(r,t,e,s,i,n,o,a,u,l){yy(r,t,e,s,i,n,o,a,u,l,0),u.push(o,a)}function yy(r,t,e,s,i,n,o,a,u,l,c){if(c>zP)return;let h=Math.PI,d=(r+e)/2,f=(t+s)/2,p=(e+i)/2,g=(s+n)/2,_=(i+o)/2,b=(n+a)/2,y=(d+p)/2,v=(f+g)/2,T=(p+_)/2,S=(g+b)/2,E=(y+T)/2,w=(v+S)/2;if(c>0){let M=o-r,P=a-t,R=Math.abs((e-o)*P-(s-a)*M),A=Math.abs((i-o)*P-(n-a)*M),G,H;if(R>of&&A>of){if((R+A)*(R+A)<=l*(M*M+P*P)){if(Xo<by){u.push(E,w);return}let W=Math.atan2(n-s,i-e);if(G=Math.abs(W-Math.atan2(s-t,e-r)),H=Math.abs(Math.atan2(a-n,o-i)-W),G>=h&&(G=2*h-G),H>=h&&(H=2*h-H),G+H<Xo){u.push(E,w);return}if(sn!==0){if(G>sn){u.push(e,s);return}if(H>sn){u.push(i,n);return}}}}else if(R>of){if(R*R<=l*(M*M+P*P)){if(Xo<by){u.push(E,w);return}if(G=Math.abs(Math.atan2(n-s,i-e)-Math.atan2(s-t,e-r)),G>=h&&(G=2*h-G),G<Xo){u.push(e,s),u.push(i,n);return}if(sn!==0&&G>sn){u.push(e,s);return}}}else if(A>of){if(A*A<=l*(M*M+P*P)){if(Xo<by){u.push(E,w);return}if(G=Math.abs(Math.atan2(a-n,o-i)-Math.atan2(n-s,i-e)),G>=h&&(G=2*h-G),G<Xo){u.push(e,s),u.push(i,n);return}if(sn!==0&&G>sn){u.push(i,n);return}}}else if(M=E-(r+o)/2,P=w-(t+a)/2,M*M+P*P<=l){u.push(E,w);return}}yy(r,t,d,f,y,v,E,w,u,l,c+1),yy(E,w,T,S,_,b,o,a,u,l,c+1)}var zP,of,XP,by,Xo,sn,af=x(()=>{"use strict";pl();zP=8,of=11920929e-14,XP=1,by=.01,Xo=0,sn=0});function Ty(r,t,e,s,i,n,o,a){let l=Math.min(.99,Math.max(0,a??rn.defaultOptions.bezierSmoothness)),c=(qP-l)/1;return c*=c,ZP(t,e,s,i,n,o,r,c),r}function ZP(r,t,e,s,i,n,o,a){vy(o,r,t,e,s,i,n,a,0),o.push(i,n)}function vy(r,t,e,s,i,n,o,a,u){if(u>YP)return;let l=Math.PI,c=(t+s)/2,h=(e+i)/2,d=(s+n)/2,f=(i+o)/2,p=(c+d)/2,g=(h+f)/2,_=n-t,b=o-e,y=Math.abs((s-n)*b-(i-o)*_);if(y>jP){if(y*y<=a*(_*_+b*b)){if(_E<KP){r.push(p,g);return}let v=Math.abs(Math.atan2(o-i,n-s)-Math.atan2(i-e,s-t));if(v>=l&&(v=2*l-v),v<_E){r.push(p,g);return}}}else if(_=p-(t+n)/2,b=g-(e+o)/2,_*_+b*b<=a){r.push(p,g);return}vy(r,t,e,c,h,p,g,a,u+1),vy(r,p,g,d,f,n,o,a,u+1)}var YP,jP,qP,KP,_E,Sy=x(()=>{"use strict";pl();YP=8,jP=11920929e-14,qP=1,KP=.01,_E=0});function gl(r,t,e,s,i,n,o,a){let u=Math.abs(i-n);(!o&&i>n||o&&n>i)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=i;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),f=Math.sin(c),p=t+d*s,g=e+f*s;r.push(p,g),c+=l}}var uf=x(()=>{"use strict"});function Ey(r,t,e,s,i,n){let o=r[r.length-2],u=r[r.length-1]-e,l=o-t,c=i-e,h=s-t,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==t||r[r.length-1]!==e)&&r.push(t,e);return}let f=u*u+l*l,p=c*c+h*h,g=u*c+l*h,_=n*Math.sqrt(f)/d,b=n*Math.sqrt(p)/d,y=_*g/f,v=b*g/p,T=_*h+b*l,S=_*c+b*u,E=l*(b+y),w=u*(b+y),M=h*(_+v),P=c*(_+v),R=Math.atan2(w-S,E-T),A=Math.atan2(P-S,M-T);gl(r,T+t,S+e,n,R,A,l*c>h*u)}var Cy=x(()=>{"use strict";uf()});function QP(r,t){let e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,i=Math.cos(r),n=Math.sin(r),o=Math.cos(r+t),a=Math.sin(r+t);return[{x:i-n*s,y:n+i*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}function Py(r,t,e,s,i,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*xl/360),h=Math.cos(a*xl/360),d=h*(t-s)/2+c*(e-i)/2,f=-c*(t-s)/2+h*(e-i)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let p=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(n*=Math.sqrt(p),o*=Math.sqrt(p)),JP(t,e,s,i,n,o,u,l,c,h,d,f,Ay);let{ang1:g,ang2:_}=Ay,{centerX:b,centerY:y}=Ay,v=Math.abs(_)/(xl/4);Math.abs(1-v)<1e-7&&(v=1);let T=Math.max(Math.ceil(v),1);_/=T;let S=r[r.length-2],E=r[r.length-1],w={x:0,y:0};for(let M=0;M<T;M++){let P=QP(g,_),{x:R,y:A}=wy(P[0],n,o,h,c,b,y,w),{x:G,y:H}=wy(P[1],n,o,h,c,b,y,w),{x:W,y:$}=wy(P[2],n,o,h,c,b,y,w);ml(r,S,E,R,A,G,H,W,$),S=W,E=$,g+=_}}var xl,Ay,wy,bE,JP,By=x(()=>{"use strict";af();xl=Math.PI*2,Ay={centerX:0,centerY:0,ang1:0,ang2:0},wy=({x:r,y:t},e,s,i,n,o,a,u)=>{r*=e,t*=s;let l=i*r-n*t,c=n*r+i*t;return u.x=l+o,u.y=c+a,u};bE=(r,t,e,s)=>{let i=r*s-t*e<0?-1:1,n=r*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),i*Math.acos(n)},JP=(r,t,e,s,i,n,o,a,u,l,c,h,d)=>{let f=Math.pow(i,2),p=Math.pow(n,2),g=Math.pow(c,2),_=Math.pow(h,2),b=f*p-f*_-p*g;b<0&&(b=0),b/=f*_+p*g,b=Math.sqrt(b)*(o===a?-1:1);let y=b*i/n*h,v=b*-n/i*c,T=l*y-u*v+(r+e)/2,S=u*y+l*v+(t+s)/2,E=(c-y)/i,w=(h-v)/n,M=(-c-y)/i,P=(-h-v)/n,R=bE(1,0,E,w),A=bE(E,w,M,P);a===0&&A>0&&(A-=xl),a===1&&A<0&&(A+=xl),d.centerX=T,d.centerY=S,d.ang1=R,d.ang2=A}});function Ry(r,t,e){let s=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return{len:c,nx:h,ny:d}},i=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y)},n=t[t.length-1];for(let o=0;o<t.length;o++){let a=t[o%t.length],u=a.radius??e;if(u<=0){i(o,a),n=a;continue}let l=t[(o+1)%t.length],c=s(a,n),h=s(a,l);if(c.len<1e-4||h.len<1e-4){i(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),f=1,p=!1;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0);let g=d/2,_,b=Math.abs(Math.cos(g)*u/Math.sin(g));b>Math.min(c.len/2,h.len/2)?(b=Math.min(c.len/2,h.len/2),_=Math.abs(b*Math.sin(g)/Math.cos(g))):_=u;let y=a.x+h.nx*b+-h.ny*_*f,v=a.y+h.ny*b+h.nx*_*f,T=Math.atan2(c.ny,c.nx)+Math.PI/2*f,S=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(T)*_,v+Math.sin(T)*_),r.arc(y,v,_,T,S,p),n=a}}function My(r,t,e,s){let i=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=t.length;for(let a=0;a<o;a++){let u=t[(a+1)%o],l=u.radius??e;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=t[a],h=t[(a+2)%o],d=i(c,u),f;if(d<1e-4)f=u;else{let _=Math.min(d/2,l);f=n(u,c,_/d)}let p=i(h,u),g;if(p<1e-4)g=u;else{let _=Math.min(p/2,l);g=n(u,h,_/p)}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,g.x,g.y,s)}}var Dy=x(()=>{"use strict"});var tB,_l,Fy=x(()=>{"use strict";jm();qm();Km();jt();Zm();he();af();Sy();uf();Cy();By();Dy();tB=new J,_l=class{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new _t,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();let s=this._currentPoly.points,i=s[s.length-2],n=s[s.length-1];return(i!==t||n!==e)&&s.push(t,e),this}arc(t,e,s,i,n,o){this._ensurePoly(!1);let a=this._currentPoly.points;return gl(a,t,e,s,i,n,o),this}arcTo(t,e,s,i,n){this._ensurePoly();let o=this._currentPoly.points;return Ey(o,t,e,s,i,n),this}arcToSvg(t,e,s,i,n,o,a){let u=this._currentPoly.points;return Py(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,t,e,s,i,n),this}bezierCurveTo(t,e,s,i,n,o,a){this._ensurePoly();let u=this._currentPoly;return ml(this._currentPoly.points,u.lastX,u.lastY,t,e,s,i,n,o,a),this}quadraticCurveTo(t,e,s,i,n){this._ensurePoly();let o=this._currentPoly;return Ty(this._currentPoly.points,o.lastX,o.lastY,t,e,s,i,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));let s=this.shapePrimitives,i=s.length;for(let n=0;n<t.instructions.length;n++){let o=t.instructions[n];this[o.action](...o.data)}if(t.checkForHoles&&s.length-i>1){let n=null;for(let o=i;o<s.length;o++){let a=s[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),s.copyWithin(o,o+1),s.length--,o--):n=a}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,i,n){return this.drawShape(new J(t,e,s,i),n),this}circle(t,e,s,i){return this.drawShape(new hu(t,e,s),i),this}poly(t,e,s){let i=new wi(t);return i.closePath=e,this.drawShape(i,s),this}regularPoly(t,e,s,i,n=0,o){i=Math.max(i|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/i,l=[];for(let c=0;c<i;c++){let h=a-c*u;l.push(t+s*Math.cos(h),e+s*Math.sin(h))}return this.poly(l,!0,o),this}roundPoly(t,e,s,i,n,o=0,a){if(i=Math.max(i|0,3),n<=0)return this.regularPoly(t,e,s,i,o);let u=s*Math.sin(Math.PI/i)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/i,h=(i-2)*Math.PI/i/2;for(let d=0;d<i;d++){let f=d*c+l,p=t+s*Math.cos(f),g=e+s*Math.sin(f),_=f+Math.PI+h,b=f-Math.PI-h,y=p+n*Math.cos(_),v=g+n*Math.sin(_),T=p+n*Math.cos(b),S=g+n*Math.sin(b);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(p,g,T,S,a)}return this.closePath()}roundShape(t,e,s=!1,i){return t.length<3?this:(s?My(this,t,e,i):Ry(this,t,e),this.closePath())}filletRect(t,e,s,i,n){if(n===0)return this.rect(t,e,s,i);let o=Math.min(s,i)/2,a=Math.min(o,Math.max(-o,n)),u=t+s,l=e+i,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(t,e+h).arcTo(t+c,e+c,t+h,e,h).lineTo(u-h,e).arcTo(u-c,e+c,u,e+h,h).lineTo(u,l-h).arcTo(u-c,l-c,t+s-h,l,h).lineTo(t+h,l).arcTo(t+c,l-c,t,l-h,h).closePath()}chamferRect(t,e,s,i,n,o){if(n<=0)return this.rect(t,e,s,i);let a=Math.min(n,Math.min(s,i)/2),u=t+s,l=e+i,c=[t+a,e,u-a,e,u,e+a,u,l-a,u-a,l,t+a,l,t,l-a,t,e+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,!0,o)}ellipse(t,e,s,i,n){return this.drawShape(new du(t,e,s,i),n),this}roundRect(t,e,s,i,n,o){return this.drawShape(new fu(t,e,s,i,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new wi,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){let e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new wi,t)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let n=e.transform,o=s;s=n.a*s+n.c*i+n.tx,i=n.b*o+n.d*i+n.ty}this._currentPoly.points.push(s,i)}else this._currentPoly.points.push(0,0)}}buildPath(){let t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){let s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){let t=this._bounds;t.clear();let e=this.shapePrimitives;for(let s=0;s<e.length;s++){let i=e[s],n=i.shape.getBounds(tB);i.transform?t.addRect(n,i.transform):t.addRect(n)}return t}}});function $o(r,t){return r?r.prepend(t):t.clone()}var He,Yo=x(()=>{"use strict";Ue();Yt();pt();gy();Fy();He=class r{constructor(t,e=!1){this.instructions=[],this.uid=et("graphicsPath"),this._dirty=!0,this.checkForHoles=e,typeof t=="string"?my(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new _l(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,i,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(nt.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else{u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l)}return this.instructions.push({action:"bezierCurveTo",data:[u,l,t,e,s,i,n]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){let i=this.instructions[this.instructions.length-1],n=this.getLastPoint(nt.shared),o=0,a=0;if(!i||i.action!=="quadraticCurveTo")o=n.x,a=n.y;else{o=i.data[0],a=i.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a)}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,t,e,s]}),this._dirty=!0,this}rect(t,e,s,i,n){return this.instructions.push({action:"rect",data:[t,e,s,i,n]}),this._dirty=!0,this}circle(t,e,s,i){return this.instructions.push({action:"circle",data:[t,e,s,i]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,i,n,o,a){n||(n=i/2);let u=-1*Math.PI/2+o,l=s*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let f=d%2?n:i,p=d*c+u;h.push(t+f*Math.cos(p),e+f*Math.sin(p))}return this.poly(h,!0,a),this}clone(t=!1){let e=new r;if(e.checkForHoles=this.checkForHoles,!t)e.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){let i=this.instructions[s];e.instructions.push({action:i.action,data:i.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;let e=t.a,s=t.b,i=t.c,n=t.d,o=t.tx,a=t.ty,u=0,l=0,c=0,h=0,d=0,f=0,p=0,g=0;for(let _=0;_<this.instructions.length;_++){let b=this.instructions[_],y=b.data;switch(b.action){case"moveTo":case"lineTo":u=y[0],l=y[1],y[0]=e*u+i*l+o,y[1]=s*u+n*l+a;break;case"bezierCurveTo":c=y[0],h=y[1],d=y[2],f=y[3],u=y[4],l=y[5],y[0]=e*c+i*h+o,y[1]=s*c+n*h+a,y[2]=e*d+i*f+o,y[3]=s*d+n*f+a,y[4]=e*u+i*l+o,y[5]=s*u+n*l+a;break;case"quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=e*c+i*h+o,y[1]=s*c+n*h+a,y[2]=e*u+i*l+o,y[3]=s*u+n*l+a;break;case"arcToSvg":u=y[5],l=y[6],p=y[0],g=y[1],y[0]=e*p+i*g,y[1]=s*p+n*g,y[5]=e*u+i*l+o,y[6]=s*u+n*l+a;break;case"circle":y[4]=$o(y[3],t);break;case"rect":y[4]=$o(y[4],t);break;case"ellipse":y[8]=$o(y[8],t);break;case"roundRect":y[5]=$o(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=$o(y[2],t);break;case"regularPoly":case"chamferRect":y[5]=$o(y[5],t);break;case"closePath":break;default:k("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}});function kt(r,t,e){let s=r.getAttribute(t);return s?Number(s):e}var lf=x(()=>{"use strict"});function Gy(r,t){let e=r.querySelectorAll("defs");for(let s=0;s<e.length;s++){let i=e[s];for(let n=0;n<i.children.length;n++){let o=i.children[n];switch(o.nodeName.toLowerCase()){case"lineargradient":t.defs[o.id]=eB(o);break;case"radialgradient":t.defs[o.id]=rB(o);break;default:break}}}}function eB(r){let t=kt(r,"x1",0),e=kt(r,"y1",0),s=kt(r,"x2",1),i=kt(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new Nt(t,e,s,i,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=kt(u,"offset",0),c=X.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c)}return o}function rB(r){return k("[SVG Parser] Radial gradients are not yet supported"),new Nt(0,0,1,0)}var Uy=x(()=>{"use strict";It();pt();zr();lf()});function cf(r){let t=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}var Iy=x(()=>{"use strict"});function hf(r,t){let e=r.getAttribute("style"),s={},i={},n={strokeStyle:s,fillStyle:i,useFill:!1,useStroke:!1};for(let o in ky){let a=r.getAttribute(o);a&&yE(t,n,o,a.trim())}if(e){let o=e.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");ky[l]&&yE(t,n,l,c.trim())}}return{strokeStyle:n.useStroke?s:null,fillStyle:n.useFill?i:null,useFill:n.useFill,useStroke:n.useStroke}}function yE(r,t,e,s){switch(e){case"stroke":if(s!=="none"){if(s.startsWith("url(")){let i=cf(s);t.strokeStyle.fill=r.defs[i]}else t.strokeStyle.color=X.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){let i=cf(s);t.fillStyle.fill=r.defs[i]}else t.fillStyle.color=X.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}var ky,Oy=x(()=>{"use strict";It();Iy();ky={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}}});function Ly(r){if(r.length<=2)return!0;let t=r.map(a=>a.area).sort((a,u)=>u-a),[e,s]=t,i=t[t.length-1],n=e/s,o=s/i;return!(n>3&&o<2)}function sB(r,t=0){let e=r.instructions[t];if(!e||e.action!=="fill")throw new Error(`Expected fill instruction at index ${t}, got ${e?.action||"undefined"}`);return e.data}var Ny=x(()=>{"use strict"});function Hy(r){return r.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function Wy(r){let t=r.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let e=t.map(Number),s=[],i=[];for(let c=0;c<e.length;c+=2)c+1<e.length&&(s.push(e[c]),i.push(e[c+1]));if(s.length===0||i.length===0)return 0;let n=Math.min(...s),o=Math.max(...s),a=Math.min(...i),u=Math.max(...i);return(o-n)*(u-a)}function df(r,t){let e=new He(r,!1);for(let s of e.instructions)t.instructions.push(s)}var Vy=x(()=>{"use strict";Yo()});function zy(r,t){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg")}let e={context:t,defs:{},path:new He};Gy(r,e);let s=r.children,{fillStyle:i,strokeStyle:n}=hf(r,e);for(let o=0;o<s.length;o++){let a=s[o];a.nodeName.toLowerCase()!=="defs"&&vE(a,e,i,n)}return t}function vE(r,t,e,s){let i=r.children,{fillStyle:n,strokeStyle:o}=hf(r,t);n&&e?e={...e,...n}:n&&(e=n),o&&s?s={...s,...o}:o&&(s=o);let a=!e&&!s;a&&(e={color:0});let u,l,c,h,d,f,p,g,_,b,y,v,T,S,E,w,M;switch(r.nodeName.toLowerCase()){case"path":{S=r.getAttribute("d");let P=r.getAttribute("fill-rule"),R=Hy(S),A=P==="evenodd",G=R.length>1;if(A&&G){let W=R.map(B=>({path:B,area:Wy(B)}));if(W.sort((B,U)=>U.area-B.area),R.length>3||!Ly(W))for(let B=0;B<W.length;B++){let U=W[B],z=B===0;t.context.beginPath();let L=new He(void 0,!0);df(U.path,L),t.context.path(L),z?(e&&t.context.fill(e),s&&t.context.stroke(s)):t.context.cut()}else for(let B=0;B<W.length;B++){let U=W[B],z=B%2===1;t.context.beginPath();let L=new He(void 0,!0);df(U.path,L),t.context.path(L),z?t.context.cut():(e&&t.context.fill(e),s&&t.context.stroke(s))}}else{let W=P?P==="evenodd":!0;E=new He(S,W),t.context.path(E),e&&t.context.fill(e),s&&t.context.stroke(s)}break}case"circle":p=kt(r,"cx",0),g=kt(r,"cy",0),_=kt(r,"r",0),t.context.ellipse(p,g,_,_),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"rect":u=kt(r,"x",0),l=kt(r,"y",0),w=kt(r,"width",0),M=kt(r,"height",0),b=kt(r,"rx",0),y=kt(r,"ry",0),b||y?t.context.roundRect(u,l,w,M,b||y):t.context.rect(u,l,w,M),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"ellipse":p=kt(r,"cx",0),g=kt(r,"cy",0),b=kt(r,"rx",0),y=kt(r,"ry",0),t.context.beginPath(),t.context.ellipse(p,g,b,y),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"line":c=kt(r,"x1",0),h=kt(r,"y1",0),d=kt(r,"x2",0),f=kt(r,"y2",0),t.context.beginPath(),t.context.moveTo(c,h),t.context.lineTo(d,f),s&&t.context.stroke(s);break;case"polygon":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(P=>parseInt(P,10)),t.context.poly(v,!0),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"polyline":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(P=>parseInt(P,10)),t.context.poly(v,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{k(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(e=null);for(let P=0;P<i.length;P++)vE(i[P],t,e,s)}var Xy=x(()=>{"use strict";pt();Yo();Uy();lf();Oy();Ny();Vy()});function iB(r){return X.isColorLike(r)}function TE(r){return r instanceof hr}function SE(r){return r instanceof Nt}function nB(r){return r instanceof D}function oB(r,t,e){let s=X.shared.setValue(t??0);return r.color=s.toNumber(),r.alpha=s.alpha===1?e.alpha:s.alpha,r.texture=D.WHITE,{...e,...r}}function aB(r,t,e){return r.texture=t,{...e,...r}}function EE(r,t,e){return r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,r.textureSpace=t.textureSpace,{...e,...r}}function CE(r,t,e){return t.buildGradient(),r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,r.textureSpace=t.textureSpace,{...e,...r}}function uB(r,t){let e={...t,...r},s=X.shared.setValue(e.color);return e.alpha*=s.alpha,e.color=s.toNumber(),e}function Xr(r,t){if(r==null)return null;let e={},s=r;return iB(r)?oB(e,r,t):nB(r)?aB(e,r,t):TE(r)?EE(e,r,t):SE(r)?CE(e,r,t):s.fill&&TE(s.fill)?EE(s,s.fill,t):s.fill&&SE(s.fill)?CE(s,s.fill,t):uB(s,t)}function nn(r,t){let{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:a,...u}=t,l=Xr(r,u);return l?{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:a,...l}:null}var ff=x(()=>{"use strict";It();ht();zr();No()});function $y(r,t){let e=1,s=r.shapePath.shapePrimitives;for(let i=0;i<s.length;i++){let n=s[i].shape;if(n.type!=="polygon")continue;let o=n.points,a=o.length;if(a<6)continue;let u=n.closePath;for(let l=0;l<a;l+=2){if(!u&&(l===0||l===a-2))continue;let c=(l-2+a)%a,h=(l+2)%a,d=o[c],f=o[c+1],p=o[l],g=o[l+1],_=o[h],b=o[h+1],y=d-p,v=f-g,T=_-p,S=b-g,E=y*y+v*v,w=T*T+S*S;if(E<1e-12||w<1e-12)continue;let R=(y*T+v*S)/Math.sqrt(E*w);R<-1?R=-1:R>1&&(R=1);let A=Math.sqrt((1-R)*.5);if(A<1e-6)continue;let G=Math.min(1/A,t);G>e&&(e=G)}}return e}var Yy=x(()=>{"use strict"});var lB,AE,jy,Kt,li=x(()=>{"use strict";le();It();ot();Ue();ht();Yt();xt();he();Yo();Xy();ff();Yy();lB=new nt,AE=new F,jy=class $r extends St{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=et("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new He,this._transform=new F,this._fillStyle={...$r.defaultFillStyle},this._strokeStyle={...$r.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new _t,this._boundsDirty=!0}clone(){let t=new $r;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=Xr(t,$r.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=nn(t,$r.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Xr(t,$r.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Xr(t,$r.defaultStrokeStyle),this}texture(t,e,s,i,n,o){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:i||0,dw:n||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||e===0?X.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new He,this}fill(t,e){let s,i=this.instructions[this.instructions.length-1];return this._tick===0&&i?.action==="stroke"?s=i.data.path:s=this._activePath.clone(),s?(t!=null&&(e!==void 0&&typeof t=="number"&&(I(V,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=Xr(t,$r.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:t,y:e}=this._activePath.getLastPoint(nt.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e,s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="fill"?e=s.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=nn(t,$r.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){let e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(s);else{e.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,e,s,i,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,s,i,n,o),this}arcTo(t,e,s,i,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}arcToSvg(t,e,s,i,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(t,e,s,i,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(t,e,s,i,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*t+u.c*e+u.tx,u.b*t+u.d*e+u.ty,u.a*s+u.c*i+u.tx,u.b*s+u.d*i+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,i){return this._tick++,this._activePath.ellipse(t,e,s,i,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;let s=this._transform;return this._activePath.lineTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty),this}moveTo(t,e){this._tick++;let s=this._transform,i=this._activePath.instructions,n=s.a*t+s.c*e+s.tx,o=s.b*t+s.d*e+s.ty;return i.length===1&&i[0].action==="moveTo"?(i[0].data[0]=n,i[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(t,e,s,i,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}rect(t,e,s,i){return this._tick++,this._activePath.rect(t,e,s,i,this._transform.clone()),this}roundRect(t,e,s,i,n){return this._tick++,this._activePath.roundRect(t,e,s,i,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,s,i,n=0,o){return this._tick++,this._activePath.regularPoly(t,e,s,i,n,o),this}roundPoly(t,e,s,i,n,o){return this._tick++,this._activePath.roundPoly(t,e,s,i,n,o),this}roundShape(t,e,s,i){return this._tick++,this._activePath.roundShape(t,e,s,i),this}filletRect(t,e,s,i,n){return this._tick++,this._activePath.filletRect(t,e,s,i,n),this}chamferRect(t,e,s,i,n,o){return this._tick++,this._activePath.chamferRect(t,e,s,i,n,o),this}star(t,e,s,i,n=0,o=0){return this._tick++,this._activePath.star(t,e,s,i,n,o,this._transform.clone()),this}svg(t){return this._tick++,zy(t,this),this}restore(){let t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,s,i,n,o){return t instanceof F?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,s,i,n,o),this)}transform(t,e,s,i,n,o){return t instanceof F?(this._transform.append(t),this):(AE.set(t,e,s,i,n,o),this._transform.append(AE),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){let s=this.instructions[e],i=s.action;if(i==="fill"){let n=s.data;t.addBounds(n.path.bounds)}else if(i==="texture"){let n=s.data;t.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform)}if(i==="stroke"){let n=s.data,o=n.style.alignment,a=n.style.width*(1-o);n.style.join==="miter"&&(a*=$y(n.path,n.style.miterLimit));let u=n.path.bounds;t.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;let e=this.instructions,s=!1;for(let i=0;i<e.length;i++){let n=e[i],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,f=d?d.applyInverse(t,lB):t;if(n.action==="fill")s=h.contains(f.x,f.y);else{let g=u;s=h.strokeContains(f.x,f.y,g.width,g.alignment)}let p=o.hole;if(p){let g=p.shapePath?.shapePrimitives;if(g)for(let _=0;_<g.length;_++)g[_].shape.contains(f.x,f.y)&&(s=!1)}if(s)return!0}}return s}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};jy.defaultFillStyle={color:16777215,alpha:1,texture:D.WHITE,matrix:null,fill:null,textureSpace:"local"};jy.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:D.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};Kt=jy});var qy,Ky,Qy,Jy,t2=x(()=>{"use strict";C();qa();ye();qy=class{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}},Ky=class{constructor(){this.instructions=new ss}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}},Qy=class Zy{constructor(t){this._renderer=t,this._managedContexts=new vt({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Zy.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Zy.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){let e=t._gpuData,s=!!e[this._renderer.uid],i=e[this._renderer.uid]||this._initContext(t);return(t.dirty||!s)&&(s&&i.reset(),i.isBatchable=!1,t.dirty=!1),i}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){let e=new Ky,s=this.getGpuContext(t);return s.graphicsData=e,e.init(),e}_initContext(t){let e=new qy;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};Qy.extension={type:[m.CanvasSystem],name:"graphicsContext"};Qy.defaultOptions={bezierSmoothness:.5};Jy=Qy});var jo,e2=x(()=>{"use strict";C();je();ye();jo=class{constructor(t,e){this.state=Ut.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new vt({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}};jo.extension={type:[m.CanvasPipes],name:"graphics"}});var pf,qo,r2=x(()=>{"use strict";C();je();ye();xr();Xi();Qd();pf=class{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Ct.return(t)}),this.batches.length=0}},qo=class{constructor(t,e){this.state=Ut.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new vt({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){let e=t.context,s=!!t._gpuData,n=this.renderer.graphicsContext.updateGpuContext(e);return!!(n.isBatchable||s!==n.isBatchable)}addRenderable(t,e){let i=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),i.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){let s=this._getGpuDataForRenderable(t).batches;for(let i=0;i<s.length;i++){let n=s[i];n._batcher.updateElement(n)}}execute(t){if(!t.isRenderable)return;let e=this.renderer,s=t.context;if(!e.graphicsContext.getGpuContext(s).batches.length)return;let n=s.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=t.groupTransform,o.uRound=e._roundPixels|t._roundPixels,Mr(t.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){let e=this._getGpuDataForRenderable(t),i=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),i.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){let s=this.renderer.renderPipes.batch,i=this._getGpuDataForRenderable(t).batches;for(let n=0;n<i.length;n++){let o=i[n];s.addToBatch(o,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){let e=new pf;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){let s=t.context,n=this.renderer.graphicsContext.getGpuContext(s),o=this.renderer._roundPixels|t._roundPixels;e.batches=n.batches.map(a=>{let u=Ct.get(ui);return a.copyTo(u),u.renderable=t,u.roundPixels=o,u})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}};qo.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"graphics"}});var wE=x(()=>{"use strict";C();t2();e2();pl();r2();O.add(jo);O.add(qo);O.add(Jy);O.add(rn)});var xs,bl=x(()=>{"use strict";xt();br();li();wE();xs=class r extends Jt{constructor(t){t instanceof Kt&&(t={context:t});let{context:e,roundPixels:s,...i}=t||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new Kt,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||t?.context===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(t,e,s){I(V,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let i={};return t&&(i.width=t),e&&(i.color=e),s&&(i.alpha=s),this.context.strokeStyle=i,this}beginFill(t,e){I(V,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let s={};return t!==void 0&&(s.color=t),e!==void 0&&(s.alpha=e),this.context.fillStyle=s,this}endFill(){I(V,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let t=this.context.strokeStyle;return(t.width!==Kt.defaultStrokeStyle.width||t.color!==Kt.defaultStrokeStyle.color||t.alpha!==Kt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return I(V,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return I(V,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return I(V,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return I(V,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return I(V,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return I(V,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}});function cB(r,t,e,s,i,n){n=Math.max(0,Math.min(n,Math.min(s,i)/2)),r.moveTo(t+n,e),r.lineTo(t+s-n,e),r.quadraticCurveTo(t+s,e,t+s,e+n),r.lineTo(t+s,e+i-n),r.quadraticCurveTo(t+s,e+i,t+s-n,e+i),r.lineTo(t+n,e+i),r.quadraticCurveTo(t,e+i,t,e+i-n),r.lineTo(t,e+n),r.quadraticCurveTo(t,e,t+n,e)}function PE(r,t){switch(t.type){case"rectangle":{let e=t;r.rect(e.x,e.y,e.width,e.height);break}case"roundedRectangle":{let e=t;cB(r,e.x,e.y,e.width,e.height,e.radius);break}case"circle":{let e=t;r.moveTo(e.x+e.radius,e.y),r.arc(e.x,e.y,e.radius,0,Math.PI*2);break}case"ellipse":{let e=t;r.ellipse?(r.moveTo(e.x+e.halfWidth,e.y),r.ellipse(e.x,e.y,e.halfWidth,e.halfHeight,0,0,Math.PI*2)):(r.save(),r.translate(e.x,e.y),r.scale(e.halfWidth,e.halfHeight),r.moveTo(1,0),r.arc(0,0,1,0,Math.PI*2),r.restore());break}case"triangle":{let e=t;r.moveTo(e.x,e.y),r.lineTo(e.x2,e.y2),r.lineTo(e.x3,e.y3),r.closePath();break}default:{let e=t,s=e.points;if(!s?.length)break;r.moveTo(s[0],s[1]);for(let i=2;i<s.length;i+=2)r.lineTo(s[i],s[i+1]);e.closePath&&r.closePath();break}}}function hB(r,t,e){let s=[],i=[],n=[];if(!Fr[t.type]?.build(t,s))return!1;let a=t.closePath??!0;Ji(s,e,!1,a,i,n);for(let u=0;u<n.length;u+=3){let l=n[u]*2,c=n[u+1]*2,h=n[u+2]*2;r.moveTo(i[l],i[l+1]),r.lineTo(i[c],i[c+1]),r.lineTo(i[h],i[h+1]),r.closePath()}return!0}function dB(r,t){if(!t?.length)return!1;for(let e=0;e<t.length;e++){let s=t[e];if(!s?.shape)continue;let i=s.transform,n=i&&!i.isIdentity();n&&(r.save(),r.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),PE(r,s.shape),n&&r.restore()}return!0}var Ko,s2=x(()=>{"use strict";C();ll();bl();Wo();pt();Ko=class{constructor(t){this._warnedMaskTypes=new Set,this._canvasMaskStack=[],this._renderer=t}push(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){if(t.action!=="pushMaskBegin"&&t.action!=="popMaskEnd")return;let e=this._renderer,s=e.canvasContext,i=s?.activeContext;if(!i)return;if(t.action==="popMaskEnd"){this._canvasMaskStack.pop()&&i.restore();return}t.inverse&&this._warnOnce("inverse","CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.");let n=t.mask.mask;if(!(n instanceof xs)){this._warnOnce("nonGraphics","CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask."),this._canvasMaskStack.push(!1);return}let o=n,a=o.context?.instructions;if(!a?.length){this._canvasMaskStack.push(!1);return}i.save(),s.setContextTransform(o.groupTransform,(e._roundPixels|o._roundPixels)===1),i.beginPath();let u=!1,l=!1;for(let c=0;c<a.length;c++){let h=a[c],d=h.action;if(d!=="fill"&&d!=="stroke")continue;let f=h.data,p=f?.path?.shapePath;if(!p?.shapePrimitives?.length)continue;let g=d==="stroke",_=p.shapePrimitives;for(let b=0;b<_.length;b++){let y=_[b];if(!y?.shape)continue;let v=y.transform,T=v&&!v.isIdentity();T&&(i.save(),i.transform(v.a,v.b,v.c,v.d,v.tx,v.ty)),g&&f.style?u=hB(i,y.shape,f.style)||u:(PE(i,y.shape),l=dB(i,y.holes)||l,u=!0),T&&i.restore()}}if(!u){i.restore(),this._canvasMaskStack.push(!1);return}l?i.clip("evenodd"):i.clip(),this._canvasMaskStack.push(!0)}destroy(){this._renderer=null,this._warnedMaskTypes=null,this._canvasMaskStack=null}_warnOnce(t,e){this._warnedMaskTypes.has(t)||(this._warnedMaskTypes.add(t),k(e))}};Ko.extension={type:[m.CanvasPipes],name:"stencilMask"}});function i2(){let r=cu(),t=Object.create(null);return t.inherit=Ft,t.none=Ft,t.normal="source-over",t.add="lighter",t.multiply=r?"multiply":Ft,t.screen=r?"screen":Ft,t.overlay=r?"overlay":Ft,t.darken=r?"darken":Ft,t.lighten=r?"lighten":Ft,t["color-dodge"]=r?"color-dodge":Ft,t["color-burn"]=r?"color-burn":Ft,t["hard-light"]=r?"hard-light":Ft,t["soft-light"]=r?"soft-light":Ft,t.difference=r?"difference":Ft,t.exclusion=r?"exclusion":Ft,t.saturation=r?"saturation":Ft,t.color=r?"color":Ft,t.luminosity=r?"luminosity":Ft,t["linear-burn"]=r?"color-burn":Ft,t["linear-dodge"]=r?"color-dodge":Ft,t["linear-light"]=r?"hard-light":Ft,t["pin-light"]=r?"hard-light":Ft,t["vivid-light"]=r?"hard-light":Ft,t["hard-mix"]=Ft,t.negation=r?"difference":Ft,t["normal-npm"]=t.normal,t["add-npm"]=t.add,t["screen-npm"]=t.screen,t.erase="destination-out",t.subtract=Ft,t.divide=Ft,t.min=Ft,t.max=Ft,t}var Ft,n2=x(()=>{"use strict";ih();Ft="source-over"});var fB,Zo,o2=x(()=>{"use strict";It();C();ot();n2();fB=new F,Zo=class{constructor(t){this.activeResolution=1,this.smoothProperty="imageSmoothingEnabled",this.blendModes=i2(),this._activeBlendMode="normal",this._projTransform=null,this._outerBlend=!1,this._warnedBlendModes=new Set,this._renderer=t}resolutionChange(t){this.activeResolution=t}init(){let t=this._renderer.background.alpha<1;if(this.rootContext=this._renderer.canvas.getContext("2d",{alpha:t}),this.activeContext=this.rootContext,this.activeResolution=this._renderer.resolution,!this.rootContext.imageSmoothingEnabled){let e=this.rootContext;e.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":e.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":e.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":e.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")}}setContextTransform(t,e,s,i){let n=i?F.IDENTITY:this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix||F.IDENTITY,o=fB;o.copyFrom(n),o.append(t);let a=this._projTransform,u=this.activeResolution;if(s=s||u,a){let l=F.shared;l.copyFrom(o),l.prepend(a),o=l}e?this.activeContext.setTransform(o.a*s,o.b*s,o.c*s,o.d*s,o.tx*u|0,o.ty*u|0):this.activeContext.setTransform(o.a*s,o.b*s,o.c*s,o.d*s,o.tx*u,o.ty*u)}clear(t,e){let s=this.activeContext,i=this._renderer;if(s.clearRect(0,0,i.width,i.height),t){let n=X.shared.setValue(t);s.globalAlpha=e??n.alpha,s.fillStyle=n.toHex(),s.fillRect(0,0,i.width,i.height),s.globalAlpha=1}}setBlendMode(t){if(this._activeBlendMode===t)return;this._activeBlendMode=t,this._outerBlend=!1;let e=this.blendModes[t];if(!e){this._warnedBlendModes.has(t)||(console.warn(`CanvasRenderer: blend mode "${t}" is not supported in Canvas2D; falling back to "source-over".`),this._warnedBlendModes.add(t)),this.activeContext.globalCompositeOperation="source-over";return}this.activeContext.globalCompositeOperation=e}destroy(){this.rootContext=null,this.activeContext=null,this._warnedBlendModes.clear()}};Zo.extension={type:[m.CanvasSystem],name:"canvasContext"}});var Qo,a2=x(()=>{"use strict";C();Qo=class{constructor(){this.maxTextures=16,this.maxBatchableTextures=16,this.maxUniformBindings=0}init(){}};Qo.extension={type:[m.CanvasSystem],name:"limits"}});var yl,u2=x(()=>{"use strict";It();mt();js();yl=class{init(t,e){this._renderer=t,this._renderTargetSystem=e}initGpuRenderTarget(t){let e=t.colorTexture,{canvas:s,context:i}=this._ensureCanvas(e);return{canvas:s,context:i,width:s.width,height:s.height}}resizeGpuRenderTarget(t){let e=t.colorTexture,{canvas:s}=this._ensureCanvas(e);s.width=t.pixelWidth,s.height=t.pixelHeight}startRenderPass(t,e,s,i){let n=this._renderTargetSystem.getGpuRenderTarget(t);this._renderer.canvasContext.activeContext=n.context,this._renderer.canvasContext.activeResolution=t.resolution,e&&this.clear(t,e,s,i)}clear(t,e,s,i){let o=this._renderTargetSystem.getGpuRenderTarget(t).context,a=i||{x:0,y:0,width:t.pixelWidth,height:t.pixelHeight};if(o.setTransform(1,0,0,1,0,0),o.clearRect(a.x,a.y,a.width,a.height),s){let u=X.shared.setValue(s);u.alpha>0&&(o.globalAlpha=u.alpha,o.fillStyle=u.toHex(),o.fillRect(a.x,a.y,a.width,a.height),o.globalAlpha=1)}}finishRenderPass(){}copyToTexture(t,e,s,i,n){let a=this._renderTargetSystem.getGpuRenderTarget(t).canvas,u=e.source,{context:l}=this._ensureCanvas(u),c=n?.x??0,h=n?.y??0;return l.drawImage(a,s.x,s.y,i.width,i.height,c,h,i.width,i.height),u.update(),e}destroyGpuRenderTarget(t){}_ensureCanvas(t){let e=t.resource;(!e||!ne.test(e))&&(e=N.get().createCanvas(t.pixelWidth,t.pixelHeight),t.resource=e),(e.width!==t.pixelWidth||e.height!==t.pixelHeight)&&(e.width=t.pixelWidth,e.height=t.pixelHeight);let s=e.getContext("2d");return{canvas:e,context:s}}}});var Jo,l2=x(()=>{"use strict";C();ju();u2();Jo=class extends gs{constructor(t){super(t),this.adaptor=new yl,this.adaptor.init(t,this)}};Jo.extension={type:[m.CanvasSystem],name:"renderTarget"}});var ta,c2=x(()=>{"use strict";mt();C();Lr();ta=class{constructor(t){}init(){}initSource(t){}generateCanvas(t){let e=N.get().createCanvas(),s=e.getContext("2d"),i=Z.getCanvasSource(t);if(!i)return e;let n=t.frame,o=t.source._resolution??t.source.resolution??1,a=n.x*o,u=n.y*o,l=n.width*o,c=n.height*o;return e.width=Math.ceil(l),e.height=Math.ceil(c),s.drawImage(i,a,u,l,c,0,0,l,c),e}getPixels(t){let e=this.generateCanvas(t);return{pixels:e.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e.width,e.height).data,width:e.width,height:e.height}}destroy(){}};ta.extension={type:[m.CanvasSystem],name:"texture"}});var DE={};Ec(DE,{CanvasRenderer:()=>mf});var pB,mB,gB,BE,RE,ME,mf,h2=x(()=>{"use strict";C();Jh();ed();ly();id();dy();fd();md();fy();s2();gd();Ui();Vu();Pe();o2();a2();l2();c2();pB=[...ji,Zo,Qo,ta,Jo],mB=[oi,ro,si,ri,ni,Ko,zo,ei],gB=[hy,Vo],BE=[],RE=[],ME=[];O.handleByNamedList(m.CanvasSystem,BE);O.handleByNamedList(m.CanvasPipes,RE);O.handleByNamedList(m.CanvasPipesAdaptor,ME);O.add(...pB,...mB,...gB);mf=class extends Er{constructor(){let t={name:"canvas",type:Tt.CANVAS,systems:BE,renderPipes:RE,renderPipeAdaptors:ME};super(t)}}});var on,_f=x(()=>{"use strict";le();xt();on=class extends St{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return I(V,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return I(V,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return I(V,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return I(V,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return I(V,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(let e in this.chars)this.chars[e].texture?.destroy();this.chars=null,t&&(this.pages.forEach(e=>e.texture.destroy(!0)),this.pages=null)}}});function bf(r=1e3,t=0,e=!1){if(isNaN(r)||r<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof e!="boolean")throw new TypeError("Invalid resetTtl value");return new p2(r,t,e)}var p2,m2=x(()=>{"use strict";p2=class{constructor(t=0,e=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){let e=this.items[t];delete this.items[t],this.size--,e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){let e=new Array(t.length);for(let s=0;s<t.length;s++){let i=t[s];e[s]=[i,this.get(i)]}return e}evict(t=!1){if(t||this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){let e=this.items[t];if(e!==void 0){if(this.ttl>0&&e.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(e),e.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){let t=new Array(this.size),e=this.first,s=0;for(;e!==null;)t[s++]=e.key,e=e.next;return t}setWithEvicted(t,e,s=this.resetTtl){let i=null;if(this.has(t))this.set(t,e,!0,s);else{this.max>0&&this.size===this.max&&(i={...this.first},this.evict(!0));let n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};++this.size===1?this.first=n:this.last.next=n,this.last=n}return i}set(t,e,s=!1,i=this.resetTtl){let n=this.items[t];return s||n!==void 0?(n.value=e,s===!1&&i&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(t=this.keys()){let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=this.get(t[s]);return e}}});function Tl(r){return!!r.tagStyles&&Object.keys(r.tagStyles).length>0}function Sl(r){return r.includes("<")}function xB(r,t){return r.clone().assign(t)}function yf(r,t){let e=[],s=t.tagStyles;if(!Tl(t)||!Sl(r))return e.push({text:r,style:t}),e;let i=[t],n=[],o="",a=0;for(;a<r.length;){let u=r[a];if(u==="<"){let l=r.indexOf(">",a);if(l===-1){o+=u,a++;continue}let c=r.indexOf("<",a+1);if(c!==-1&&c<l){o+=u,a++;continue}let h=r.slice(a+1,l);if(h.startsWith("/")){let d=h.slice(1).trim();if(n.length>0&&n[n.length-1]===d){o.length>0&&(e.push({text:o,style:i[i.length-1]}),o=""),i.pop(),n.pop(),a=l+1;continue}else{o+=r.slice(a,l+1),a=l+1;continue}}else{let d=h.trim();if(s[d]){o.length>0&&(e.push({text:o,style:i[i.length-1]}),o="");let f=i[i.length-1],p=xB(f,s[d]);i.push(p),n.push(d),a=l+1;continue}else{o+=r.slice(a,l+1),a=l+1;continue}}}else o+=u,a++}return o.length>0&&e.push({text:o,style:i[i.length-1]}),e}function _B(r,t){return!Tl(t)||!Sl(r)?r:yf(r,t).map(s=>s.text).join("")}var vf=x(()=>{"use strict"});function an(r){return typeof r!="string"?!1:kE.has(r.charCodeAt(0))}function de(r,t){return typeof r!="string"?!1:LE.has(r.charCodeAt(0))}function Tf(r){return typeof r!="string"?!1:HE.has(r.charCodeAt(0))}function Sf(r){return typeof r!="string"?!1:VE.has(r.charCodeAt(0))}function un(r){return r==="normal"||r==="pre-line"}function ln(r){return r==="normal"}function dr(r){if(typeof r!="string")return"";let t=r.length-1;for(;t>=0&&de(r[t]);)t--;return t<r.length-1?r.slice(0,t+1):r}function El(r){let t=[],e=[];if(typeof r!="string")return t;for(let s=0;s<r.length;s++){let i=r[s],n=r[s+1];if(de(i,n)||an(i)){e.length>0&&(t.push(e.join("")),e.length=0),i==="\r"&&n===`
|
|
902
|
+
`))}var m0=x(()=>{"use strict";$u();te();Sd();f0()});var Ho,g0=x(()=>{"use strict";C();m0();Ho=class{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,s){let i=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==i.uniformDirtyGroups[t.uid])&&(i.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(i.uniformData,t.uniforms,this._renderer,s))}_getUniformSyncFunction(t,e){return this._uniformGroupSyncHash[t._signature]?.[e._key]||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){let s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),i=this._getSignature(t,e._uniformData,"u");return this._cache[i]||(this._cache[i]=this._generateUniformsSync(t,e._uniformData)),s[e._key]=this._cache[i],s[e._key]}_generateUniformsSync(t,e){return p0(t,e)}_getSignature(t,e,s){let i=t.uniforms,n=[`${s}-`];for(let o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}};Ho.extension={type:[m.WebGLSystem],name:"uniformGroup"}});function x0(r){let t={};if(t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof N.get().getWebGLRenderingContext()))t.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],t.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else{let s=r.getExtension("EXT_blend_minmax");s&&(t.min=[r.ONE,r.ONE,r.ONE,r.ONE,s.MIN_EXT,s.MIN_EXT],t.max=[r.ONE,r.ONE,r.ONE,r.ONE,s.MAX_EXT,s.MAX_EXT])}return t}var _0=x(()=>{"use strict";mt()});var lP,cP,hP,dP,fP,pP,sE,y0,v0=x(()=>{"use strict";C();je();_0();lP=0,cP=1,hP=2,dP=3,fP=4,pP=5,sE=class b0{constructor(t){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[lP]=this.setBlend,this.map[cP]=this.setOffset,this.map[hP]=this.setCullFace,this.map[dP]=this.setDepthTest,this.map[fP]=this.setFrontFace,this.map[pP]=this.setDepthMask,this.checks=[],this.defaultState=Ut.for2d(),t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){this._invertFrontFace=!t.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(t){this.gl=t,this.blendModesMap=x0(t),this.resetState()}set(t){if(t||(t=this.defaultState),this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e>>=1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t||(t=this.defaultState);for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(b0._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(b0._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this._cullFace=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(t){this._frontFace=t,this._frontFaceDirty=!1;let e=this._invertFrontFace?!t:t;this._glFrontFace!==e&&(this._glFrontFace=e,this.gl.frontFace(this.gl[e?"CW":"CCW"]))}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;let e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){let s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};sE.extension={type:[m.WebGLSystem],name:"state"};y0=sE});var Ji,Vd=x(()=>{"use strict";rl();Ji=class{constructor(t){this.target=Do.TEXTURE_2D,this._layerInitMask=0,this.texture=t,this.width=-1,this.height=-1,this.type=bt.UNSIGNED_BYTE,this.internalFormat=el.RGBA,this.format=el.RGBA,this.samplerType=0}destroy(){}}});var T0,S0=x(()=>{"use strict";T0={id:"buffer",upload(r,t,e,s,i,n=!1){let o=i||t.target;!n&&t.width===r.width&&t.height===r.height?e.texSubImage2D(o,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(o,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}}});var mP,E0,C0=x(()=>{"use strict";mP={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},E0={id:"compressed",upload(r,t,e,s,i,n){let o=i??t.target;e.pixelStorei(e.UNPACK_ALIGNMENT,4);let a=r.pixelWidth,u=r.pixelHeight,l=!!mP[r.format];for(let c=0;c<r.resource.length;c++){let h=r.resource[c];l?e.compressedTexImage2D(o,c,t.internalFormat,a,u,0,h):e.texImage2D(o,c,t.internalFormat,a,u,0,t.format,t.type,h),a=Math.max(a>>1,1),u=Math.max(u>>1,1)}}}});function A0(r){return{id:"cube",upload(t,e,s,i){let n=t.faces;for(let o=0;o<iE.length;o++){let a=iE[o],u=n[a];(r[u.uploadMethodId]||r.image).upload(u,e,s,i,Do.TEXTURE_CUBE_MAP_POSITIVE_X+o,(e._layerInitMask&1<<o)===0),e._layerInitMask|=1<<o}e.width=t.pixelWidth,e.height=t.pixelHeight}}}var iE,w0=x(()=>{"use strict";rl();iE=["right","left","top","bottom","front","back"]});function gP(r,t,e,s,i,n,o,a,u,l){if(!l){u&&r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,null),r.texSubImage2D(t,0,0,0,n,o,e.format,e.type,a);return}if(!u){r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,a)}function xP(r,t,e,s,i,n,o,a,u,l){if(!l){u&&r.texImage2D(t,0,e.internalFormat,s,i,0,e.format,e.type,null),r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}if(!u){r.texSubImage2D(t,0,0,0,e.format,e.type,a);return}r.texImage2D(t,0,e.internalFormat,e.format,e.type,a)}var al,zd=x(()=>{"use strict";al={id:"image",upload(r,t,e,s,i,n=!1){let o=i||t.target,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight,h=s===2,d=n||t.width!==a||t.height!==u,f=l>=a&&c>=u,p=r.resource;(h?gP:xP)(e,o,t,a,u,l,c,p,d,f),t.width=a,t.height=u}}});function ul(){let{userAgent:r}=N.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(r)}var Xd=x(()=>{"use strict";mt()});var _P,P0,B0=x(()=>{"use strict";Xd();zd();_P=ul(),P0={id:"video",upload(r,t,e,s,i,n=_P){if(!r.isValid){let o=i??t.target;e.texImage2D(o,0,t.internalFormat,1,1,0,t.format,t.type,null);return}al.upload(r,t,e,s,i,n)}}});var $d,R0,ll,M0,D0=x(()=>{"use strict";$d={linear:9729,nearest:9728},R0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},ll={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},M0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519}});function Yd(r,t,e,s,i,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=ll[o?"clamp-to-edge":r.addressModeU],c=ll[o?"clamp-to-edge":r.addressModeV],h=ll[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,h)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,$d[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){let l=R0[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,$d[r.minFilter]);if(s&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,M0[r.compare])}var F0=x(()=>{"use strict";D0()});function G0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var U0=x(()=>{"use strict"});function I0(r,t){let e={},s=r.RGBA;return r instanceof N.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...e,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var k0=x(()=>{"use strict";mt()});function O0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var L0=x(()=>{"use strict"});function N0(r){return{"2d":r.TEXTURE_2D,cube:r.TEXTURE_CUBE_MAP,"1d":null,"3d":r?.TEXTURE_3D||null,"2d-array":r?.TEXTURE_2D_ARRAY||null,"cube-array":r?.TEXTURE_CUBE_MAP_ARRAY||null}}var H0=x(()=>{"use strict"});function bP(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let t=r.length;for(let e=0;e<t;e+=4){let s=r[e+3];if(s!==0){let i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}var nE=x(()=>{"use strict"});var yP,W0,jd,V0=x(()=>{"use strict";mt();C();ye();ht();Vd();S0();C0();w0();zd();B0();F0();U0();k0();L0();H0();yP=4,W0=class oE{constructor(t){this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=t,this._managedTextures=new vt({renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"});let e={image:al,buffer:T0,video:P0,compressed:E0,...oE.uploadExtensions};this._uploads={...e,cube:A0(e)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=I0(t,this._renderer.context.extensions),this._mapFormatToType=O0(t),this._mapFormatToFormat=G0(t),this._mapViewDimensionToGlTarget=N0(t)),this._managedTextures.removeAll(!0),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let e=0;e<16;e++)this.bind(D.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){let s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){let s=this._gl;if(t._gcLastUsed=this._renderer.gc.now,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t||(t=D.EMPTY.source);let i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){let s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}let i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){let e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);let o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){let e=this._gl,s=new Ji(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],s.target=this._mapViewDimensionToGlTarget[t.viewDimension],s.target===null)throw new Error(`Unsupported view dimension: ${t.viewDimension} with this webgl version: ${this._renderer.context.webGLVersion}`);if(t.uploadMethodId==="cube"&&(s.target=e.TEXTURE_CUBE_MAP),t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){let n=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(n))+1}return t._gpuData[this._renderer.uid]=s,this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){let s=this._gl,i=this.getGlSource(t);s.bindTexture(i.target,i.texture),this._boundTextures[this._activeTextureLocation]=t,Yd(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.target,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t,e=!1){let s=t._gpuData[this._renderer.uid];s&&(e||(this.unbind(t),this._gl.deleteTexture(s.texture)),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this))}onSourceUpdate(t){let e=this._gl,s=this.getGlSource(t);e.bindTexture(s.target,s.texture),this._boundTextures[this._activeTextureLocation]=t;let i=t.alphaMode==="premultiply-alpha-on-upload";if(this._premultiplyAlpha!==i&&(this._premultiplyAlpha=i,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i)),this._uploads[t.uploadMethodId])this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion);else if(s.target===e.TEXTURE_2D)this._initEmptyTexture2D(s,t);else if(s.target===e.TEXTURE_2D_ARRAY)this._initEmptyTexture2DArray(s,t);else if(s.target===e.TEXTURE_CUBE_MAP)this._initEmptyTextureCube(s,t);else throw new Error("[GlTextureSystem] Unsupported texture target for empty allocation.");this._applyMipRange(s,t),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);let s=this.getGlSource(t);this._gl.generateMipmap(s.target)}_initEmptyTexture2D(t,e){let s=this._gl;s.texImage2D(s.TEXTURE_2D,0,t.internalFormat,e.pixelWidth,e.pixelHeight,0,t.format,t.type,null);let i=Math.max(e.pixelWidth>>1,1),n=Math.max(e.pixelHeight>>1,1);for(let o=1;o<e.mipLevelCount;o++)s.texImage2D(s.TEXTURE_2D,o,t.internalFormat,i,n,0,t.format,t.type,null),i=Math.max(i>>1,1),n=Math.max(n>>1,1)}_initEmptyTexture2DArray(t,e){if(this._renderer.context.webGLVersion!==2)throw new Error("[GlTextureSystem] TEXTURE_2D_ARRAY requires WebGL2.");let s=this._gl,i=Math.max(e.arrayLayerCount|0,1);s.texImage3D(s.TEXTURE_2D_ARRAY,0,t.internalFormat,e.pixelWidth,e.pixelHeight,i,0,t.format,t.type,null);let n=Math.max(e.pixelWidth>>1,1),o=Math.max(e.pixelHeight>>1,1);for(let a=1;a<e.mipLevelCount;a++)s.texImage3D(s.TEXTURE_2D_ARRAY,a,t.internalFormat,n,o,i,0,t.format,t.type,null),n=Math.max(n>>1,1),o=Math.max(o>>1,1)}_initEmptyTextureCube(t,e){let s=this._gl,i=6;for(let a=0;a<i;a++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,t.internalFormat,e.pixelWidth,e.pixelHeight,0,t.format,t.type,null);let n=Math.max(e.pixelWidth>>1,1),o=Math.max(e.pixelHeight>>1,1);for(let a=1;a<e.mipLevelCount;a++){for(let u=0;u<i;u++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+u,a,t.internalFormat,n,o,0,t.format,t.type,null);n=Math.max(n>>1,1),o=Math.max(o>>1,1)}}_applyMipRange(t,e){if(this._renderer.context.webGLVersion!==2||e.mipLevelCount<=1)return;let s=this._gl,i=Math.max((e.mipLevelCount|0)-1,0);s.texParameteri(t.target,s.TEXTURE_BASE_LEVEL,0),s.texParameteri(t.target,s.TEXTURE_MAX_LEVEL,i)}_initSampler(t){let e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,Yd(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this._initSource(t)}generateCanvas(t){let{pixels:e,width:s,height:i}=this.getPixels(t),n=N.get().createCanvas();n.width=s,n.height=i;let o=n.getContext("2d");if(o){let a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){let e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(yP*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this._managedTextures.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(D.EMPTY.source),this._boundSamplers=Object.create(null);let t=this._gl;this._premultiplyAlpha=!1,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}};W0.extension={type:[m.WebGLSystem],name:"texture"};W0.uploadExtensions=Object.create(null);jd=W0;O.handleByMap(m.TextureUploaderWebGL,jd.uploadExtensions)});var cE={};Ec(cE,{WebGLRenderer:()=>qd});var vP,TP,SP,aE,uE,lE,qd,z0=x(()=>{"use strict";C();bb();yb();vb();ki();zu();Pe();Eb();wb();Rb();Fb();Gb();Ub();Ib();kb();Vb();$b();c0();g0();v0();V0();vP=[...Ki,Oo,Db,Ab,Io,Mo,jd,Lo,Fo,Ho,No,Uo,y0,ko,Go],TP=[...Vu],SP=[Bo,Po,wo],aE=[],uE=[],lE=[];O.handleByNamedList(m.WebGLSystem,aE);O.handleByNamedList(m.WebGLPipes,uE);O.handleByNamedList(m.WebGLPipesAdaptor,lE);O.add(...vP,...TP,...SP);qd=class extends Er{constructor(){let t={name:"webgl",type:Tt.WEBGL,systems:aE,renderPipes:uE,renderPipeAdaptors:lE};super(t)}}});var X0,$0,hE=x(()=>{"use strict";X0=1e-4,$0=1e-4});function Y0(r){let t=r.length;if(t<6)return 1;let e=0;for(let s=0,i=r[t-2],n=r[t-1];s<t;s+=2){let o=r[s],a=r[s+1];e+=(o-i)*(a+n),i=o,n=a}return e<0?-1:1}var j0=x(()=>{"use strict"});function dE(r,t,e,s,i,n,o,a){let u=r-e*i,l=t-s*i,c=r+e*n,h=t+s*n,d,f;o?(d=s,f=-e):(d=-s,f=e);let p=u+d,g=l+f,_=c+d,b=h+f;return a.push(p,g),a.push(_,b),2}function tn(r,t,e,s,i,n,o,a){let u=e-r,l=s-t,c=Math.atan2(u,l),h=Math.atan2(i-r,n-t);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,f=h-c,p=Math.abs(f),g=Math.sqrt(u*u+l*l),_=(15*p*Math.sqrt(g)/Math.PI>>0)+1,b=f/_;if(d+=b,a){o.push(r,t),o.push(e,s);for(let y=1,v=d;y<_;y++,v+=b)o.push(r,t),o.push(r+Math.sin(v)*g,t+Math.cos(v)*g);o.push(r,t),o.push(i,n)}else{o.push(e,s),o.push(r,t);for(let y=1,v=d;y<_;y++,v+=b)o.push(r+Math.sin(v)*g,t+Math.cos(v)*g),o.push(r,t);o.push(i,n),o.push(r,t)}return _*2}function en(r,t,e,s,i,n){let o=1e-4;if(r.length===0)return;let a=t,u=a.alignment;if(t.alignment!==.5){let L=Y0(r);e&&(L*=-1),u=(u-.5)*L+.5}let l=new nt(r[0],r[1]),c=new nt(r[r.length-2],r[r.length-1]),h=s,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let L=(l.x+c.x)*.5,K=(c.y+l.y)*.5;r.unshift(L,K),r.push(L,K)}let f=i,p=r.length/2,g=r.length,_=f.length/2,b=a.width/2,y=b*b,v=a.miterLimit*a.miterLimit,T=r[0],S=r[1],E=r[2],w=r[3],M=0,P=0,R=-(S-w),A=T-E,G=0,H=0,W=Math.sqrt(R*R+A*A);R/=W,A/=W,R*=b,A*=b;let $=u,B=(1-$)*2,U=$*2;h||(a.cap==="round"?g+=tn(T-R*(B-U)*.5,S-A*(B-U)*.5,T-R*B,S-A*B,T+R*U,S+A*U,f,!0)+2:a.cap==="square"&&(g+=dE(T,S,R,A,B,U,!0,f))),f.push(T-R*B,S-A*B),f.push(T+R*U,S+A*U);for(let L=1;L<p-1;++L){T=r[(L-1)*2],S=r[(L-1)*2+1],E=r[L*2],w=r[L*2+1],M=r[(L+1)*2],P=r[(L+1)*2+1],R=-(S-w),A=T-E,W=Math.sqrt(R*R+A*A),R/=W,A/=W,R*=b,A*=b,G=-(w-P),H=E-M,W=Math.sqrt(G*G+H*H),G/=W,H/=W,G*=b,H*=b;let K=E-T,gt=S-w,ft=E-M,Y=P-w,Q=K*ft+gt*Y,j=gt*ft-Y*K,Bt=j<0;if(Math.abs(j)<.001*Math.abs(Q)){f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),Q>=0&&(a.join==="round"?g+=tn(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+4:g+=2,f.push(E-G*U,w-H*U),f.push(E+G*B,w+H*B));continue}let Ht=(-R+T)*(-A+w)-(-R+E)*(-A+S),Me=(-G+M)*(-H+w)-(-G+E)*(-H+P),De=(K*Me-ft*Ht)/j,se=(Y*Ht-gt*Me)/j,Fe=(De-E)*(De-E)+(se-w)*(se-w),ie=E+(De-E)*B,tr=w+(se-w)*B,er=E-(De-E)*U,mr=w-(se-w)*U,Gs=Math.min(K*K+gt*gt,ft*ft+Y*Y),ts=Bt?B:U,Oa=Gs+ts*ts*y;Fe<=Oa?a.join==="bevel"||Fe/y>v?(Bt?(f.push(ie,tr),f.push(E+R*U,w+A*U),f.push(ie,tr),f.push(E+G*U,w+H*U)):(f.push(E-R*B,w-A*B),f.push(er,mr),f.push(E-G*B,w-H*B),f.push(er,mr)),g+=2):a.join==="round"?Bt?(f.push(ie,tr),f.push(E+R*U,w+A*U),g+=tn(E,w,E+R*U,w+A*U,E+G*U,w+H*U,f,!0)+4,f.push(ie,tr),f.push(E+G*U,w+H*U)):(f.push(E-R*B,w-A*B),f.push(er,mr),g+=tn(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+4,f.push(E-G*B,w-H*B),f.push(er,mr)):(f.push(ie,tr),f.push(er,mr)):(f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),a.join==="round"?Bt?g+=tn(E,w,E+R*U,w+A*U,E+G*U,w+H*U,f,!0)+2:g+=tn(E,w,E-R*B,w-A*B,E-G*B,w-H*B,f,!1)+2:a.join==="miter"&&Fe/y<=v&&(Bt?(f.push(er,mr),f.push(er,mr)):(f.push(ie,tr),f.push(ie,tr)),g+=2),f.push(E-G*B,w-H*B),f.push(E+G*U,w+H*U),g+=2)}T=r[(p-2)*2],S=r[(p-2)*2+1],E=r[(p-1)*2],w=r[(p-1)*2+1],R=-(S-w),A=T-E,W=Math.sqrt(R*R+A*A),R/=W,A/=W,R*=b,A*=b,f.push(E-R*B,w-A*B),f.push(E+R*U,w+A*U),h||(a.cap==="round"?g+=tn(E-R*(B-U)*.5,w-A*(B-U)*.5,E-R*B,w-A*B,E+R*U,w+A*U,f,!1)+2:a.cap==="square"&&(g+=dE(E,w,R,A,B,U,!1,f)));let z=1e-4*1e-4;for(let L=_;L<g+_-2;++L)T=f[L*2],S=f[L*2+1],E=f[(L+1)*2],w=f[(L+1)*2+1],M=f[(L+2)*2],P=f[(L+2)*2+1],!(Math.abs(T*(w-P)+E*(P-S)+M*(S-w))<z)&&n.push(L,L+1,L+2)}var cl=x(()=>{"use strict";Ue();j0()});function pE(r,t){for(let e=0;e<t.length;e++){let s=t[e];r.addColorStop(s.offset,s.color)}}function mE(r,t){let e=N.get().createCanvas(r,t),s=e.getContext("2d");return{canvas:e,context:s}}function EP(r){let t=r[0]??{};return(typeof t=="number"||r[1])&&(I("8.5.2","use options object instead"),t={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??Nt.defaultLinearOptions.textureSize}),t}var fE,K0,Nt,zr=x(()=>{"use strict";It();mt();ot();wi();ht();Yt();xt();Ns();fE=[{offset:0,color:"white"},{offset:1,color:"black"}],K0=class q0{constructor(...t){this.uid=et("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let e=EP(t);e={...e.type==="radial"?q0.defaultRadialOptions:q0.defaultLinearOptions,...xe(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(i=>{this.addColorStop(i.offset,i.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:X.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:s,y:i}=this.end,n=s-t,o=i-e,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let _=t;t=s,s=_,n*=-1}if(o<0){let _=e;e=i,i=_,o*=-1}}let u=this.colorStops.length?this.colorStops:fE,l=this._textureSize,{canvas:c,context:h}=mE(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);pE(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new D({source:new ke({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),p=Math.atan2(o,n),g=new F;g.scale(f/l,1),g.rotate(p),g.translate(t,e),this.textureSpace==="local"&&g.scale(l,l),this.transform=g}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let t=this.colorStops.length?this.colorStops:fE,e=this._textureSize,{canvas:s,context:i}=mE(e,e),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,f=e/(c*2),p=(n-h)*f,g=(o-d)*f,_=i.createRadialGradient(p,g,l*f,(a-h)*f,(u-d)*f,c*f);pE(_,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=_,i.translate(p,g),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-p,-g),i.fillRect(0,0,e,e),this.texture=new D({source:new ke({resource:s,addressMode:this._wrapMode})});let b=new F;this.textureSpace==="local"?b.scale(2*c,2*c):b.scale(1/f,1/f),b.translate(h,d),this.transform=b}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};K0.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};K0.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,rotation:0,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};Nt=K0});function CP(r){return r.texture!==void 0}var gE,hr,Wo=x(()=>{"use strict";ot();Yt();gE={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},hr=class{constructor(t,e){this.uid=et("fillPattern"),this._tick=0,this.transform=new F;let s=CP(t)?t:{texture:t,repetition:e};this.texture=s.texture,this.textureSpace=s.textureSpace??"global";let i=s.repetition;i&&(this.texture.source.style.addressModeU=gE[i].addressModeU,this.texture.source.style.addressModeV=gE[i].addressModeV)}setTransform(t){if(t){if(this.transform.equals(t))return;this.transform.copyFrom(t)}else{if(this.transform.isIdentity())return;this.transform.identity()}this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}});function hl(r,t,e,s,i,n,o,a=null){let u=0;e*=t,i*=n;let l=a.a,c=a.b,h=a.c,d=a.d,f=a.tx,p=a.ty;for(;u<o;){let g=r[e],_=r[e+1];s[i]=l*g+h*_+f,s[i+1]=c*g+d*_+p,i+=n,e+=t,u++}}function dl(r,t,e,s){let i=0;for(t*=e;i<s;)r[t]=0,r[t+1]=0,t+=e,i++}var Kd=x(()=>{"use strict"});function Vo(r,t,e,s,i){let n=t.a,o=t.b,a=t.c,u=t.d,l=t.tx,c=t.ty;e||(e=0),s||(s=2),i||(i=r.length/s-e);let h=e*s;for(let d=0;d<i;d++){let f=r[h],p=r[h+1];r[h]=n*f+a*p+l,r[h+1]=o*f+u*p+c,h+=s}}var Zd=x(()=>{"use strict"});var AP,li,Qd=x(()=>{"use strict";ot();Os();AP=new F,li=class{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let t=this.baseColor,e=t>>16|t&65280|(t&255)<<16,s=this.renderable;return s?Ie(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||AP}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}});var rn,Z0,Q0,J0=x(()=>{"use strict";C();rn={extension:{type:m.ShapeBuilder,name:"circle"},build(r,t){let e,s,i,n,o,a;if(r.type==="circle"){let T=r;if(o=a=T.radius,o<=0)return!1;e=T.x,s=T.y,i=n=0}else if(r.type==="ellipse"){let T=r;if(o=T.halfWidth,a=T.halfHeight,o<=0||a<=0)return!1;e=T.x,s=T.y,i=n=0}else{let T=r,S=T.width/2,E=T.height/2;e=T.x+S,s=T.y+E,o=a=Math.max(0,Math.min(T.radius,Math.min(S,E))),i=S-o,n=E-a}if(i<0||n<0)return!1;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(i?4:0)+(n?4:0);if(l===0)return!1;if(u===0)return t[0]=t[6]=e+i,t[1]=t[3]=s+n,t[2]=t[4]=e-i,t[5]=t[7]=s-n,!0;let c=0,h=u*4+(i?2:0)+2,d=h,f=l,p=i+o,g=n,_=e+p,b=e-p,y=s+g;if(t[c++]=_,t[c++]=y,t[--h]=y,t[--h]=b,n){let T=s-g;t[d++]=b,t[d++]=T,t[--f]=T,t[--f]=_}for(let T=1;T<u;T++){let S=Math.PI/2*(T/u),E=i+Math.cos(S)*o,w=n+Math.sin(S)*a,M=e+E,P=e-E,R=s+w,A=s-w;t[c++]=M,t[c++]=R,t[--h]=R,t[--h]=P,t[d++]=P,t[d++]=A,t[--f]=A,t[--f]=M}p=i,g=n+a,_=e+p,b=e-p,y=s+g;let v=s-g;return t[c++]=_,t[c++]=y,t[--f]=v,t[--f]=_,i&&(t[c++]=b,t[c++]=y,t[--f]=v,t[--f]=b),!0},triangulate(r,t,e,s,i,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=s;t[u*e]=o,t[u*e+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)t[u*e]=r[c],t[u*e+1]=r[c+1],c>0&&(i[n++]=u,i[n++]=l,i[n++]=u-1),u++;i[n++]=l+1,i[n++]=l,i[n++]=u-1}},Z0={...rn,extension:{...rn.extension,name:"ellipse"}},Q0={...rn,extension:{...rn.extension,name:"roundedRectangle"}}});function ty(r,t,e,s){let i=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=t||Math.abs(n-a)<i&&Math.abs(o-u)<i,c=e,h=r.length/2,d=c.length/2;for(let f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)s.push(d+f,d+f+1);l&&s.push(d+h-1,d)}var ey=x(()=>{"use strict"});function fl(r,t,e,s,i,n,o){let a=lx(r,t,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+i,n[o++]=a[l+1]+i,n[o++]=a[l+2]+i;let u=i*s;for(let l=0;l<r.length;l+=2)e[u]=r[l],e[u+1]=r[l+1],u+=s}var Jd=x(()=>{"use strict";cx()});var wP,ry,sy=x(()=>{"use strict";C();Jd();wP=[],ry={extension:{type:m.ShapeBuilder,name:"polygon"},build(r,t){for(let e=0;e<r.points.length;e++)t[e]=r.points[e];return!0},triangulate(r,t,e,s,i,n){fl(r,wP,t,e,s,i,n)}}});var iy,ny=x(()=>{"use strict";C();iy={extension:{type:m.ShapeBuilder,name:"rectangle"},build(r,t){let e=r,s=e.x,i=e.y,n=e.width,o=e.height;return n>0&&o>0?(t[0]=s,t[1]=i,t[2]=s+n,t[3]=i,t[4]=s+n,t[5]=i+o,t[6]=s,t[7]=i+o,!0):!1},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[6],t[s+o+1]=r[7],o+=e,t[s+o]=r[4],t[s+o+1]=r[5],o+=e;let a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2,i[n++]=a+1,i[n++]=a+3,i[n++]=a+2}}});var oy,ay=x(()=>{"use strict";C();oy={extension:{type:m.ShapeBuilder,name:"triangle"},build(r,t){return t[0]=r.x,t[1]=r.y,t[2]=r.x2,t[3]=r.y2,t[4]=r.x3,t[5]=r.y3,!0},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[4],t[s+o+1]=r[5];let a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2}}});function pl(r,t,e,s){let i=t.matrix?r.copyFrom(t.matrix).invert():r.identity();if(t.textureSpace==="local"){let o=e.getBounds(BP);t.width&&o.pad(t.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,f=i.a,p=i.b,g=i.c,_=i.d;i.a*=l,i.b*=l,i.c*=c,i.d*=c,i.tx=h*f+d*g+i.tx,i.ty=h*p+d*_+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let n=t.texture.source.style;return!(t.fill instanceof Nt)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),s&&i.append(PP.copyFrom(s).invert()),i}var PP,BP,tf=x(()=>{"use strict";ot();jt();zr();PP=new F,BP=new J});function uy(r,t){let{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i<r.instructions.length;i++){let n=r.instructions[i];if(n.action==="texture")DP(n.data,s,e);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&xE(l.shapePath,u,!0,s,e),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),xE(a,u,o,s,e)}}}function DP(r,t,e){let s=[],i=Fr.rectangle,n=RP;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!i.build(n,s))return;let{vertices:a,uvs:u,indices:l}=e,c=l.length,h=a.length/2;o&&Vo(s,o),i.triangulate(s,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let p=Ct.get(li);p.indexOffset=c,p.indexSize=l.length-c,p.attributeOffset=h,p.attributeSize=a.length/2-h,p.baseColor=r.style,p.alpha=r.alpha,p.texture=d,p.geometryData=e,t.push(p)}function xE(r,t,e,s,i){let{vertices:n,uvs:o,indices:a}=i;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Fr[u.type];if(!d.build(u,h))return;let f=a.length,p=n.length/2,g="triangle-list";if(l&&Vo(h,l),e){let v=u.closePath??!0,T=t;T.pixelLine?(ty(h,v,n,a),g="line-list"):en(h,T,!1,v,n,a)}else if(c){let v=[],T=h.slice();FP(c).forEach(E=>{v.push(T.length/2),T.push(...E)}),fl(T,v,n,2,p,a,f)}else d.triangulate(h,n,2,p,a,f);let _=o.length/2,b=t.texture;if(b!==D.WHITE){let v=pl(MP,t,u,l);hl(n,2,p,o,_,2,n.length/2-p,v)}else dl(o,_,2,n.length/2-p);let y=Ct.get(li);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=p,y.attributeSize=n.length/2-p,y.baseColor=t.color,y.alpha=t.alpha,y.texture=b,y.geometryData=i,y.topology=g,s.push(y)})}function FP(r){let t=[];for(let e=0;e<r.length;e++){let s=r[e].shape,i=[];Fr[s.type].build(s,i)&&t.push(i)}return t}var Fr,RP,MP,zo=x(()=>{"use strict";C();ot();jt();Kd();Zd();ht();xr();Qd();J0();cl();ey();sy();ny();ay();tf();Jd();Fr={};O.handleByMap(m.ShapeBuilder,Fr);O.add(iy,ry,oy,rn,Z0,Q0);RP=new J,MP=new F});function kP(r,t,e){r.beginPath();for(let s=0;s<e.length;s+=3){let i=e[s]*2,n=e[s+1]*2,o=e[s+2]*2;r.moveTo(t[i],t[i+1]),r.lineTo(t[n],t[n+1]),r.lineTo(t[o],t[o+1]),r.closePath()}r.fill()}function OP(r){return`#${(r&16777215).toString(16).padStart(6,"0")}`}function LP(r,t,e,s,i,n){n=Math.max(0,Math.min(n,Math.min(s,i)/2)),r.moveTo(t+n,e),r.lineTo(t+s-n,e),r.quadraticCurveTo(t+s,e,t+s,e+n),r.lineTo(t+s,e+i-n),r.quadraticCurveTo(t+s,e+i,t+s-n,e+i),r.lineTo(t+n,e+i),r.quadraticCurveTo(t,e+i,t,e+i-n),r.lineTo(t,e+n),r.quadraticCurveTo(t,e,t+n,e)}function rf(r,t){switch(t.type){case"rectangle":{let e=t;r.rect(e.x,e.y,e.width,e.height);break}case"roundedRectangle":{let e=t;LP(r,e.x,e.y,e.width,e.height,e.radius);break}case"circle":{let e=t;r.arc(e.x,e.y,e.radius,0,Math.PI*2);break}case"ellipse":{let e=t;r.ellipse?r.ellipse(e.x,e.y,e.halfWidth,e.halfHeight,0,0,Math.PI*2):(r.save(),r.translate(e.x,e.y),r.scale(e.halfWidth,e.halfHeight),r.arc(0,0,1,0,Math.PI*2),r.restore());break}case"triangle":{let e=t;r.moveTo(e.x,e.y),r.lineTo(e.x2,e.y2),r.lineTo(e.x3,e.y3),r.closePath();break}default:{let e=t,s=e.points;if(!s?.length)break;r.moveTo(s[0],s[1]);for(let i=2;i<s.length;i+=2)r.lineTo(s[i],s[i+1]);e.closePath&&r.closePath();break}}}function NP(r,t){if(!t?.length)return!1;for(let e=0;e<t.length;e++){let s=t[e];if(!s?.shape)continue;let i=s.transform,n=i&&!i.isIdentity();n&&(r.save(),r.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),rf(r,s.shape),n&&r.restore()}return!0}function HP(r,t,e,s){let i=r.fill;if(i instanceof Nt){i.buildGradient();let o=i.texture;if(o){let a=Z.getTintedPattern(o,t),u=e?ly.copyFrom(e).scale(o.source.pixelWidth,o.source.pixelHeight):ly.copyFrom(i.transform);return s&&!r.textureSpace&&u.append(s),Z.applyPatternTransform(a,u),a}}if(i instanceof hr){let o=Z.getTintedPattern(i.texture,t);return Z.applyPatternTransform(o,i.transform,!1),o}let n=r.texture;if(n&&n!==D.WHITE){if(!n.source.resource)return GP;let o=Z.getTintedPattern(n,t),a=e?ly.copyFrom(e).scale(n.source.pixelWidth,n.source.pixelHeight):r.matrix;return Z.applyPatternTransform(o,a),o}return OP(t)}var GP,ef,UP,IP,ly,Xo,cy=x(()=>{"use strict";C();Hs();ot();Lr();ht();Ls();Os();cl();zr();Wo();zo();tf();GP="#808080",ef=new F,UP=new F,IP=new F,ly=new F;Xo=class{constructor(){this.shader=null}contextChange(t){}execute(t,e){let s=t.renderer,i=s.canvasContext,n=i.activeContext,o=e.groupTransform,a=s.globalUniforms.globalUniformData?.worldColor??4294967295,u=e.groupColorAlpha,l=(a>>>24&255)/255,c=(u>>>24&255)/255,h=s.filter?.alphaMultiplier??1,d=l*c*h;if(d<=0)return;let f=a&16777215,p=u&16777215,g=Te(Ie(p,f)),_=s._roundPixels|e._roundPixels;n.save(),i.setContextTransform(o,_===1),i.setBlendMode(e.groupBlendMode);let b=e.context.instructions;for(let y=0;y<b.length;y++){let v=b[y];if(v.action==="texture"){let A=v.data,G=A.image,H=G?Z.getCanvasSource(G):null;if(!H)continue;let W=A.alpha*d;if(W<=0)continue;let $=Ie(A.style,g);n.globalAlpha=W;let B=H;$!==16777215&&(B=Z.getTintedCanvas({texture:G},$));let U=G.frame,z=G.source._resolution??G.source.resolution??1,L=U.x*z,K=U.y*z,gt=U.width*z,ft=U.height*z;B!==H&&(L=0,K=0);let Y=A.transform,Q=Y&&!Y.isIdentity(),j=G.rotate;Q||j?(ef.copyFrom(o),Q&&ef.append(Y),j&&q.matrixAppendRotationInv(ef,j,A.dx,A.dy,A.dw,A.dh),i.setContextTransform(ef,_===1)):i.setContextTransform(o,_===1),n.drawImage(B,L,K,B===H?gt:B.width,B===H?ft:B.height,j?0:A.dx,j?0:A.dy,A.dw,A.dh),(Q||j)&&i.setContextTransform(o,_===1);continue}let T=v.data,S=T?.path?.shapePath;if(!S?.shapePrimitives?.length)continue;let E=T.style,w=Ie(E.color,g),M=E.alpha*d;if(M<=0)continue;let P=v.action==="stroke";if(n.globalAlpha=M,P){let A=E;n.lineWidth=A.width,n.lineCap=A.cap,n.lineJoin=A.join,n.miterLimit=A.miterLimit}let R=S.shapePrimitives;if(!P&&T.hole?.shapePath?.shapePrimitives?.length){let A=R[R.length-1];A.holes=T.hole.shapePath.shapePrimitives}for(let A=0;A<R.length;A++){let G=R[A];if(!G?.shape)continue;let H=G.transform,W=H&&!H.isIdentity(),$=E.texture&&E.texture!==D.WHITE,B=E.textureSpace==="global"?H:null,U=$?pl(UP,E,G.shape,B):null,z=W?IP.copyFrom(o).append(H):o,L=HP(E,w,U,z);if(W&&(n.save(),n.transform(H.a,H.b,H.c,H.d,H.tx,H.ty)),P){let K=E;if(K.alignment!==.5&&!K.pixelLine){let ft=[],Y=[],Q=[];if(Fr[G.shape.type]?.build(G.shape,ft)){let Bt=G.shape.closePath??!0;en(ft,K,!1,Bt,Y,Q),n.fillStyle=L,kP(n,Y,Q)}else n.strokeStyle=L,n.beginPath(),rf(n,G.shape),n.stroke()}else n.strokeStyle=L,n.beginPath(),rf(n,G.shape),n.stroke()}else n.fillStyle=L,n.beginPath(),rf(n,G.shape),NP(n,G.holes)?n.fill("evenodd"):n.fill();W&&n.restore()}}n.restore()}destroy(){this.shader=null}};Xo.extension={type:[m.CanvasPipesAdaptor],name:"graphics"}});var hy,dy,fy=x(()=>{"use strict";C();Hs();ot();Ls();Os();Lr();hy=class sn{static _getPatternRepeat(t,e){let s=t&&t!=="clamp-to-edge",i=e&&e!=="clamp-to-edge";return s&&i?"repeat":s?"repeat-x":i?"repeat-y":"no-repeat"}start(t,e,s){}execute(t,e){let s=e.elements;if(!s||!s.length)return;let i=t.renderer,n=i.canvasContext,o=n.activeContext;for(let a=0;a<s.length;a++){let u=s[a];if(!u.packAsQuad)continue;let l=u,c=l.texture,h=c?Z.getCanvasSource(c):null;if(!h)continue;let d=c.source.style,f=n.smoothProperty,p=d.scaleMode!=="nearest";o[f]!==p&&(o[f]=p),n.setBlendMode(e.blendMode);let g=i.globalUniforms.globalUniformData?.worldColor??4294967295,_=l.color,b=(g>>>24&255)/255,y=(_>>>24&255)/255,v=i.filter?.alphaMultiplier??1,T=b*y*v;if(T<=0)continue;o.globalAlpha=T;let S=g&16777215,E=_&16777215,w=Te(Ie(E,S)),M=c.frame,P=d.addressModeU??d.addressMode,R=d.addressModeV??d.addressMode,A=sn._getPatternRepeat(P,R),G=c.source._resolution??c.source.resolution??1,H=l.renderable?.renderGroup?.isCachedAsTexture,W=M.x*G,$=M.y*G,B=M.width*G,U=M.height*G,z=l.bounds,L=i.renderTarget.renderTarget.isRoot,K=z.minX,gt=z.minY,ft=z.maxX-z.minX,Y=z.maxY-z.minY,Q=c.rotate,j=c.uvs,Bt=Math.min(j.x0,j.x1,j.x2,j.x3,j.y0,j.y1,j.y2,j.y3),Ht=Math.max(j.x0,j.x1,j.x2,j.x3,j.y0,j.y1,j.y2,j.y3),Me=A!=="no-repeat"&&(Bt<0||Ht>1),se=Q&&!(!Me&&(w!==16777215||Q));se?(sn._tempPatternMatrix.copyFrom(l.transform),q.matrixAppendRotationInv(sn._tempPatternMatrix,Q,K,gt,ft,Y),n.setContextTransform(sn._tempPatternMatrix,l.roundPixels===1,void 0,H&&L)):n.setContextTransform(l.transform,l.roundPixels===1,void 0,H&&L);let Fe=ft,ie=Y,tr=se?0:K,er=se?0:gt;if(!se&&l.roundPixels===1&&(tr|=0,er|=0),Me){let mr=h,Gs=w!==16777215&&!Q,ts=M.width<=c.source.width&&M.height<=c.source.height;Gs&&ts&&(mr=Z.getTintedCanvas({texture:c},w));let Oa=o.createPattern(mr,A);if(!Oa)continue;let vp=Fe,F1=ie;if(vp===0||F1===0)continue;let G1=1/vp,U1=1/F1,I1=(j.x1-j.x0)*G1,k1=(j.y1-j.y0)*G1,O1=(j.x3-j.x0)*U1,L1=(j.y3-j.y0)*U1,iw=j.x0-I1*tr-O1*er,nw=j.y0-k1*tr-L1*er,Tp=c.source.pixelWidth,Sp=c.source.pixelHeight;sn._tempPatternMatrix.set(I1*Tp,k1*Sp,O1*Tp,L1*Sp,iw*Tp,nw*Sp),Z.applyPatternTransform(Oa,sn._tempPatternMatrix),o.fillStyle=Oa,o.fillRect(tr,er,Fe,ie)}else{let Gs=w!==16777215||Q?Z.getTintedCanvas({texture:c},w):h,ts=Gs!==h;o.drawImage(Gs,ts?0:W,ts?0:$,ts?Gs.width:B,ts?Gs.height:U,tr,er,Fe,ie)}}}};hy._tempPatternMatrix=new F;hy.extension={type:[m.CanvasPipesAdaptor],name:"batch"};dy=hy});var $o,py=x(()=>{"use strict";C();$o=class{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,s){this._renderer.renderPipes.batch.break(s);let i=this._colorStack;i[this._colorStackIndex]=i[this._colorStackIndex-1]&t.mask;let n=this._colorStack[this._colorStackIndex];n!==this._currentColor&&(this._currentColor=n,s.add({renderPipeId:"colorMask",colorMask:n,canBundle:!1})),this._colorStackIndex++}pop(t,e,s){this._renderer.renderPipes.batch.break(s);let i=this._colorStack;this._colorStackIndex--;let n=i[this._colorStackIndex-1];n!==this._currentColor&&(this._currentColor=n,s.add({renderPipeId:"colorMask",colorMask:n,canBundle:!1}))}execute(t){}destroy(){this._renderer=null,this._colorStack=null}};$o.extension={type:[m.CanvasPipes],name:"colorMask"}});function _E(r){let t=[];return r.replace(WP,(e,s,i)=>{let n=s.toLowerCase(),o=s,a=zP(i);for(n==="m"&&a.length>2&&(t.push([o,...a.splice(0,2)]),n="l",o=o==="m"?"l":"L");;){if(a.length===my[n])return t.push([o,...a]),"";if(a.length<my[n])throw new Error("malformed path data");t.push([o,...a.splice(0,my[n])])}}),t}function zP(r){let t=r.match(VP);return t?t.map(Number):[]}var my,WP,VP,bE=x(()=>{"use strict";my={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},WP=/([astvzqmhlc])([^astvzqmhlc]*)/gi,VP=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi});function gy(r,t){let e=_E(r),s=[],i=null,n=0,o=0;for(let a=0;a<e.length;a++){let u=e[a],l=u[0],c=u;switch(l){case"M":n=c[1],o=c[2],t.moveTo(n,o);break;case"m":n+=c[1],o+=c[2],t.moveTo(n,o);break;case"H":n=c[1],t.lineTo(n,o);break;case"h":n+=c[1],t.lineTo(n,o);break;case"V":o=c[1],t.lineTo(n,o);break;case"v":o+=c[1],t.lineTo(n,o);break;case"L":n=c[1],o=c[2],t.lineTo(n,o);break;case"l":n+=c[1],o+=c[2],t.lineTo(n,o);break;case"C":n=c[5],o=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case"c":t.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case"S":n=c[3],o=c[4],t.bezierCurveToShort(c[1],c[2],n,o);break;case"s":t.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"Q":n=c[3],o=c[4],t.quadraticCurveTo(c[1],c[2],n,o);break;case"q":t.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case"T":n=c[1],o=c[2],t.quadraticCurveToShort(n,o);break;case"t":n+=c[1],o+=c[2],t.quadraticCurveToShort(n,o);break;case"A":n=c[6],o=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"a":n+=c[6],o+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case"Z":case"z":t.closePath(),s.length>0&&(i=s.pop(),i?(n=i.startX,o=i.startY):(n=0,o=0)),i=null;break;default:k(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&i===null&&(i={startX:n,startY:o},s.push(i))}return t}var xy=x(()=>{"use strict";bE();pt()});var sf,nf,by,nn,ml=x(()=>{"use strict";C();Mu();dd();Ka();ye();xt();xr();zo();sf=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Ct.return(t)}),this.graphicsData&&Ct.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},nf=class{constructor(){this.instructions=new ss}init(t){let e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new so({maxTextures:e}),this.instructions.reset()}get geometry(){return I(Op,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},by=class _y{constructor(t){this._renderer=t,this._managedContexts=new vt({renderer:t,type:"resource",name:"graphicsContext"})}init(t){_y.defaultOptions.bezierSmoothness=t?.bezierSmoothness??_y.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){let e=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&s.reset(),uy(t,s);let i=t.batchMode;t.customShader||i==="no-batch"?s.isBatchable=!1:i==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){let e=Ct.get(nf,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:i,geometryData:n}=s;s.graphicsData=e;let o=n.vertices.length,a=n.indices.length;for(let h=0;h<i.length;h++)i[h].applyTransform=!1;let u=e.batcher;u.ensureAttributeBuffer(o),u.ensureIndexBuffer(a),u.begin();for(let h=0;h<i.length;h++){let d=i[h];u.add(d)}u.finish(e.instructions);let l=u.geometry;l.indexBuffer.setDataWithSize(u.indexBuffer,u.indexSize,!0),l.buffers[0].setDataWithSize(u.attributeBuffer.float32View,u.attributeSize,!0);let c=u.batches;for(let h=0;h<c.length;h++){let d=c[h];d.bindGroup=Oi(d.textures.textures,d.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){let e=new sf;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};by.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"graphicsContext"};by.defaultOptions={bezierSmoothness:.5};nn=by});function gl(r,t,e,s,i,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??nn.defaultOptions.bezierSmoothness)),d=($P-h)/1;return d*=d,YP(t,e,s,i,n,o,a,u,r,d),r}function YP(r,t,e,s,i,n,o,a,u,l){vy(r,t,e,s,i,n,o,a,u,l,0),u.push(o,a)}function vy(r,t,e,s,i,n,o,a,u,l,c){if(c>XP)return;let h=Math.PI,d=(r+e)/2,f=(t+s)/2,p=(e+i)/2,g=(s+n)/2,_=(i+o)/2,b=(n+a)/2,y=(d+p)/2,v=(f+g)/2,T=(p+_)/2,S=(g+b)/2,E=(y+T)/2,w=(v+S)/2;if(c>0){let M=o-r,P=a-t,R=Math.abs((e-o)*P-(s-a)*M),A=Math.abs((i-o)*P-(n-a)*M),G,H;if(R>of&&A>of){if((R+A)*(R+A)<=l*(M*M+P*P)){if(Yo<yy){u.push(E,w);return}let W=Math.atan2(n-s,i-e);if(G=Math.abs(W-Math.atan2(s-t,e-r)),H=Math.abs(Math.atan2(a-n,o-i)-W),G>=h&&(G=2*h-G),H>=h&&(H=2*h-H),G+H<Yo){u.push(E,w);return}if(on!==0){if(G>on){u.push(e,s);return}if(H>on){u.push(i,n);return}}}}else if(R>of){if(R*R<=l*(M*M+P*P)){if(Yo<yy){u.push(E,w);return}if(G=Math.abs(Math.atan2(n-s,i-e)-Math.atan2(s-t,e-r)),G>=h&&(G=2*h-G),G<Yo){u.push(e,s),u.push(i,n);return}if(on!==0&&G>on){u.push(e,s);return}}}else if(A>of){if(A*A<=l*(M*M+P*P)){if(Yo<yy){u.push(E,w);return}if(G=Math.abs(Math.atan2(a-n,o-i)-Math.atan2(n-s,i-e)),G>=h&&(G=2*h-G),G<Yo){u.push(e,s),u.push(i,n);return}if(on!==0&&G>on){u.push(i,n);return}}}else if(M=E-(r+o)/2,P=w-(t+a)/2,M*M+P*P<=l){u.push(E,w);return}}vy(r,t,d,f,y,v,E,w,u,l,c+1),vy(E,w,T,S,_,b,o,a,u,l,c+1)}var XP,of,$P,yy,Yo,on,af=x(()=>{"use strict";ml();XP=8,of=11920929e-14,$P=1,yy=.01,Yo=0,on=0});function Sy(r,t,e,s,i,n,o,a){let l=Math.min(.99,Math.max(0,a??nn.defaultOptions.bezierSmoothness)),c=(KP-l)/1;return c*=c,QP(t,e,s,i,n,o,r,c),r}function QP(r,t,e,s,i,n,o,a){Ty(o,r,t,e,s,i,n,a,0),o.push(i,n)}function Ty(r,t,e,s,i,n,o,a,u){if(u>jP)return;let l=Math.PI,c=(t+s)/2,h=(e+i)/2,d=(s+n)/2,f=(i+o)/2,p=(c+d)/2,g=(h+f)/2,_=n-t,b=o-e,y=Math.abs((s-n)*b-(i-o)*_);if(y>qP){if(y*y<=a*(_*_+b*b)){if(yE<ZP){r.push(p,g);return}let v=Math.abs(Math.atan2(o-i,n-s)-Math.atan2(i-e,s-t));if(v>=l&&(v=2*l-v),v<yE){r.push(p,g);return}}}else if(_=p-(t+n)/2,b=g-(e+o)/2,_*_+b*b<=a){r.push(p,g);return}Ty(r,t,e,c,h,p,g,a,u+1),Ty(r,p,g,d,f,n,o,a,u+1)}var jP,qP,KP,ZP,yE,Ey=x(()=>{"use strict";ml();jP=8,qP=11920929e-14,KP=1,ZP=.01,yE=0});function xl(r,t,e,s,i,n,o,a){let u=Math.abs(i-n);(!o&&i>n||o&&n>i)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=i;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),f=Math.sin(c),p=t+d*s,g=e+f*s;r.push(p,g),c+=l}}var uf=x(()=>{"use strict"});function Cy(r,t,e,s,i,n){let o=r[r.length-2],u=r[r.length-1]-e,l=o-t,c=i-e,h=s-t,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==t||r[r.length-1]!==e)&&r.push(t,e);return}let f=u*u+l*l,p=c*c+h*h,g=u*c+l*h,_=n*Math.sqrt(f)/d,b=n*Math.sqrt(p)/d,y=_*g/f,v=b*g/p,T=_*h+b*l,S=_*c+b*u,E=l*(b+y),w=u*(b+y),M=h*(_+v),P=c*(_+v),R=Math.atan2(w-S,E-T),A=Math.atan2(P-S,M-T);xl(r,T+t,S+e,n,R,A,l*c>h*u)}var Ay=x(()=>{"use strict";uf()});function JP(r,t){let e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,i=Math.cos(r),n=Math.sin(r),o=Math.cos(r+t),a=Math.sin(r+t);return[{x:i-n*s,y:n+i*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}function By(r,t,e,s,i,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*_l/360),h=Math.cos(a*_l/360),d=h*(t-s)/2+c*(e-i)/2,f=-c*(t-s)/2+h*(e-i)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let p=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(n*=Math.sqrt(p),o*=Math.sqrt(p)),tB(t,e,s,i,n,o,u,l,c,h,d,f,wy);let{ang1:g,ang2:_}=wy,{centerX:b,centerY:y}=wy,v=Math.abs(_)/(_l/4);Math.abs(1-v)<1e-7&&(v=1);let T=Math.max(Math.ceil(v),1);_/=T;let S=r[r.length-2],E=r[r.length-1],w={x:0,y:0};for(let M=0;M<T;M++){let P=JP(g,_),{x:R,y:A}=Py(P[0],n,o,h,c,b,y,w),{x:G,y:H}=Py(P[1],n,o,h,c,b,y,w),{x:W,y:$}=Py(P[2],n,o,h,c,b,y,w);gl(r,S,E,R,A,G,H,W,$),S=W,E=$,g+=_}}var _l,wy,Py,vE,tB,Ry=x(()=>{"use strict";af();_l=Math.PI*2,wy={centerX:0,centerY:0,ang1:0,ang2:0},Py=({x:r,y:t},e,s,i,n,o,a,u)=>{r*=e,t*=s;let l=i*r-n*t,c=n*r+i*t;return u.x=l+o,u.y=c+a,u};vE=(r,t,e,s)=>{let i=r*s-t*e<0?-1:1,n=r*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),i*Math.acos(n)},tB=(r,t,e,s,i,n,o,a,u,l,c,h,d)=>{let f=Math.pow(i,2),p=Math.pow(n,2),g=Math.pow(c,2),_=Math.pow(h,2),b=f*p-f*_-p*g;b<0&&(b=0),b/=f*_+p*g,b=Math.sqrt(b)*(o===a?-1:1);let y=b*i/n*h,v=b*-n/i*c,T=l*y-u*v+(r+e)/2,S=u*y+l*v+(t+s)/2,E=(c-y)/i,w=(h-v)/n,M=(-c-y)/i,P=(-h-v)/n,R=vE(1,0,E,w),A=vE(E,w,M,P);a===0&&A>0&&(A-=_l),a===1&&A<0&&(A+=_l),d.centerX=T,d.centerY=S,d.ang1=R,d.ang2=A}});function My(r,t,e){let s=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return{len:c,nx:h,ny:d}},i=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y)},n=t[t.length-1];for(let o=0;o<t.length;o++){let a=t[o%t.length],u=a.radius??e;if(u<=0){i(o,a),n=a;continue}let l=t[(o+1)%t.length],c=s(a,n),h=s(a,l);if(c.len<1e-4||h.len<1e-4){i(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),f=1,p=!1;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0);let g=d/2,_,b=Math.abs(Math.cos(g)*u/Math.sin(g));b>Math.min(c.len/2,h.len/2)?(b=Math.min(c.len/2,h.len/2),_=Math.abs(b*Math.sin(g)/Math.cos(g))):_=u;let y=a.x+h.nx*b+-h.ny*_*f,v=a.y+h.ny*b+h.nx*_*f,T=Math.atan2(c.ny,c.nx)+Math.PI/2*f,S=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(T)*_,v+Math.sin(T)*_),r.arc(y,v,_,T,S,p),n=a}}function Dy(r,t,e,s){let i=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=t.length;for(let a=0;a<o;a++){let u=t[(a+1)%o],l=u.radius??e;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=t[a],h=t[(a+2)%o],d=i(c,u),f;if(d<1e-4)f=u;else{let _=Math.min(d/2,l);f=n(u,c,_/d)}let p=i(h,u),g;if(p<1e-4)g=u;else{let _=Math.min(p/2,l);g=n(u,h,_/p)}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,g.x,g.y,s)}}var Fy=x(()=>{"use strict"});var eB,bl,Gy=x(()=>{"use strict";qm();Km();Zm();jt();Qm();he();af();Ey();uf();Ay();Ry();Fy();eB=new J,bl=class{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new _t,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();let s=this._currentPoly.points,i=s[s.length-2],n=s[s.length-1];return(i!==t||n!==e)&&s.push(t,e),this}arc(t,e,s,i,n,o){this._ensurePoly(!1);let a=this._currentPoly.points;return xl(a,t,e,s,i,n,o),this}arcTo(t,e,s,i,n){this._ensurePoly();let o=this._currentPoly.points;return Cy(o,t,e,s,i,n),this}arcToSvg(t,e,s,i,n,o,a){let u=this._currentPoly.points;return By(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,t,e,s,i,n),this}bezierCurveTo(t,e,s,i,n,o,a){this._ensurePoly();let u=this._currentPoly;return gl(this._currentPoly.points,u.lastX,u.lastY,t,e,s,i,n,o,a),this}quadraticCurveTo(t,e,s,i,n){this._ensurePoly();let o=this._currentPoly;return Sy(this._currentPoly.points,o.lastX,o.lastY,t,e,s,i,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));let s=this.shapePrimitives,i=s.length;for(let n=0;n<t.instructions.length;n++){let o=t.instructions[n];this[o.action](...o.data)}if(t.checkForHoles&&s.length-i>1){let n=null;for(let o=i;o<s.length;o++){let a=s[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),s.copyWithin(o,o+1),s.length--,o--):n=a}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,i,n){return this.drawShape(new J(t,e,s,i),n),this}circle(t,e,s,i){return this.drawShape(new du(t,e,s),i),this}poly(t,e,s){let i=new Bi(t);return i.closePath=e,this.drawShape(i,s),this}regularPoly(t,e,s,i,n=0,o){i=Math.max(i|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/i,l=[];for(let c=0;c<i;c++){let h=a-c*u;l.push(t+s*Math.cos(h),e+s*Math.sin(h))}return this.poly(l,!0,o),this}roundPoly(t,e,s,i,n,o=0,a){if(i=Math.max(i|0,3),n<=0)return this.regularPoly(t,e,s,i,o);let u=s*Math.sin(Math.PI/i)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/i,h=(i-2)*Math.PI/i/2;for(let d=0;d<i;d++){let f=d*c+l,p=t+s*Math.cos(f),g=e+s*Math.sin(f),_=f+Math.PI+h,b=f-Math.PI-h,y=p+n*Math.cos(_),v=g+n*Math.sin(_),T=p+n*Math.cos(b),S=g+n*Math.sin(b);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(p,g,T,S,a)}return this.closePath()}roundShape(t,e,s=!1,i){return t.length<3?this:(s?Dy(this,t,e,i):My(this,t,e),this.closePath())}filletRect(t,e,s,i,n){if(n===0)return this.rect(t,e,s,i);let o=Math.min(s,i)/2,a=Math.min(o,Math.max(-o,n)),u=t+s,l=e+i,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(t,e+h).arcTo(t+c,e+c,t+h,e,h).lineTo(u-h,e).arcTo(u-c,e+c,u,e+h,h).lineTo(u,l-h).arcTo(u-c,l-c,t+s-h,l,h).lineTo(t+h,l).arcTo(t+c,l-c,t,l-h,h).closePath()}chamferRect(t,e,s,i,n,o){if(n<=0)return this.rect(t,e,s,i);let a=Math.min(n,Math.min(s,i)/2),u=t+s,l=e+i,c=[t+a,e,u-a,e,u,e+a,u,l-a,u-a,l,t+a,l,t,l-a,t,e+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,!0,o)}ellipse(t,e,s,i,n){return this.drawShape(new fu(t,e,s,i),n),this}roundRect(t,e,s,i,n,o){return this.drawShape(new pu(t,e,s,i,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new Bi,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){let e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new Bi,t)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let n=e.transform,o=s;s=n.a*s+n.c*i+n.tx,i=n.b*o+n.d*i+n.ty}this._currentPoly.points.push(s,i)}else this._currentPoly.points.push(0,0)}}buildPath(){let t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){let s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){let t=this._bounds;t.clear();let e=this.shapePrimitives;for(let s=0;s<e.length;s++){let i=e[s],n=i.shape.getBounds(eB);i.transform?t.addRect(n,i.transform):t.addRect(n)}return t}}});function jo(r,t){return r?r.prepend(t):t.clone()}var He,qo=x(()=>{"use strict";Ue();Yt();pt();xy();Gy();He=class r{constructor(t,e=!1){this.instructions=[],this.uid=et("graphicsPath"),this._dirty=!0,this.checkForHoles=e,typeof t=="string"?gy(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new bl(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,i,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(nt.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else{u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l)}return this.instructions.push({action:"bezierCurveTo",data:[u,l,t,e,s,i,n]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){let i=this.instructions[this.instructions.length-1],n=this.getLastPoint(nt.shared),o=0,a=0;if(!i||i.action!=="quadraticCurveTo")o=n.x,a=n.y;else{o=i.data[0],a=i.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a)}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,t,e,s]}),this._dirty=!0,this}rect(t,e,s,i,n){return this.instructions.push({action:"rect",data:[t,e,s,i,n]}),this._dirty=!0,this}circle(t,e,s,i){return this.instructions.push({action:"circle",data:[t,e,s,i]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,i,n,o,a){n||(n=i/2);let u=-1*Math.PI/2+o,l=s*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let f=d%2?n:i,p=d*c+u;h.push(t+f*Math.cos(p),e+f*Math.sin(p))}return this.poly(h,!0,a),this}clone(t=!1){let e=new r;if(e.checkForHoles=this.checkForHoles,!t)e.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){let i=this.instructions[s];e.instructions.push({action:i.action,data:i.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;let e=t.a,s=t.b,i=t.c,n=t.d,o=t.tx,a=t.ty,u=0,l=0,c=0,h=0,d=0,f=0,p=0,g=0;for(let _=0;_<this.instructions.length;_++){let b=this.instructions[_],y=b.data;switch(b.action){case"moveTo":case"lineTo":u=y[0],l=y[1],y[0]=e*u+i*l+o,y[1]=s*u+n*l+a;break;case"bezierCurveTo":c=y[0],h=y[1],d=y[2],f=y[3],u=y[4],l=y[5],y[0]=e*c+i*h+o,y[1]=s*c+n*h+a,y[2]=e*d+i*f+o,y[3]=s*d+n*f+a,y[4]=e*u+i*l+o,y[5]=s*u+n*l+a;break;case"quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=e*c+i*h+o,y[1]=s*c+n*h+a,y[2]=e*u+i*l+o,y[3]=s*u+n*l+a;break;case"arcToSvg":u=y[5],l=y[6],p=y[0],g=y[1],y[0]=e*p+i*g,y[1]=s*p+n*g,y[5]=e*u+i*l+o,y[6]=s*u+n*l+a;break;case"circle":y[4]=jo(y[3],t);break;case"rect":y[4]=jo(y[4],t);break;case"ellipse":y[8]=jo(y[8],t);break;case"roundRect":y[5]=jo(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=jo(y[2],t);break;case"regularPoly":case"chamferRect":y[5]=jo(y[5],t);break;case"closePath":break;default:k("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}});function kt(r,t,e){let s=r.getAttribute(t);return s?Number(s):e}var lf=x(()=>{"use strict"});function Uy(r,t){let e=r.querySelectorAll("defs");for(let s=0;s<e.length;s++){let i=e[s];for(let n=0;n<i.children.length;n++){let o=i.children[n];switch(o.nodeName.toLowerCase()){case"lineargradient":t.defs[o.id]=rB(o);break;case"radialgradient":t.defs[o.id]=sB(o);break;default:break}}}}function rB(r){let t=kt(r,"x1",0),e=kt(r,"y1",0),s=kt(r,"x2",1),i=kt(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new Nt(t,e,s,i,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=kt(u,"offset",0),c=X.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c)}return o}function sB(r){return k("[SVG Parser] Radial gradients are not yet supported"),new Nt(0,0,1,0)}var Iy=x(()=>{"use strict";It();pt();zr();lf()});function cf(r){let t=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}var ky=x(()=>{"use strict"});function hf(r,t){let e=r.getAttribute("style"),s={},i={},n={strokeStyle:s,fillStyle:i,useFill:!1,useStroke:!1};for(let o in Oy){let a=r.getAttribute(o);a&&TE(t,n,o,a.trim())}if(e){let o=e.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");Oy[l]&&TE(t,n,l,c.trim())}}return{strokeStyle:n.useStroke?s:null,fillStyle:n.useFill?i:null,useFill:n.useFill,useStroke:n.useStroke}}function TE(r,t,e,s){switch(e){case"stroke":if(s!=="none"){if(s.startsWith("url(")){let i=cf(s);t.strokeStyle.fill=r.defs[i]}else t.strokeStyle.color=X.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){let i=cf(s);t.fillStyle.fill=r.defs[i]}else t.fillStyle.color=X.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}var Oy,Ly=x(()=>{"use strict";It();ky();Oy={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}}});function Ny(r){if(r.length<=2)return!0;let t=r.map(a=>a.area).sort((a,u)=>u-a),[e,s]=t,i=t[t.length-1],n=e/s,o=s/i;return!(n>3&&o<2)}function iB(r,t=0){let e=r.instructions[t];if(!e||e.action!=="fill")throw new Error(`Expected fill instruction at index ${t}, got ${e?.action||"undefined"}`);return e.data}var Hy=x(()=>{"use strict"});function Wy(r){return r.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function Vy(r){let t=r.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let e=t.map(Number),s=[],i=[];for(let c=0;c<e.length;c+=2)c+1<e.length&&(s.push(e[c]),i.push(e[c+1]));if(s.length===0||i.length===0)return 0;let n=Math.min(...s),o=Math.max(...s),a=Math.min(...i),u=Math.max(...i);return(o-n)*(u-a)}function df(r,t){let e=new He(r,!1);for(let s of e.instructions)t.instructions.push(s)}var zy=x(()=>{"use strict";qo()});function Xy(r,t){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg")}let e={context:t,defs:{},path:new He};Uy(r,e);let s=r.children,{fillStyle:i,strokeStyle:n}=hf(r,e);for(let o=0;o<s.length;o++){let a=s[o];a.nodeName.toLowerCase()!=="defs"&&SE(a,e,i,n)}return t}function SE(r,t,e,s){let i=r.children,{fillStyle:n,strokeStyle:o}=hf(r,t);n&&e?e={...e,...n}:n&&(e=n),o&&s?s={...s,...o}:o&&(s=o);let a=!e&&!s;a&&(e={color:0});let u,l,c,h,d,f,p,g,_,b,y,v,T,S,E,w,M;switch(r.nodeName.toLowerCase()){case"path":{S=r.getAttribute("d");let P=r.getAttribute("fill-rule"),R=Wy(S),A=P==="evenodd",G=R.length>1;if(A&&G){let W=R.map(B=>({path:B,area:Vy(B)}));if(W.sort((B,U)=>U.area-B.area),R.length>3||!Ny(W))for(let B=0;B<W.length;B++){let U=W[B],z=B===0;t.context.beginPath();let L=new He(void 0,!0);df(U.path,L),t.context.path(L),z?(e&&t.context.fill(e),s&&t.context.stroke(s)):t.context.cut()}else for(let B=0;B<W.length;B++){let U=W[B],z=B%2===1;t.context.beginPath();let L=new He(void 0,!0);df(U.path,L),t.context.path(L),z?t.context.cut():(e&&t.context.fill(e),s&&t.context.stroke(s))}}else{let W=P?P==="evenodd":!0;E=new He(S,W),t.context.path(E),e&&t.context.fill(e),s&&t.context.stroke(s)}break}case"circle":p=kt(r,"cx",0),g=kt(r,"cy",0),_=kt(r,"r",0),t.context.ellipse(p,g,_,_),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"rect":u=kt(r,"x",0),l=kt(r,"y",0),w=kt(r,"width",0),M=kt(r,"height",0),b=kt(r,"rx",0),y=kt(r,"ry",0),b||y?t.context.roundRect(u,l,w,M,b||y):t.context.rect(u,l,w,M),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"ellipse":p=kt(r,"cx",0),g=kt(r,"cy",0),b=kt(r,"rx",0),y=kt(r,"ry",0),t.context.beginPath(),t.context.ellipse(p,g,b,y),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"line":c=kt(r,"x1",0),h=kt(r,"y1",0),d=kt(r,"x2",0),f=kt(r,"y2",0),t.context.beginPath(),t.context.moveTo(c,h),t.context.lineTo(d,f),s&&t.context.stroke(s);break;case"polygon":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(P=>parseInt(P,10)),t.context.poly(v,!0),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"polyline":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(P=>parseInt(P,10)),t.context.poly(v,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{k(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(e=null);for(let P=0;P<i.length;P++)SE(i[P],t,e,s)}var $y=x(()=>{"use strict";pt();qo();Iy();lf();Ly();Hy();zy()});function nB(r){return X.isColorLike(r)}function EE(r){return r instanceof hr}function CE(r){return r instanceof Nt}function oB(r){return r instanceof D}function aB(r,t,e){let s=X.shared.setValue(t??0);return r.color=s.toNumber(),r.alpha=s.alpha===1?e.alpha:s.alpha,r.texture=D.WHITE,{...e,...r}}function uB(r,t,e){return r.texture=t,{...e,...r}}function AE(r,t,e){return r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,r.textureSpace=t.textureSpace,{...e,...r}}function wE(r,t,e){return t.buildGradient(),r.fill=t,r.color=16777215,r.texture=t.texture,r.matrix=t.transform,r.textureSpace=t.textureSpace,{...e,...r}}function lB(r,t){let e={...t,...r},s=X.shared.setValue(e.color);return e.alpha*=s.alpha,e.color=s.toNumber(),e}function Xr(r,t){if(r==null)return null;let e={},s=r;return nB(r)?aB(e,r,t):oB(r)?uB(e,r,t):EE(r)?AE(e,r,t):CE(r)?wE(e,r,t):s.fill&&EE(s.fill)?AE(s,s.fill,t):s.fill&&CE(s.fill)?wE(s,s.fill,t):lB(s,t)}function an(r,t){let{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:a,...u}=t,l=Xr(r,u);return l?{width:e,alignment:s,miterLimit:i,cap:n,join:o,pixelLine:a,...l}:null}var ff=x(()=>{"use strict";It();ht();zr();Wo()});function Yy(r,t){let e=1,s=r.shapePath.shapePrimitives;for(let i=0;i<s.length;i++){let n=s[i].shape;if(n.type!=="polygon")continue;let o=n.points,a=o.length;if(a<6)continue;let u=n.closePath;for(let l=0;l<a;l+=2){if(!u&&(l===0||l===a-2))continue;let c=(l-2+a)%a,h=(l+2)%a,d=o[c],f=o[c+1],p=o[l],g=o[l+1],_=o[h],b=o[h+1],y=d-p,v=f-g,T=_-p,S=b-g,E=y*y+v*v,w=T*T+S*S;if(E<1e-12||w<1e-12)continue;let R=(y*T+v*S)/Math.sqrt(E*w);R<-1?R=-1:R>1&&(R=1);let A=Math.sqrt((1-R)*.5);if(A<1e-6)continue;let G=Math.min(1/A,t);G>e&&(e=G)}}return e}var jy=x(()=>{"use strict"});var cB,PE,qy,Kt,ci=x(()=>{"use strict";le();It();ot();Ue();ht();Yt();xt();he();qo();$y();ff();jy();cB=new nt,PE=new F,qy=class $r extends St{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=et("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new He,this._transform=new F,this._fillStyle={...$r.defaultFillStyle},this._strokeStyle={...$r.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new _t,this._boundsDirty=!0}clone(){let t=new $r;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=Xr(t,$r.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=an(t,$r.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Xr(t,$r.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Xr(t,$r.defaultStrokeStyle),this}texture(t,e,s,i,n,o){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:i||0,dw:n||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||e===0?X.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new He,this}fill(t,e){let s,i=this.instructions[this.instructions.length-1];return this._tick===0&&i?.action==="stroke"?s=i.data.path:s=this._activePath.clone(),s?(t!=null&&(e!==void 0&&typeof t=="number"&&(I(V,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=Xr(t,$r.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:t,y:e}=this._activePath.getLastPoint(nt.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e,s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="fill"?e=s.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=an(t,$r.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){let e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(s);else{e.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,e,s,i,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,s,i,n,o),this}arcTo(t,e,s,i,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}arcToSvg(t,e,s,i,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(t,e,s,i,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(t,e,s,i,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*t+u.c*e+u.tx,u.b*t+u.d*e+u.ty,u.a*s+u.c*i+u.tx,u.b*s+u.d*i+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,i){return this._tick++,this._activePath.ellipse(t,e,s,i,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;let s=this._transform;return this._activePath.lineTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty),this}moveTo(t,e){this._tick++;let s=this._transform,i=this._activePath.instructions,n=s.a*t+s.c*e+s.tx,o=s.b*t+s.d*e+s.ty;return i.length===1&&i[0].action==="moveTo"?(i[0].data[0]=n,i[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(t,e,s,i,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*i+o.tx,o.b*s+o.d*i+o.ty,n),this}rect(t,e,s,i){return this._tick++,this._activePath.rect(t,e,s,i,this._transform.clone()),this}roundRect(t,e,s,i,n){return this._tick++,this._activePath.roundRect(t,e,s,i,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,s,i,n=0,o){return this._tick++,this._activePath.regularPoly(t,e,s,i,n,o),this}roundPoly(t,e,s,i,n,o){return this._tick++,this._activePath.roundPoly(t,e,s,i,n,o),this}roundShape(t,e,s,i){return this._tick++,this._activePath.roundShape(t,e,s,i),this}filletRect(t,e,s,i,n){return this._tick++,this._activePath.filletRect(t,e,s,i,n),this}chamferRect(t,e,s,i,n,o){return this._tick++,this._activePath.chamferRect(t,e,s,i,n,o),this}star(t,e,s,i,n=0,o=0){return this._tick++,this._activePath.star(t,e,s,i,n,o,this._transform.clone()),this}svg(t){return this._tick++,Xy(t,this),this}restore(){let t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,s,i,n,o){return t instanceof F?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,s,i,n,o),this)}transform(t,e,s,i,n,o){return t instanceof F?(this._transform.append(t),this):(PE.set(t,e,s,i,n,o),this._transform.append(PE),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){let s=this.instructions[e],i=s.action;if(i==="fill"){let n=s.data;t.addBounds(n.path.bounds)}else if(i==="texture"){let n=s.data;t.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform)}if(i==="stroke"){let n=s.data,o=n.style.alignment,a=n.style.width*(1-o);n.style.join==="miter"&&(a*=Yy(n.path,n.style.miterLimit));let u=n.path.bounds;t.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;let e=this.instructions,s=!1;for(let i=0;i<e.length;i++){let n=e[i],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,f=d?d.applyInverse(t,cB):t;if(n.action==="fill")s=h.contains(f.x,f.y);else{let g=u;s=h.strokeContains(f.x,f.y,g.width,g.alignment)}let p=o.hole;if(p){let g=p.shapePath?.shapePrimitives;if(g)for(let _=0;_<g.length;_++)g[_].shape.contains(f.x,f.y)&&(s=!1)}if(s)return!0}}return s}unload(){this.emit("unload",this);for(let t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};qy.defaultFillStyle={color:16777215,alpha:1,texture:D.WHITE,matrix:null,fill:null,textureSpace:"local"};qy.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:D.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};Kt=qy});var Ky,Zy,Jy,t2,e2=x(()=>{"use strict";C();Ka();ye();Ky=class{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}},Zy=class{constructor(){this.instructions=new ss}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}},Jy=class Qy{constructor(t){this._renderer=t,this._managedContexts=new vt({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Qy.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Qy.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){let e=t._gpuData,s=!!e[this._renderer.uid],i=e[this._renderer.uid]||this._initContext(t);return(t.dirty||!s)&&(s&&i.reset(),i.isBatchable=!1,t.dirty=!1),i}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){let e=new Zy,s=this.getGpuContext(t);return s.graphicsData=e,e.init(),e}_initContext(t){let e=new Ky;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};Jy.extension={type:[m.CanvasSystem],name:"graphicsContext"};Jy.defaultOptions={bezierSmoothness:.5};t2=Jy});var Ko,r2=x(()=>{"use strict";C();je();ye();Ko=class{constructor(t,e){this.state=Ut.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new vt({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}};Ko.extension={type:[m.CanvasPipes],name:"graphics"}});var pf,Zo,s2=x(()=>{"use strict";C();je();ye();xr();Yi();Qd();pf=class{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Ct.return(t)}),this.batches.length=0}},Zo=class{constructor(t,e){this.state=Ut.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new vt({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){let e=t.context,s=!!t._gpuData,n=this.renderer.graphicsContext.updateGpuContext(e);return!!(n.isBatchable||s!==n.isBatchable)}addRenderable(t,e){let i=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),i.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){let s=this._getGpuDataForRenderable(t).batches;for(let i=0;i<s.length;i++){let n=s[i];n._batcher.updateElement(n)}}execute(t){if(!t.isRenderable)return;let e=this.renderer,s=t.context;if(!e.graphicsContext.getGpuContext(s).batches.length)return;let n=s.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=t.groupTransform,o.uRound=e._roundPixels|t._roundPixels,Mr(t.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){let e=this._getGpuDataForRenderable(t),i=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),i.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){let s=this.renderer.renderPipes.batch,i=this._getGpuDataForRenderable(t).batches;for(let n=0;n<i.length;n++){let o=i[n];s.addToBatch(o,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){let e=new pf;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){let s=t.context,n=this.renderer.graphicsContext.getGpuContext(s),o=this.renderer._roundPixels|t._roundPixels;e.batches=n.batches.map(a=>{let u=Ct.get(li);return a.copyTo(u),u.renderable=t,u.roundPixels=o,u})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}};Zo.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"graphics"}});var BE=x(()=>{"use strict";C();e2();r2();ml();s2();O.add(Ko);O.add(Zo);O.add(t2);O.add(nn)});var xs,yl=x(()=>{"use strict";xt();br();ci();BE();xs=class r extends Jt{constructor(t){t instanceof Kt&&(t={context:t});let{context:e,roundPixels:s,...i}=t||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new Kt,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||t?.context===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(t,e,s){I(V,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let i={};return t&&(i.width=t),e&&(i.color=e),s&&(i.alpha=s),this.context.strokeStyle=i,this}beginFill(t,e){I(V,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let s={};return t!==void 0&&(s.color=t),e!==void 0&&(s.alpha=e),this.context.fillStyle=s,this}endFill(){I(V,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let t=this.context.strokeStyle;return(t.width!==Kt.defaultStrokeStyle.width||t.color!==Kt.defaultStrokeStyle.color||t.alpha!==Kt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return I(V,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return I(V,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return I(V,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return I(V,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return I(V,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return I(V,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}});function hB(r,t,e,s,i,n){n=Math.max(0,Math.min(n,Math.min(s,i)/2)),r.moveTo(t+n,e),r.lineTo(t+s-n,e),r.quadraticCurveTo(t+s,e,t+s,e+n),r.lineTo(t+s,e+i-n),r.quadraticCurveTo(t+s,e+i,t+s-n,e+i),r.lineTo(t+n,e+i),r.quadraticCurveTo(t,e+i,t,e+i-n),r.lineTo(t,e+n),r.quadraticCurveTo(t,e,t+n,e)}function RE(r,t){switch(t.type){case"rectangle":{let e=t;r.rect(e.x,e.y,e.width,e.height);break}case"roundedRectangle":{let e=t;hB(r,e.x,e.y,e.width,e.height,e.radius);break}case"circle":{let e=t;r.moveTo(e.x+e.radius,e.y),r.arc(e.x,e.y,e.radius,0,Math.PI*2);break}case"ellipse":{let e=t;r.ellipse?(r.moveTo(e.x+e.halfWidth,e.y),r.ellipse(e.x,e.y,e.halfWidth,e.halfHeight,0,0,Math.PI*2)):(r.save(),r.translate(e.x,e.y),r.scale(e.halfWidth,e.halfHeight),r.moveTo(1,0),r.arc(0,0,1,0,Math.PI*2),r.restore());break}case"triangle":{let e=t;r.moveTo(e.x,e.y),r.lineTo(e.x2,e.y2),r.lineTo(e.x3,e.y3),r.closePath();break}default:{let e=t,s=e.points;if(!s?.length)break;r.moveTo(s[0],s[1]);for(let i=2;i<s.length;i+=2)r.lineTo(s[i],s[i+1]);e.closePath&&r.closePath();break}}}function dB(r,t,e){let s=[],i=[],n=[];if(!Fr[t.type]?.build(t,s))return!1;let a=t.closePath??!0;en(s,e,!1,a,i,n);for(let u=0;u<n.length;u+=3){let l=n[u]*2,c=n[u+1]*2,h=n[u+2]*2;r.moveTo(i[l],i[l+1]),r.lineTo(i[c],i[c+1]),r.lineTo(i[h],i[h+1]),r.closePath()}return!0}function fB(r,t){if(!t?.length)return!1;for(let e=0;e<t.length;e++){let s=t[e];if(!s?.shape)continue;let i=s.transform,n=i&&!i.isIdentity();n&&(r.save(),r.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),RE(r,s.shape),n&&r.restore()}return!0}var Qo,i2=x(()=>{"use strict";C();cl();yl();zo();pt();Qo=class{constructor(t){this._warnedMaskTypes=new Set,this._canvasMaskStack=[],this._renderer=t}push(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){if(t.action!=="pushMaskBegin"&&t.action!=="popMaskEnd")return;let e=this._renderer,s=e.canvasContext,i=s?.activeContext;if(!i)return;if(t.action==="popMaskEnd"){this._canvasMaskStack.pop()&&i.restore();return}t.inverse&&this._warnOnce("inverse","CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.");let n=t.mask.mask;if(!(n instanceof xs)){this._warnOnce("nonGraphics","CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask."),this._canvasMaskStack.push(!1);return}let o=n,a=o.context?.instructions;if(!a?.length){this._canvasMaskStack.push(!1);return}i.save(),s.setContextTransform(o.groupTransform,(e._roundPixels|o._roundPixels)===1),i.beginPath();let u=!1,l=!1;for(let c=0;c<a.length;c++){let h=a[c],d=h.action;if(d!=="fill"&&d!=="stroke")continue;let f=h.data,p=f?.path?.shapePath;if(!p?.shapePrimitives?.length)continue;let g=d==="stroke",_=p.shapePrimitives;for(let b=0;b<_.length;b++){let y=_[b];if(!y?.shape)continue;let v=y.transform,T=v&&!v.isIdentity();T&&(i.save(),i.transform(v.a,v.b,v.c,v.d,v.tx,v.ty)),g&&f.style?u=dB(i,y.shape,f.style)||u:(RE(i,y.shape),l=fB(i,y.holes)||l,u=!0),T&&i.restore()}}if(!u){i.restore(),this._canvasMaskStack.push(!1);return}l?i.clip("evenodd"):i.clip(),this._canvasMaskStack.push(!0)}destroy(){this._renderer=null,this._warnedMaskTypes=null,this._canvasMaskStack=null}_warnOnce(t,e){this._warnedMaskTypes.has(t)||(this._warnedMaskTypes.add(t),k(e))}};Qo.extension={type:[m.CanvasPipes],name:"stencilMask"}});function n2(){let r=hu(),t=Object.create(null);return t.inherit=Ft,t.none=Ft,t.normal="source-over",t.add="lighter",t.multiply=r?"multiply":Ft,t.screen=r?"screen":Ft,t.overlay=r?"overlay":Ft,t.darken=r?"darken":Ft,t.lighten=r?"lighten":Ft,t["color-dodge"]=r?"color-dodge":Ft,t["color-burn"]=r?"color-burn":Ft,t["hard-light"]=r?"hard-light":Ft,t["soft-light"]=r?"soft-light":Ft,t.difference=r?"difference":Ft,t.exclusion=r?"exclusion":Ft,t.saturation=r?"saturation":Ft,t.color=r?"color":Ft,t.luminosity=r?"luminosity":Ft,t["linear-burn"]=r?"color-burn":Ft,t["linear-dodge"]=r?"color-dodge":Ft,t["linear-light"]=r?"hard-light":Ft,t["pin-light"]=r?"hard-light":Ft,t["vivid-light"]=r?"hard-light":Ft,t["hard-mix"]=Ft,t.negation=r?"difference":Ft,t["normal-npm"]=t.normal,t["add-npm"]=t.add,t["screen-npm"]=t.screen,t.erase="destination-out",t.subtract=Ft,t.divide=Ft,t.min=Ft,t.max=Ft,t}var Ft,o2=x(()=>{"use strict";ih();Ft="source-over"});var pB,Jo,a2=x(()=>{"use strict";It();C();ot();o2();pB=new F,Jo=class{constructor(t){this.activeResolution=1,this.smoothProperty="imageSmoothingEnabled",this.blendModes=n2(),this._activeBlendMode="normal",this._projTransform=null,this._outerBlend=!1,this._warnedBlendModes=new Set,this._renderer=t}resolutionChange(t){this.activeResolution=t}init(){let t=this._renderer.background.alpha<1;if(this.rootContext=this._renderer.canvas.getContext("2d",{alpha:t}),this.activeContext=this.rootContext,this.activeResolution=this._renderer.resolution,!this.rootContext.imageSmoothingEnabled){let e=this.rootContext;e.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":e.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":e.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":e.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")}}setContextTransform(t,e,s,i){let n=i?F.IDENTITY:this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix||F.IDENTITY,o=pB;o.copyFrom(n),o.append(t);let a=this._projTransform,u=this.activeResolution;if(s=s||u,a){let l=F.shared;l.copyFrom(o),l.prepend(a),o=l}e?this.activeContext.setTransform(o.a*s,o.b*s,o.c*s,o.d*s,o.tx*u|0,o.ty*u|0):this.activeContext.setTransform(o.a*s,o.b*s,o.c*s,o.d*s,o.tx*u,o.ty*u)}clear(t,e){let s=this.activeContext,i=this._renderer;if(s.clearRect(0,0,i.width,i.height),t){let n=X.shared.setValue(t);s.globalAlpha=e??n.alpha,s.fillStyle=n.toHex(),s.fillRect(0,0,i.width,i.height),s.globalAlpha=1}}setBlendMode(t){if(this._activeBlendMode===t)return;this._activeBlendMode=t,this._outerBlend=!1;let e=this.blendModes[t];if(!e){this._warnedBlendModes.has(t)||(console.warn(`CanvasRenderer: blend mode "${t}" is not supported in Canvas2D; falling back to "source-over".`),this._warnedBlendModes.add(t)),this.activeContext.globalCompositeOperation="source-over";return}this.activeContext.globalCompositeOperation=e}destroy(){this.rootContext=null,this.activeContext=null,this._warnedBlendModes.clear()}};Jo.extension={type:[m.CanvasSystem],name:"canvasContext"}});var ta,u2=x(()=>{"use strict";C();ta=class{constructor(){this.maxTextures=16,this.maxBatchableTextures=16,this.maxUniformBindings=0}init(){}};ta.extension={type:[m.CanvasSystem],name:"limits"}});var vl,l2=x(()=>{"use strict";It();mt();qs();vl=class{init(t,e){this._renderer=t,this._renderTargetSystem=e}initGpuRenderTarget(t){let e=t.colorTexture,{canvas:s,context:i}=this._ensureCanvas(e);return{canvas:s,context:i,width:s.width,height:s.height}}resizeGpuRenderTarget(t){let e=t.colorTexture,{canvas:s}=this._ensureCanvas(e);s.width=t.pixelWidth,s.height=t.pixelHeight}startRenderPass(t,e,s,i){let n=this._renderTargetSystem.getGpuRenderTarget(t);this._renderer.canvasContext.activeContext=n.context,this._renderer.canvasContext.activeResolution=t.resolution,e&&this.clear(t,e,s,i)}clear(t,e,s,i){let o=this._renderTargetSystem.getGpuRenderTarget(t).context,a=i||{x:0,y:0,width:t.pixelWidth,height:t.pixelHeight};if(o.setTransform(1,0,0,1,0,0),o.clearRect(a.x,a.y,a.width,a.height),s){let u=X.shared.setValue(s);u.alpha>0&&(o.globalAlpha=u.alpha,o.fillStyle=u.toHex(),o.fillRect(a.x,a.y,a.width,a.height),o.globalAlpha=1)}}finishRenderPass(){}copyToTexture(t,e,s,i,n){let a=this._renderTargetSystem.getGpuRenderTarget(t).canvas,u=e.source,{context:l}=this._ensureCanvas(u),c=n?.x??0,h=n?.y??0;return l.drawImage(a,s.x,s.y,i.width,i.height,c,h,i.width,i.height),u.update(),e}destroyGpuRenderTarget(t){}_ensureCanvas(t){let e=t.resource;(!e||!ne.test(e))&&(e=N.get().createCanvas(t.pixelWidth,t.pixelHeight),t.resource=e),(e.width!==t.pixelWidth||e.height!==t.pixelHeight)&&(e.width=t.pixelWidth,e.height=t.pixelHeight);let s=e.getContext("2d");return{canvas:e,context:s}}}});var ea,c2=x(()=>{"use strict";C();qu();l2();ea=class extends gs{constructor(t){super(t),this.adaptor=new vl,this.adaptor.init(t,this)}};ea.extension={type:[m.CanvasSystem],name:"renderTarget"}});var ra,h2=x(()=>{"use strict";mt();C();Lr();ra=class{constructor(t){}init(){}initSource(t){}generateCanvas(t){let e=N.get().createCanvas(),s=e.getContext("2d"),i=Z.getCanvasSource(t);if(!i)return e;let n=t.frame,o=t.source._resolution??t.source.resolution??1,a=n.x*o,u=n.y*o,l=n.width*o,c=n.height*o;return e.width=Math.ceil(l),e.height=Math.ceil(c),s.drawImage(i,a,u,l,c,0,0,l,c),e}getPixels(t){let e=this.generateCanvas(t);return{pixels:e.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e.width,e.height).data,width:e.width,height:e.height}}destroy(){}};ra.extension={type:[m.CanvasSystem],name:"texture"}});var GE={};Ec(GE,{CanvasRenderer:()=>mf});var mB,gB,xB,ME,DE,FE,mf,d2=x(()=>{"use strict";C();Jh();ed();cy();id();fy();fd();md();py();i2();gd();ki();zu();Pe();a2();u2();c2();h2();mB=[...Ki,Jo,ta,ra,ea],gB=[ai,io,ii,si,oi,Qo,$o,ri],xB=[dy,Xo],ME=[],DE=[],FE=[];O.handleByNamedList(m.CanvasSystem,ME);O.handleByNamedList(m.CanvasPipes,DE);O.handleByNamedList(m.CanvasPipesAdaptor,FE);O.add(...mB,...gB,...xB);mf=class extends Er{constructor(){let t={name:"canvas",type:Tt.CANVAS,systems:ME,renderPipes:DE,renderPipeAdaptors:FE};super(t)}}});var un,_f=x(()=>{"use strict";le();xt();un=class extends St{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return I(V,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return I(V,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return I(V,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return I(V,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return I(V,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(let e in this.chars)this.chars[e].texture?.destroy();this.chars=null,t&&(this.pages.forEach(e=>e.texture.destroy(!0)),this.pages=null)}}});function bf(r=1e3,t=0,e=!1){if(isNaN(r)||r<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof e!="boolean")throw new TypeError("Invalid resetTtl value");return new m2(r,t,e)}var m2,g2=x(()=>{"use strict";m2=class{constructor(t=0,e=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){let e=this.items[t];delete this.items[t],this.size--,e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){let e=new Array(t.length);for(let s=0;s<t.length;s++){let i=t[s];e[s]=[i,this.get(i)]}return e}evict(t=!1){if(t||this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){let e=this.items[t];if(e!==void 0){if(this.ttl>0&&e.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(e),e.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){let t=new Array(this.size),e=this.first,s=0;for(;e!==null;)t[s++]=e.key,e=e.next;return t}setWithEvicted(t,e,s=this.resetTtl){let i=null;if(this.has(t))this.set(t,e,!0,s);else{this.max>0&&this.size===this.max&&(i={...this.first},this.evict(!0));let n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};++this.size===1?this.first=n:this.last.next=n,this.last=n}return i}set(t,e,s=!1,i=this.resetTtl){let n=this.items[t];return s||n!==void 0?(n.value=e,s===!1&&i&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(t=this.keys()){let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=this.get(t[s]);return e}}});function Sl(r){return!!r.tagStyles&&Object.keys(r.tagStyles).length>0}function El(r){return r.includes("<")}function _B(r,t){return r.clone().assign(t)}function yf(r,t){let e=[],s=t.tagStyles;if(!Sl(t)||!El(r))return e.push({text:r,style:t}),e;let i=[t],n=[],o="",a=0;for(;a<r.length;){let u=r[a];if(u==="<"){let l=r.indexOf(">",a);if(l===-1){o+=u,a++;continue}let c=r.indexOf("<",a+1);if(c!==-1&&c<l){o+=u,a++;continue}let h=r.slice(a+1,l);if(h.startsWith("/")){let d=h.slice(1).trim();if(n.length>0&&n[n.length-1]===d){o.length>0&&(e.push({text:o,style:i[i.length-1]}),o=""),i.pop(),n.pop(),a=l+1;continue}else{o+=r.slice(a,l+1),a=l+1;continue}}else{let d=h.trim();if(s[d]){o.length>0&&(e.push({text:o,style:i[i.length-1]}),o="");let f=i[i.length-1],p=_B(f,s[d]);i.push(p),n.push(d),a=l+1;continue}else{o+=r.slice(a,l+1),a=l+1;continue}}}else o+=u,a++}return o.length>0&&e.push({text:o,style:i[i.length-1]}),e}function bB(r,t){return!Sl(t)||!El(r)?r:yf(r,t).map(s=>s.text).join("")}var vf=x(()=>{"use strict"});function ln(r){return typeof r!="string"?!1:LE.has(r.charCodeAt(0))}function de(r,t){return typeof r!="string"?!1:HE.has(r.charCodeAt(0))}function Tf(r){return typeof r!="string"?!1:VE.has(r.charCodeAt(0))}function Sf(r){return typeof r!="string"?!1:XE.has(r.charCodeAt(0))}function cn(r){return r==="normal"||r==="pre-line"}function hn(r){return r==="normal"}function dr(r){if(typeof r!="string")return"";let t=r.length-1;for(;t>=0&&de(r[t]);)t--;return t<r.length-1?r.slice(0,t+1):r}function Cl(r){let t=[],e=[];if(typeof r!="string")return t;for(let s=0;s<r.length;s++){let i=r[s],n=r[s+1];if(de(i,n)||ln(i)){e.length>0&&(t.push(e.join("")),e.length=0),i==="\r"&&n===`
|
|
903
903
|
`?(t.push(`\r
|
|
904
|
-
`),s++):t.push(i);continue}e.push(i),Sf(i)&&n&&!de(n)&&!
|
|
904
|
+
`),s++):t.push(i);continue}e.push(i),Sf(i)&&n&&!de(n)&&!ln(n)&&(t.push(e.join("")),e.length=0)}return e.length>0&&t.push(e.join("")),t}function Al(r,t,e,s){let i=e(r),n=[];for(let o=0;o<i.length;o++){let a=i[o],u=a,l=1;for(;i[o+l];){let c=i[o+l];if(!s(u,c,r,o,t))a+=c,u=c,l++;else break}o+=l-1,n.push(a)}return n}var OE,LE,NE,HE,WE,VE,zE,XE,x2,_2,na=x(()=>{"use strict";OE=[10,13],LE=new Set(OE),NE=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],HE=new Set(NE),WE=[9,32],VE=new Set(WE),zE=[45,8208,8211,8212,173],XE=new Set(zE),x2=/(\r\n|\r|\n)/,_2=/(?:\r\n|\r|\n)/});function b2(r,t,e,s,i,n,o,a,u){let l=yf(r,t);if(hn(t.whiteSpace))for(let W=0;W<l.length;W++){let $=l[W];l[W]={text:$.text.replace(yB," "),style:$.style}}let h=[],d=[];for(let W of l){let $=W.text.split(x2);for(let B=0;B<$.length;B++){let U=$[B];U===`\r
|
|
905
905
|
`||U==="\r"||U===`
|
|
906
|
-
`?(h.push(d),d=[]):U.length>0&&d.push({text:U,style:W.style})}}(d.length>0||h.length===0)&&h.push(d);let f=e
|
|
907
|
-
`)}var yB,v2=x(()=>{"use strict";sa();yB={willReadFrequently:!0}});var YE,_s,At,bs=x(()=>{"use strict";m2();mt();b2();vf();sa();v2();YE={willReadFrequently:!0},_s=class rt{static get experimentalLetterSpacingSupported(){let t=rt._experimentalLetterSpacingSupported;if(t===void 0){let e=N.get().getCanvasRenderingContext2D().prototype;t=rt._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,i,n,o,a,u,l,c){this.text=t,this.style=e,this.width=s,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l,c&&(this.runsByLine=c.runsByLine,this.lineAscents=c.lineAscents,this.lineDescents=c.lineDescents,this.lineHeights=c.lineHeights,this.hasDropShadow=c.hasDropShadow)}static measureText(t=" ",e,s=rt._canvas,i=e.wordWrap){let n=`${t}-${e.styleKey}-wordWrap-${i}`;if(rt._measurementCache.has(n))return rt._measurementCache.get(n);if(Tl(e)&&Sl(t)){let T=_2(t,e,i,rt._context,rt._measureText,rt._measureTextAdvance,rt.measureFont,rt.canBreakChars,rt.wordWrapSplit),S=new rt(t,e,T.width,T.height,T.lines,T.lineWidths,T.lineHeight,T.maxLineWidth,T.fontProperties,{runsByLine:T.runsByLine,lineAscents:T.lineAscents,lineDescents:T.lineDescents,lineHeights:T.lineHeights,hasDropShadow:T.hasDropShadow});return rt._measurementCache.set(n,S),S}let a=e._fontString,u=rt.measureFont(a);u.fontSize===0&&(u.fontSize=e.fontSize,u.ascent=e.fontSize,u.descent=0);let l=rt._context;l.font=a;let h=(i?rt._wordWrap(t,e,s):t).split(x2),d=new Array(h.length),f=0;for(let T=0;T<h.length;T++){let S=rt._measureText(h[T],e.letterSpacing,l);d[T]=S,f=Math.max(f,S)}let p=e._stroke?.width??0,g=e.lineHeight||u.fontSize,_=rt._adjustWidthForStyle(f,e),b=Math.max(g,u.fontSize+p)+(h.length-1)*(g+e.leading),y=rt._adjustHeightForStyle(b,e),v=new rt(t,e,_,y,h,d,g+e.leading,f,u);return rt._measurementCache.set(n,v),v}static _adjustWidthForStyle(t,e){let s=e._stroke?.width||0,i=t+s;return e.dropShadow&&(i+=e.dropShadow.distance),i}static _adjustHeightForStyle(t,e){let s=t;return e.dropShadow&&(s+=e.dropShadow.distance),s}static _measureText(t,e,s){let{metricWidth:i,metrics:n,letterSpacingVal:o}=rt._measureTextCore(t,e,s),a=-(n.actualBoundingBoxLeft??0),l=(n.actualBoundingBoxRight??0)-a;return n.width>0&&(l+=o),Math.max(i,l)}static _measureTextAdvance(t,e,s){return rt._measureTextCore(t,e,s).metricWidth}static _measureTextCore(t,e,s){let i=!1;rt.experimentalLetterSpacingSupported&&(rt.experimentalLetterSpacing?(s.letterSpacing=`${e}px`,s.textLetterSpacing=`${e}px`,i=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));let n=s.measureText(t),o=n.width,a=0;return o>0&&(i?a=-e:a=(rt.graphemeSegmenter(t).length-1)*e,o+=a),{metricWidth:o,metrics:n,letterSpacingVal:a}}static _wordWrap(t,e,s=rt._canvas){return y2(t,e,s,rt._measureTextAdvance,rt.canBreakWords,rt.canBreakChars,rt.wordWrapSplit)}static isBreakingSpace(t,e){return de(t,e)}static canBreakWords(t,e){return e}static canBreakChars(t,e,s,i,n){return!0}static wordWrapSplit(t){return rt.graphemeSegmenter(t)}static measureFont(t){if(rt._fonts[t])return rt._fonts[t];let e=rt._context;e.font=t;let s=e.measureText(rt.METRICS_STRING+rt.BASELINE_SYMBOL),i=s.actualBoundingBoxAscent??0,n=s.actualBoundingBoxDescent??0,o={ascent:i,descent:n,fontSize:i+n};return rt._fonts[t]=o,o}static clearMetrics(t=""){t?delete rt._fonts[t]:rt._fonts={}}static get _canvas(){if(!rt.__canvas){let t;try{let e=new OffscreenCanvas(0,0);if(e.getContext("2d",YE)?.measureText)return rt.__canvas=e,e;t=N.get().createCanvas()}catch{t=N.get().createCanvas()}t.width=t.height=10,rt.__canvas=t}return rt.__canvas}static get _context(){return rt.__context||(rt.__context=rt._canvas.getContext("2d",YE)),rt.__context}};_s.METRICS_STRING="|\xC9q\xC5";_s.BASELINE_SYMBOL="M";_s.BASELINE_MULTIPLIER=1.4;_s.HEIGHT_MULTIPLIER=2;_s.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return t=>{let e=r.segment(t),s=[],i=0;for(let n of e)s[i++]=n.segment;return s}}return r=>[...r]})();_s.experimentalLetterSpacing=!1;_s._fonts={};_s._measurementCache=bf(1e3);At=_s});function ys(r){let t=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,e=r.fontFamily;Array.isArray(r.fontFamily)||(e=r.fontFamily.split(","));for(let s=e.length-1;s>=0;s--){let i=e[s].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!vB.includes(i)&&(i=`"${i}"`),e[s]=i}return`${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${t} ${e.join(",")}`}var vB,Al=x(()=>{"use strict";vB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"]});function TB(r){let t=r;if(typeof t.dropShadow=="boolean"&&t.dropShadow){let e=Ot.defaultDropShadow;r.dropShadow={alpha:t.dropShadowAlpha??e.alpha,angle:t.dropShadowAngle??e.angle,blur:t.dropShadowBlur??e.blur,color:t.dropShadowColor??e.color,distance:t.dropShadowDistance??e.distance}}if(t.strokeThickness!==void 0){I(V,"strokeThickness is now a part of stroke");let e=t.stroke,s={};if(X.isColorLike(e))s.color=e;else if(e instanceof Nt||e instanceof hr)s.fill=e;else if(Object.hasOwnProperty.call(e,"color")||Object.hasOwnProperty.call(e,"fill"))s=e;else throw new Error("Invalid stroke value.");r.stroke={...s,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(I(V,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&k("The number of fill colors must match the number of fill gradient stops.");let e=new Nt({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=t.fillGradientStops.slice(),i=t.fill.map(n=>X.shared.setValue(n).toNumber());s.forEach((n,o)=>{e.addColorStop(n,i[o])}),r.fill={fill:e}}}var T2,Ot,fr=x(()=>{"use strict";le();It();Yt();xt();pt();zr();No();li();ff();Al();T2=class cn extends St{constructor(t={}){super(),this.uid=et("textStyle"),this._tick=0,this._cachedFontString=null,TB(t),t instanceof cn&&(t=t._toObject());let i={...cn.defaultTextStyle,...t};for(let n in i){let o=n;this[o]=i[n]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...cn.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...cn.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...Kt.defaultFillStyle,...t},()=>{this._fill=Xr({...this._originalFill},Kt.defaultFillStyle)})),this._fill=Xr(t===0?"black":t,Kt.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Kt.defaultStrokeStyle,...t},()=>{this._stroke=nn({...this._originalStroke},Kt.defaultStrokeStyle)})),this._stroke=nn(t,Kt.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){let t=cn.defaultTextStyle;for(let e in t)this[e]=t[e]}assign(t){for(let e in t){let s=e;this[s]=t[e]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=ys(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new cn(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){if(this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(s),this._originalFill?.texture&&this._originalFill.texture.destroy(s),this._stroke?.texture&&this._stroke.texture.destroy(s),this._originalStroke?.texture&&this._originalStroke.texture.destroy(s)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(s,i,n)=>(s[i]===n||(s[i]=n,e?.(i,n),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(X.isColorLike(t)||t instanceof Nt||t instanceof hr)}};T2.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};T2.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};Ot=T2});function vs(r,t,e,s=0,i=0,n=0){if(r.texture===D.WHITE&&!r.fill)return X.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof hr){let o=r.fill,a=t.createPattern(o.texture.source.resource,"repeat");return Z.applyPatternTransform(a,o.transform,!1),a}else if(r.fill instanceof Nt){let o=r.fill,a=o.type==="linear",u=o.textureSpace==="local",l=1,c=1;u&&e&&(l=e.width+s,c=e.height+s);let h,d=!1;if(a){let{start:f,end:p}=o;h=t.createLinearGradient(f.x*l+i,f.y*c+n,p.x*l+i,p.y*c+n),d=Math.abs(p.x-f.x)<Math.abs((p.y-f.y)*.1)}else{let{center:f,innerRadius:p,outerCenter:g,outerRadius:_}=o;h=t.createRadialGradient(f.x*l+i,f.y*c+n,p*l,g.x*l+i,g.y*c+n,_*l)}if(d&&u&&e){let f=e.lineHeight/c;for(let p=0;p<e.lines.length;p++){let g=(p*e.lineHeight+s/2)/c;o.colorStops.forEach(_=>{let b=g+_.offset*f;b=Math.max(0,Math.min(1,b)),h.addColorStop(Math.floor(b*jE)/jE,X.shared.setValue(_.color).toHex())})}}else o.colorStops.forEach(f=>{h.addColorStop(f.offset,X.shared.setValue(f.color).toHex())});return h}}else{let o=t.createPattern(r.texture.source.resource,"repeat"),a=r.matrix.copyTo(F.shared);return a.scale(r.texture.source.pixelWidth,r.texture.source.pixelHeight),o.setTransform(a),o}return k("FillStyle not recognised",r),"red"}var jE,Ef=x(()=>{"use strict";It();ot();Lr();ht();pt();zr();No();jE=1e5});var qE,Cf,S2=x(()=>{"use strict";It();jt();Ks();Ci();ht();kr();xt();bs();Al();Ef();fr();_f();qE=class KE extends on{constructor(t){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;let e={...KE.defaultOptions,...t};this._textureSize=e.textureSize,this._mipmap=e.mipmap;let s=e.style.clone();e.overrideFill&&(s._fill.color=16777215,s._fill.alpha=1,s._fill.texture=D.WHITE,s._fill.fill=null),this.applyFillAsTint=e.overrideFill;let i=s.fontSize;s.fontSize=this.baseMeasurementFontSize;let n=ys(s);e.overrideSize?(s._stroke&&(s._stroke.width*=this.baseRenderedFontSize/i),s.dropShadow&&(s.dropShadow.blur*=this.baseRenderedFontSize/i,s.dropShadow.distance*=this.baseRenderedFontSize/i)):s.fontSize=this.baseRenderedFontSize=i,this._style=s,this._skipKerning=e.skipKerning??!1,this.resolution=e.resolution??1,this._padding=e.padding??4,e.textureStyle&&(this._textureStyle=e.textureStyle instanceof Qt?e.textureStyle:new Qt(e.textureStyle)),this.fontMetrics=At.measureFont(n),this.lineHeight=s.lineHeight||this.fontMetrics.fontSize||s.fontSize}ensureCharacters(t){let e=At.graphemeSegmenter(t).filter(b=>!this._currentChars.includes(b)).filter((b,y,v)=>v.indexOf(b)===y);if(!e.length)return;this._currentChars=[...this._currentChars,...e];let s;this._currentPageIndex===-1?s=this._nextPage():s=this.pages[this._currentPageIndex];let{canvas:i,context:n}=s.canvasAndContext,o=s.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=(a.dropShadow?.distance??0)+(a._stroke?.width??0),f=this._padding+d,p=!1,g=i.width/this.resolution,_=i.height/this.resolution;for(let b=0;b<e.length;b++){let y=e[b],v=At.measureText(y,a,i,!1);v.lineHeight=v.height;let T=v.width*h,S=Math.ceil((a.fontStyle==="italic"?2:1)*T),E=v.height*h,w=S+f*2,M=E+f*2;if(p=!1,y!==`
|
|
908
|
-
`&&y!=="\r"&&y!==" "&&y!==" "&&(p=!0,c=Math.ceil(Math.max(M,c))),u+w>g&&(l+=c,c=M,u=0,l+c>_)){o.update();let R=this._nextPage();i=R.canvasAndContext.canvas,n=R.canvasAndContext.context,o=R.texture.source,u=0,l=0,c=0}let P=n.measureText(y).width/h;if(this.chars[y]={id:y.codePointAt(0),xOffset:-(f/h),yOffset:-(f/h),xAdvance:P,kerning:{}},p){this._drawGlyph(n,v,u+f,l+f,h,a);let R=o.width*h,A=o.height*h,G=new J(u/R*o.width,l/A*o.height,w/R*o.width,M/A*o.height);this.chars[y].texture=new D({source:o,frame:G}),u+=Math.ceil(w)}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning||this._applyKerning(e,n,h)}get pageTextures(){return I(V,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(t,e,s){let i=this._measureCache;for(let n=0;n<t.length;n++){let o=t[n];for(let a=0;a<this._currentChars.length;a++){let u=this._currentChars[a],l=i[o];l||(l=i[o]=e.measureText(o).width);let c=i[u];c||(c=i[u]=e.measureText(u).width);let h=e.measureText(o+u).width,d=h-(l+c);d&&this.chars[o]&&(this.chars[o].kerning[u]=d/s),h=e.measureText(o+u).width,d=h-(l+c),d&&this.chars[u]&&(this.chars[u].kerning[o]=d/s)}}}_nextPage(){this._currentPageIndex++;let t=this.resolution,e=be.getOptimalCanvasAndContext(this._textureSize,this._textureSize,t);this._setupContext(e.context,this._style,t);let s=t*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new D({source:new ke({resource:e.canvas,resolution:s,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(i.source.style=this._textureStyle);let n={canvasAndContext:e,texture:i};return this.pages[this._currentPageIndex]=n,n}_setupContext(t,e,s){e.fontSize=this.baseRenderedFontSize,t.scale(s,s),t.font=ys(e),e.fontSize=this.baseMeasurementFontSize,t.textBaseline=e.textBaseline;let i=e._stroke,n=i?.width??0;if(i&&(t.lineWidth=n,t.lineJoin=i.join,t.miterLimit=i.miterLimit,t.strokeStyle=vs(i,t)),e._fill&&(t.fillStyle=vs(e._fill,t)),e.dropShadow){let o=e.dropShadow,a=X.shared.setValue(o.color).toArray(),u=o.blur*s,l=o.distance*s;t.shadowColor=`rgba(${a[0]*255},${a[1]*255},${a[2]*255},${o.alpha})`,t.shadowBlur=u,t.shadowOffsetX=Math.cos(o.angle)*l,t.shadowOffsetY=Math.sin(o.angle)*l}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0}_drawGlyph(t,e,s,i,n,o){let a=e.text,u=e.fontProperties,c=(o._stroke?.width??0)*n,h=s+c/2,d=i-c/2,f=u.descent*n,p=e.lineHeight*n,g=!1;o.stroke&&c&&(g=!0,t.strokeText(a,h,d+p-f));let{shadowBlur:_,shadowOffsetX:b,shadowOffsetY:y}=t;o._fill&&(g&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.fillText(a,h,d+p-f)),g&&(t.shadowBlur=_,t.shadowOffsetX=b,t.shadowOffsetY=y)}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){let{canvasAndContext:e,texture:s}=this.pages[t];be.returnCanvasAndContext(e),s.destroy(!0)}this.pages=null}};
|
|
906
|
+
`?(h.push(d),d=[]):U.length>0&&d.push({text:U,style:W.style})}}(d.length>0||h.length===0)&&h.push(d);let f=e?$E(h,t,s,n,a,u):h,p=[],g=[],_=[],b=[],y=[],v=0,T=t._fontString,S=o(T);S.fontSize===0&&(S.fontSize=t.fontSize,S.ascent=t.fontSize);let E="",w=!!t.dropShadow,M=t._stroke?.width||0;for(let W of f){let $=0,B=S.ascent,U=S.descent,z="";for(let K of W){let gt=K.style._fontString,ft=o(gt);gt!==E&&(s.font=gt,E=gt);let Y=i(K.text,K.style.letterSpacing,s);$+=Y,B=Math.max(B,ft.ascent),U=Math.max(U,ft.descent),z+=K.text;let Q=K.style._stroke?.width||0;Q>M&&(M=Q),!w&&K.style.dropShadow&&(w=!0)}W.length===0&&(B=S.ascent,U=S.descent),p.push($),g.push(B),_.push(U),y.push(z);let L=t.lineHeight||B+U;b.push(L+t.leading),v=Math.max(v,$)}let P=M,R=v+P+(t.dropShadow?t.dropShadow.distance:0),A=0;for(let W=0;W<b.length;W++)A+=b[W];A=Math.max(A,b[0]+P);let G=A+(t.dropShadow?t.dropShadow.distance:0),H=t.lineHeight||S.fontSize;return{width:R,height:G,lines:y,lineWidths:p,lineHeight:H+t.leading,maxLineWidth:v,fontProperties:S,runsByLine:f,lineAscents:g,lineDescents:_,lineHeights:b,hasDropShadow:w}}function $E(r,t,e,s,i,n){let{letterSpacing:o,whiteSpace:a,wordWrapWidth:u,breakWords:l}=t,c=cn(a),h=u+o,d={},f="",p=(_,b)=>{let y=`${_}|${b.styleKey}`,v=d[y];if(v===void 0){let T=b._fontString;T!==f&&(e.font=T,f=T),v=s(_,b.letterSpacing,e)+b.letterSpacing,d[y]=v}return v},g=[];for(let _ of r){let b=YE(_),y=g.length,v=A=>{let G=0,H=A;do{let{token:W,style:$}=b[H];G+=p(W,$),H++}while(H<b.length&&b[H].continuesFromPrevious);return G},T=A=>{let G=[],H=A;do G.push({token:b[H].token,style:b[H].style}),H++;while(H<b.length&&b[H].continuesFromPrevious);return G},S=[],E=0,w=!c,M=null,P=()=>{M&&M.text.length>0&&S.push(M),M=null},R=()=>{if(P(),S.length>0){let A=S[S.length-1];A.text=dr(A.text),A.text.length===0&&S.pop()}g.push(S),S=[],E=0,w=!1};for(let A=0;A<b.length;A++){let{token:G,style:H,continuesFromPrevious:W}=b[A],$=p(G,H);if(c){let z=de(G),L=M?.text[M.text.length-1]??S[S.length-1]?.text.slice(-1)??"",K=L?de(L):!1;if(z&&K)continue}let B=!W,U=B?v(A):$;if(U>h&&B)if(E>0&&R(),l){let z=T(A);for(let L=0;L<z.length;L++){let K=z[L].token,gt=z[L].style,ft=Al(K,l,n,i);for(let Y of ft){let Q=p(Y,gt);Q+E>h&&R(),!M||M.style!==gt?(P(),M={text:Y,style:gt}):M.text+=Y,E+=Q}}A+=z.length-1}else{let z=T(A);P(),g.push(z.map(L=>({text:L.token,style:L.style}))),w=!1,A+=z.length-1}else if(U+E>h&&B){if(de(G)){w=!1;continue}R(),M={text:G,style:H},E=$}else if(W&&!l)!M||M.style!==H?(P(),M={text:G,style:H}):M.text+=G,E+=$;else{let z=de(G);if(E===0&&z&&!w)continue;!M||M.style!==H?(P(),M={text:G,style:H}):M.text+=G,E+=$}}if(P(),S.length>0){let A=S[S.length-1];A.text=dr(A.text),A.text.length===0&&S.pop()}(S.length>0||g.length===y)&&g.push(S)}return g}function YE(r){let t=[],e=!1;for(let s of r){let i=Cl(s.text),n=!0;for(let o of i){let a=de(o)||ln(o),u=n&&e&&!a;t.push({token:o,style:s.style,continuesFromPrevious:u}),e=!a,n=!1}}return t}var yB,y2=x(()=>{"use strict";vf();na();yB=/\r\n|\r|\n/g});function jE(r,t,e,s,i){let n=e[r];return typeof n!="number"&&(n=i(r,t,s)+t,e[r]=n),n}function v2(r,t,e,s,i,n,o){let a=e.getContext("2d",vB);a.font=t._fontString;let u=0,l="",c=[],h=Object.create(null),{letterSpacing:d,whiteSpace:f}=t,p=cn(f),g=hn(f),_=!p,b=t.wordWrapWidth+d,y=Cl(r);for(let T=0;T<y.length;T++){let S=y[T];if(ln(S)){if(!g){c.push(dr(l)),_=!p,l="",u=0;continue}S=" "}if(p){let w=de(S),M=de(l[l.length-1]);if(w&&M)continue}let E=jE(S,d,h,a,s);if(E>b)if(l!==""&&(c.push(dr(l)),l="",u=0),i(S,t.breakWords)){let w=Al(S,t.breakWords,o,n);for(let M of w){let P=jE(M,d,h,a,s);P+u>b&&(c.push(dr(l)),_=!1,l="",u=0),l+=M,u+=P}}else l.length>0&&(c.push(dr(l)),l="",u=0),c.push(dr(S)),_=!1,l="",u=0;else E+u>b&&(_=!1,c.push(dr(l)),l="",u=0),(l.length>0||!de(S)||_)&&(l+=S,u+=E)}let v=dr(l);return v.length>0&&c.push(v),c.join(`
|
|
907
|
+
`)}var vB,T2=x(()=>{"use strict";na();vB={willReadFrequently:!0}});var qE,_s,At,bs=x(()=>{"use strict";g2();mt();y2();vf();na();T2();qE={willReadFrequently:!0},_s=class rt{static get experimentalLetterSpacingSupported(){let t=rt._experimentalLetterSpacingSupported;if(t===void 0){let e=N.get().getCanvasRenderingContext2D().prototype;t=rt._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,i,n,o,a,u,l,c){this.text=t,this.style=e,this.width=s,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l,c&&(this.runsByLine=c.runsByLine,this.lineAscents=c.lineAscents,this.lineDescents=c.lineDescents,this.lineHeights=c.lineHeights,this.hasDropShadow=c.hasDropShadow)}static measureText(t=" ",e,s=rt._canvas,i=e.wordWrap){let n=`${t}-${e.styleKey}-wordWrap-${i}`;if(rt._measurementCache.has(n))return rt._measurementCache.get(n);if(Sl(e)&&El(t)){let T=b2(t,e,i,rt._context,rt._measureText,rt._measureTextAdvance,rt.measureFont,rt.canBreakChars,rt.wordWrapSplit),S=new rt(t,e,T.width,T.height,T.lines,T.lineWidths,T.lineHeight,T.maxLineWidth,T.fontProperties,{runsByLine:T.runsByLine,lineAscents:T.lineAscents,lineDescents:T.lineDescents,lineHeights:T.lineHeights,hasDropShadow:T.hasDropShadow});return rt._measurementCache.set(n,S),S}let a=e._fontString,u=rt.measureFont(a);u.fontSize===0&&(u.fontSize=e.fontSize,u.ascent=e.fontSize,u.descent=0);let l=rt._context;l.font=a;let h=(i?rt._wordWrap(t,e,s):t).split(_2),d=new Array(h.length),f=0;for(let T=0;T<h.length;T++){let S=rt._measureText(h[T],e.letterSpacing,l);d[T]=S,f=Math.max(f,S)}let p=e._stroke?.width??0,g=e.lineHeight||u.fontSize,_=rt._adjustWidthForStyle(f,e),b=Math.max(g,u.fontSize+p)+(h.length-1)*(g+e.leading),y=rt._adjustHeightForStyle(b,e),v=new rt(t,e,_,y,h,d,g+e.leading,f,u);return rt._measurementCache.set(n,v),v}static _adjustWidthForStyle(t,e){let s=e._stroke?.width||0,i=t+s;return e.dropShadow&&(i+=e.dropShadow.distance),i}static _adjustHeightForStyle(t,e){let s=t;return e.dropShadow&&(s+=e.dropShadow.distance),s}static _measureText(t,e,s){let{metricWidth:i,metrics:n,letterSpacingVal:o}=rt._measureTextCore(t,e,s),a=-(n.actualBoundingBoxLeft??0),l=(n.actualBoundingBoxRight??0)-a;return n.width>0&&(l+=o),Math.max(i,l)}static _measureTextAdvance(t,e,s){return rt._measureTextCore(t,e,s).metricWidth}static _measureTextCore(t,e,s){let i=!1;rt.experimentalLetterSpacingSupported&&(rt.experimentalLetterSpacing?(s.letterSpacing=`${e}px`,s.textLetterSpacing=`${e}px`,i=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));let n=s.measureText(t),o=n.width,a=0;return o>0&&(i?a=-e:a=(rt.graphemeSegmenter(t).length-1)*e,o+=a),{metricWidth:o,metrics:n,letterSpacingVal:a}}static _wordWrap(t,e,s=rt._canvas){return v2(t,e,s,rt._measureTextAdvance,rt.canBreakWords,rt.canBreakChars,rt.wordWrapSplit)}static isBreakingSpace(t,e){return de(t,e)}static canBreakWords(t,e){return e}static canBreakChars(t,e,s,i,n){return!0}static wordWrapSplit(t){return rt.graphemeSegmenter(t)}static measureFont(t){if(rt._fonts[t])return rt._fonts[t];let e=rt._context;e.font=t;let s=e.measureText(rt.METRICS_STRING+rt.BASELINE_SYMBOL),i=s.actualBoundingBoxAscent??0,n=s.actualBoundingBoxDescent??0,o={ascent:i,descent:n,fontSize:i+n};return rt._fonts[t]=o,o}static clearMetrics(t=""){t?delete rt._fonts[t]:rt._fonts={}}static get _canvas(){if(!rt.__canvas){let t;try{let e=new OffscreenCanvas(0,0);if(e.getContext("2d",qE)?.measureText)return rt.__canvas=e,e;t=N.get().createCanvas()}catch{t=N.get().createCanvas()}t.width=t.height=10,rt.__canvas=t}return rt.__canvas}static get _context(){return rt.__context||(rt.__context=rt._canvas.getContext("2d",qE)),rt.__context}};_s.METRICS_STRING="|\xC9q\xC5";_s.BASELINE_SYMBOL="M";_s.BASELINE_MULTIPLIER=1.4;_s.HEIGHT_MULTIPLIER=2;_s.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return t=>{let e=r.segment(t),s=[],i=0;for(let n of e)s[i++]=n.segment;return s}}return r=>[...r]})();_s.experimentalLetterSpacing=!1;_s._fonts={};_s._measurementCache=bf(1e3);At=_s});function ys(r){let t=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,e=r.fontFamily;Array.isArray(r.fontFamily)||(e=r.fontFamily.split(","));for(let s=e.length-1;s>=0;s--){let i=e[s].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!TB.includes(i)&&(i=`"${i}"`),e[s]=i}return`${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${t} ${e.join(",")}`}var TB,wl=x(()=>{"use strict";TB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"]});function SB(r){let t=r;if(typeof t.dropShadow=="boolean"&&t.dropShadow){let e=Ot.defaultDropShadow;r.dropShadow={alpha:t.dropShadowAlpha??e.alpha,angle:t.dropShadowAngle??e.angle,blur:t.dropShadowBlur??e.blur,color:t.dropShadowColor??e.color,distance:t.dropShadowDistance??e.distance}}if(t.strokeThickness!==void 0){I(V,"strokeThickness is now a part of stroke");let e=t.stroke,s={};if(X.isColorLike(e))s.color=e;else if(e instanceof Nt||e instanceof hr)s.fill=e;else if(Object.hasOwnProperty.call(e,"color")||Object.hasOwnProperty.call(e,"fill"))s=e;else throw new Error("Invalid stroke value.");r.stroke={...s,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(I(V,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&k("The number of fill colors must match the number of fill gradient stops.");let e=new Nt({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=t.fillGradientStops.slice(),i=t.fill.map(n=>X.shared.setValue(n).toNumber());s.forEach((n,o)=>{e.addColorStop(n,i[o])}),r.fill={fill:e}}}var S2,Ot,fr=x(()=>{"use strict";le();It();Yt();xt();pt();zr();Wo();ci();ff();wl();S2=class dn extends St{constructor(t={}){super(),this.uid=et("textStyle"),this._tick=0,this._cachedFontString=null,SB(t),t instanceof dn&&(t=t._toObject());let i={...dn.defaultTextStyle,...t};for(let n in i){let o=n;this[o]=i[n]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...dn.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...dn.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...Kt.defaultFillStyle,...t},()=>{this._fill=Xr({...this._originalFill},Kt.defaultFillStyle)})),this._fill=Xr(t===0?"black":t,Kt.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Kt.defaultStrokeStyle,...t},()=>{this._stroke=an({...this._originalStroke},Kt.defaultStrokeStyle)})),this._stroke=an(t,Kt.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){let t=dn.defaultTextStyle;for(let e in t)this[e]=t[e]}assign(t){for(let e in t){let s=e;this[s]=t[e]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=ys(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new dn(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){if(this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(s),this._originalFill?.texture&&this._originalFill.texture.destroy(s),this._stroke?.texture&&this._stroke.texture.destroy(s),this._originalStroke?.texture&&this._originalStroke.texture.destroy(s)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(s,i,n)=>(s[i]===n||(s[i]=n,e?.(i,n),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(X.isColorLike(t)||t instanceof Nt||t instanceof hr)}};S2.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};S2.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};Ot=S2});function vs(r,t,e,s=0,i=0,n=0){if(r.texture===D.WHITE&&!r.fill)return X.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof hr){let o=r.fill,a=t.createPattern(o.texture.source.resource,"repeat");return Z.applyPatternTransform(a,o.transform,!1),a}else if(r.fill instanceof Nt){let o=r.fill,a=o.type==="linear",u=o.textureSpace==="local",l=1,c=1;u&&e&&(l=e.width+s,c=e.height+s);let h,d=!1;if(a){let{start:f,end:p}=o;h=t.createLinearGradient(f.x*l+i,f.y*c+n,p.x*l+i,p.y*c+n),d=Math.abs(p.x-f.x)<Math.abs((p.y-f.y)*.1)}else{let{center:f,innerRadius:p,outerCenter:g,outerRadius:_}=o;h=t.createRadialGradient(f.x*l+i,f.y*c+n,p*l,g.x*l+i,g.y*c+n,_*l)}if(d&&u&&e){let f=e.lineHeight/c;for(let p=0;p<e.lines.length;p++){let g=(p*e.lineHeight+s/2)/c;o.colorStops.forEach(_=>{let b=g+_.offset*f;b=Math.max(0,Math.min(1,b)),h.addColorStop(Math.floor(b*KE)/KE,X.shared.setValue(_.color).toHex())})}}else o.colorStops.forEach(f=>{h.addColorStop(f.offset,X.shared.setValue(f.color).toHex())});return h}}else{let o=t.createPattern(r.texture.source.resource,"repeat"),a=r.matrix.copyTo(F.shared);return a.scale(r.texture.source.pixelWidth,r.texture.source.pixelHeight),o.setTransform(a),o}return k("FillStyle not recognised",r),"red"}var KE,Ef=x(()=>{"use strict";It();ot();Lr();ht();pt();zr();Wo();KE=1e5});var ZE,Cf,E2=x(()=>{"use strict";It();jt();Zs();wi();ht();kr();xt();bs();wl();Ef();fr();_f();ZE=class QE extends un{constructor(t){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;let e={...QE.defaultOptions,...t};this._textureSize=e.textureSize,this._mipmap=e.mipmap;let s=e.style.clone();e.overrideFill&&(s._fill.color=16777215,s._fill.alpha=1,s._fill.texture=D.WHITE,s._fill.fill=null),this.applyFillAsTint=e.overrideFill;let i=s.fontSize;s.fontSize=this.baseMeasurementFontSize;let n=ys(s);e.overrideSize?(s._stroke&&(s._stroke.width*=this.baseRenderedFontSize/i),s.dropShadow&&(s.dropShadow.blur*=this.baseRenderedFontSize/i,s.dropShadow.distance*=this.baseRenderedFontSize/i)):s.fontSize=this.baseRenderedFontSize=i,this._style=s,this._skipKerning=e.skipKerning??!1,this.resolution=e.resolution??1,this._padding=e.padding??4,e.textureStyle&&(this._textureStyle=e.textureStyle instanceof Qt?e.textureStyle:new Qt(e.textureStyle)),this.fontMetrics=At.measureFont(n),this.lineHeight=s.lineHeight||this.fontMetrics.fontSize||s.fontSize}ensureCharacters(t){let e=At.graphemeSegmenter(t).filter(b=>!this._currentChars.includes(b)).filter((b,y,v)=>v.indexOf(b)===y);if(!e.length)return;this._currentChars=[...this._currentChars,...e];let s;this._currentPageIndex===-1?s=this._nextPage():s=this.pages[this._currentPageIndex];let{canvas:i,context:n}=s.canvasAndContext,o=s.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=(a.dropShadow?.distance??0)+(a._stroke?.width??0),f=this._padding+d,p=!1,g=i.width/this.resolution,_=i.height/this.resolution;for(let b=0;b<e.length;b++){let y=e[b],v=At.measureText(y,a,i,!1);v.lineHeight=v.height;let T=v.width*h,S=Math.ceil((a.fontStyle==="italic"?2:1)*T),E=v.height*h,w=S+f*2,M=E+f*2;if(p=!1,y!==`
|
|
908
|
+
`&&y!=="\r"&&y!==" "&&y!==" "&&(p=!0,c=Math.ceil(Math.max(M,c))),u+w>g&&(l+=c,c=M,u=0,l+c>_)){o.update();let R=this._nextPage();i=R.canvasAndContext.canvas,n=R.canvasAndContext.context,o=R.texture.source,u=0,l=0,c=0}let P=n.measureText(y).width/h;if(this.chars[y]={id:y.codePointAt(0),xOffset:-(f/h),yOffset:-(f/h),xAdvance:P,kerning:{}},p){this._drawGlyph(n,v,u+f,l+f,h,a);let R=o.width*h,A=o.height*h,G=new J(u/R*o.width,l/A*o.height,w/R*o.width,M/A*o.height);this.chars[y].texture=new D({source:o,frame:G}),u+=Math.ceil(w)}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning||this._applyKerning(e,n,h)}get pageTextures(){return I(V,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(t,e,s){let i=this._measureCache;for(let n=0;n<t.length;n++){let o=t[n];for(let a=0;a<this._currentChars.length;a++){let u=this._currentChars[a],l=i[o];l||(l=i[o]=e.measureText(o).width);let c=i[u];c||(c=i[u]=e.measureText(u).width);let h=e.measureText(o+u).width,d=h-(l+c);d&&this.chars[o]&&(this.chars[o].kerning[u]=d/s),h=e.measureText(o+u).width,d=h-(l+c),d&&this.chars[u]&&(this.chars[u].kerning[o]=d/s)}}}_nextPage(){this._currentPageIndex++;let t=this.resolution,e=be.getOptimalCanvasAndContext(this._textureSize,this._textureSize,t);this._setupContext(e.context,this._style,t);let s=t*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new D({source:new ke({resource:e.canvas,resolution:s,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(i.source.style=this._textureStyle);let n={canvasAndContext:e,texture:i};return this.pages[this._currentPageIndex]=n,n}_setupContext(t,e,s){e.fontSize=this.baseRenderedFontSize,t.scale(s,s),t.font=ys(e),e.fontSize=this.baseMeasurementFontSize,t.textBaseline=e.textBaseline;let i=e._stroke,n=i?.width??0;if(i&&(t.lineWidth=n,t.lineJoin=i.join,t.miterLimit=i.miterLimit,t.strokeStyle=vs(i,t)),e._fill&&(t.fillStyle=vs(e._fill,t)),e.dropShadow){let o=e.dropShadow,a=X.shared.setValue(o.color).toArray(),u=o.blur*s,l=o.distance*s;t.shadowColor=`rgba(${a[0]*255},${a[1]*255},${a[2]*255},${o.alpha})`,t.shadowBlur=u,t.shadowOffsetX=Math.cos(o.angle)*l,t.shadowOffsetY=Math.sin(o.angle)*l}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0}_drawGlyph(t,e,s,i,n,o){let a=e.text,u=e.fontProperties,c=(o._stroke?.width??0)*n,h=s+c/2,d=i-c/2,f=u.descent*n,p=e.lineHeight*n,g=!1;o.stroke&&c&&(g=!0,t.strokeText(a,h,d+p-f));let{shadowBlur:_,shadowOffsetX:b,shadowOffsetY:y}=t;o._fill&&(g&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.fillText(a,h,d+p-f)),g&&(t.shadowBlur=_,t.shadowOffsetX=b,t.shadowOffsetY=y)}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){let{canvasAndContext:e,texture:s}=this.pages[t];be.returnCanvasAndContext(e),s.destroy(!0)}this.pages=null}};ZE.defaultOptions={textureSize:512,style:new Ot,mipmap:!0};Cf=ZE});function fn(r,t,e,s){let i={width:0,height:0,offsetY:0,scale:t.fontSize/e.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};i.offsetY=e.baseLineOffset;let n=i.lines[0],o=null,a=!0,u={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},l=e.baseMeasurementFontSize/t.fontSize,c=t.letterSpacing*l,h=t.wordWrapWidth*l,d=t.lineHeight?t.lineHeight*l:e.lineHeight,f=t.wordWrap&&t.breakWords,p=cn(t.whiteSpace),g=hn(t.whiteSpace);if(p||g){let v=[],T=p;for(let S=0;S<r.length;S++){let E=r[S];if(E==="\r"||E===`
|
|
909
909
|
`)if(g)E==="\r"&&r[S+1]===`
|
|
910
910
|
`&&S++,E=" ";else{p&&(T=!0),v.push(E);continue}if(de(E))if(p&&Tf(E)){if(T)continue;T=!0,v.push(" ")}else T=!1,v.push(E);else T=!1,v.push(E)}r=v}let _=v=>{let T=n.width;for(let S=0;S<u.index;S++){let E=v.positions[S];n.chars.push(v.chars[S]),n.charPositions.push(E+T)}n.width+=v.width,(u.index>0||!p)&&(a=!1),u.width=0,u.index=0,u.chars.length=0},b=()=>{let v=n.chars.length-1;if(s){let T=n.chars[v];for(;Tf(T);)n.width-=e.chars[T].xAdvance,n.spacesIndex.pop(),T=n.chars[--v]}i.width=Math.max(i.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=!0,i.lines.push(n),i.height+=d},y=v=>v-c>h;for(let v=0;v<r.length+1;v++){let T,S=v===r.length;S||(T=r[v]);let E=e.chars[T];if(/(?:\s)/.test(T)||T==="\r"||T===`
|
|
911
911
|
`||S){if(!a&&t.wordWrap&&y(n.width+u.width)?(b(),_(u),!S&&E&&n.charPositions.push(0)):(u.start=n.width,_(u),!S&&E&&n.charPositions.push(0)),T==="\r"||T===`
|
|
912
|
-
`)b();else if(!S&&E){let R=E.xAdvance+(E.kerning?.[o]||0)+c;n.width+=R,n.spaceWidth=R,n.spacesIndex.push(n.charPositions.length),n.chars.push(T)}}else if(E){let P=E.kerning?.[o]||0,R=E.xAdvance+P+c;f&&y(u.width+R)&&(a||b(),_(u),b()),u.positions[u.index++]=u.width+P,u.chars.push(T),u.width+=R,Sf(T)&&(!a&&t.wordWrap&&y(n.width+u.width)&&b(),_(u))}o=T}return b(),t.align==="center"?SB(i):t.align==="right"?EB(i):t.align==="justify"&&CB(i),i}function SB(r){for(let t=0;t<r.lines.length;t++){let e=r.lines[t],s=r.width/2-e.width/2;for(let i=0;i<e.charPositions.length;i++)e.charPositions[i]+=s}}function EB(r){for(let t=0;t<r.lines.length;t++){let e=r.lines[t],s=r.width-e.width;for(let i=0;i<e.charPositions.length;i++)e.charPositions[i]+=s}}function CB(r){let t=r.width;for(let e=0;e<r.lines.length-2;e++){let s=r.lines[e],i=0,n=s.spacesIndex[i++],o=0,a=s.spacesIndex.length,l=(t-s.width)/a;for(let c=0;c<s.charPositions.length;c++)c===n&&(n=s.spacesIndex[i++],o+=l),s.charPositions[c]+=o}}var wl=x(()=>{"use strict";sa()});function E2(r){if(r==="")return[];typeof r=="string"&&(r=[r]);let t=[];for(let e=0,s=r.length;e<s;e++){let i=r[e];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=i[0].charCodeAt(0),o=i[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)t.push(String.fromCharCode(a))}else t.push(...Array.from(i))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}var C2=x(()=>{"use strict"});var Af,A2,Yr,ia=x(()=>{"use strict";m2();Tr();xt();pt();bs();fr();S2();wl();C2();Af=0,A2=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=bf(1e3)}getFont(t,e){let s=`${e.fontFamily}-bitmap`,i=!0;if(at.has(s)){let o=at.get(s);return o.ensureCharacters?.(t),o}if(e._fill.fill&&!e._stroke?(s+=e._fill.fill.styleKey,i=!1):(e._stroke||e.dropShadow)&&(s=`${e.styleKey}-bitmap`,i=!1),s+=`-${e.fontStyle}`,s+=`-${e.fontVariant}`,s+=`-${e.fontWeight}`,!at.has(s)){let o=Object.create(e);o._lineHeight=0;let a=new Cf({style:o,overrideFill:i,overrideSize:!0,...this.defaultOptions});Af++,Af>50&&k("BitmapText",`You have dynamically created ${Af} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{Af--,at.remove(s)}),at.set(s,a)}let n=at.get(s);return n.ensureCharacters?.(t),n}getLayout(t,e,s=!0){let i=this.getFont(t,e),n=`${t}-${e.styleKey}-${s}`;if(this.measureCache.has(n))return this.measureCache.get(n);let o=At.graphemeSegmenter(t),a=hn(o,e,i,s);return this.measureCache.set(n,a),a}measureText(t,e,s=!0){return this.getLayout(t,e,s)}install(...t){let e=t[0];typeof e=="string"&&(e={name:e,style:t[1],chars:t[2]?.chars,resolution:t[2]?.resolution,padding:t[2]?.padding,skipKerning:t[2]?.skipKerning},I(V,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let s=e?.name;if(!s)throw new Error("[BitmapFontManager] Property `name` is required.");e={...this.defaultOptions,...e};let i=e.style,n=i instanceof Ot?i:new Ot(i),o=e.dynamicFill??this._canUseTintForStyle(n),a=new Cf({style:n,overrideFill:o,skipKerning:e.skipKerning,padding:e.padding,resolution:e.resolution,overrideSize:!1,textureStyle:e.textureStyle}),u=E2(e.chars);return a.ensureCharacters(u.join("")),at.set(`${s}-bitmap`,a),a.once("destroy",()=>at.remove(`${s}-bitmap`)),a}uninstall(t){let e=`${t}-bitmap`,s=at.get(e);s&&s.destroy()}_canUseTintForStyle(t){return!t._stroke&&(!t.dropShadow||t.dropShadow.color===0)&&!t._fill.fill&&t._fill.color===16777215}},Yr=new A2});var ZE={};Ec(ZE,{BitmapFont:()=>wf});var wf,w2=x(()=>{"use strict";Ns();jt();ht();_f();ia();wf=class extends on{constructor(t,e){super();let{textures:s,data:i}=t;Object.keys(i.pages).forEach(n=>{let o=i.pages[parseInt(n,10)],a=s[o.id];this.pages.push({texture:a})}),Object.keys(i.chars).forEach(n=>{let o=i.chars[n],{frame:a,source:u,rotate:l}=s[o.page],c=q.transformRectCoords(o,a,l,new J),h=new D({frame:c,orig:new J(0,0,o.width,o.height),source:u,rotate:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:h}}),this.baseRenderedFontSize=i.fontSize,this.baseMeasurementFontSize=i.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:i.fontSize},this.baseLineOffset=i.baseLineOffset,this.lineHeight=i.lineHeight,this.fontFamily=i.fontFamily,this.distanceField=i.distanceField??{type:"none",range:0},this.url=e}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){let{texture:e}=this.pages[t];e.destroy(!0)}this.pages=null}static install(t){Yr.install(t)}static uninstall(t){Yr.uninstall(t)}}});var Vl=hi(ca=>{"use strict";function LR(r,t,e){if(e===void 0&&(e=Array.prototype),r&&typeof e.find=="function")return e.find.call(r,t);for(var s=0;s<r.length;s++)if(Object.prototype.hasOwnProperty.call(r,s)){var i=r[s];if(t.call(void 0,i,s,r))return i}}function ov(r,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(r):r}function NR(r,t){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r}var fC=ov({HTML:"text/html",isHTML:function(r){return r===fC.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),pC=ov({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===pC.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ca.assign=NR;ca.find=LR;ca.freeze=ov;ca.MIME_TYPE=fC;ca.NAMESPACE=pC});var _v=hi(ws=>{"use strict";var TC=Vl(),jr=TC.find,zl=TC.NAMESPACE;function HR(r){return r!==""}function WR(r){return r?r.split(/[\t\n\f\r ]+/).filter(HR):[]}function VR(r,t){return r.hasOwnProperty(t)||(r[t]=!0),r}function mC(r){if(!r)return[];var t=WR(r);return Object.keys(t.reduce(VR,{}))}function zR(r){return function(t){return r&&r.indexOf(t)!==-1}}function $l(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function Ze(r,t){var e=r.prototype;if(!(e instanceof t)){let i=function(){};var s=i;i.prototype=t.prototype,i=new i,$l(e,i),r.prototype=e=i}e.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),e.constructor=r)}var Qe={},pr=Qe.ELEMENT_NODE=1,da=Qe.ATTRIBUTE_NODE=2,Hf=Qe.TEXT_NODE=3,SC=Qe.CDATA_SECTION_NODE=4,EC=Qe.ENTITY_REFERENCE_NODE=5,XR=Qe.ENTITY_NODE=6,av=Qe.PROCESSING_INSTRUCTION_NODE=7,uv=Qe.COMMENT_NODE=8,CC=Qe.DOCUMENT_NODE=9,AC=Qe.DOCUMENT_TYPE_NODE=10,Es=Qe.DOCUMENT_FRAGMENT_NODE=11,$R=Qe.NOTATION_NODE=12,Re={},me={},Hst=Re.INDEX_SIZE_ERR=(me[1]="Index size error",1),Wst=Re.DOMSTRING_SIZE_ERR=(me[2]="DOMString size error",2),Ke=Re.HIERARCHY_REQUEST_ERR=(me[3]="Hierarchy request error",3),Vst=Re.WRONG_DOCUMENT_ERR=(me[4]="Wrong document",4),YR=Re.INVALID_CHARACTER_ERR=(me[5]="Invalid character",5),zst=Re.NO_DATA_ALLOWED_ERR=(me[6]="No data allowed",6),Xst=Re.NO_MODIFICATION_ALLOWED_ERR=(me[7]="No modification allowed",7),wC=Re.NOT_FOUND_ERR=(me[8]="Not found",8),$st=Re.NOT_SUPPORTED_ERR=(me[9]="Not supported",9),gC=Re.INUSE_ATTRIBUTE_ERR=(me[10]="Attribute in use",10),ha=Re.INVALID_STATE_ERR=(me[11]="Invalid state",11),Yst=Re.SYNTAX_ERR=(me[12]="Syntax error",12),jst=Re.INVALID_MODIFICATION_ERR=(me[13]="Invalid modification",13),qst=Re.NAMESPACE_ERR=(me[14]="Invalid namespace",14),Kst=Re.INVALID_ACCESS_ERR=(me[15]="Invalid access",15);function Bt(r,t){if(t instanceof Error)var e=t;else e=this,Error.call(this,me[r]),this.message=me[r],Error.captureStackTrace&&Error.captureStackTrace(this,Bt);return e.code=r,t&&(this.message=this.message+": "+t),e}Bt.prototype=Error.prototype;$l(Re,Bt);function Cs(){}Cs.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,t,e){for(var s=!!e&&!!e.requireWellFormed,i=[],n=0;n<this.length;n++)xv(this[n],i,r,t,null,s);return i.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function fa(r,t){this._node=r,this._refresh=t,lv(this)}function lv(r){var t=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==t){var e=r._refresh(r._node);if(LC(r,"length",e.length),!r.$$length||e.length<r.$$length)for(var s=e.length;s in r;s++)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];$l(e,r),r._inc=t}}fa.prototype.item=function(r){return lv(this),this[r]||null};Ze(fa,Cs);function Wf(){}function PC(r,t){for(var e=r.length;e--;)if(r[e]===t)return e}function xC(r,t,e,s){if(s?t[PC(t,s)]=e:t[t.length++]=e,r){e.ownerElement=r;var i=r.ownerDocument;i&&(s&&MC(i,r,s),jR(i,r,e))}}function _C(r,t,e){var s=PC(t,e);if(s>=0){for(var i=t.length-1;s<i;)t[s]=t[++s];if(t.length=i,r){var n=r.ownerDocument;n&&(MC(n,r,e),e.ownerElement=null)}}else throw new Bt(wC,new Error(r.tagName+"@"+e))}Wf.prototype={length:0,item:Cs.prototype.item,getNamedItem:function(r){for(var t=this.length;t--;){var e=this[t];if(e.nodeName==r)return e}},setNamedItem:function(r){var t=r.ownerElement;if(t&&t!=this._ownerElement)throw new Bt(gC);var e=this.getNamedItem(r.nodeName);return xC(this._ownerElement,this,r,e),e},setNamedItemNS:function(r){var t=r.ownerElement,e;if(t&&t!=this._ownerElement)throw new Bt(gC);return e=this.getNamedItemNS(r.namespaceURI,r.localName),xC(this._ownerElement,this,r,e),e},removeNamedItem:function(r){var t=this.getNamedItem(r);return _C(this._ownerElement,this,t),t},removeNamedItemNS:function(r,t){var e=this.getNamedItemNS(r,t);return _C(this._ownerElement,this,e),e},getNamedItemNS:function(r,t){for(var e=this.length;e--;){var s=this[e];if(s.localName==t&&s.namespaceURI==r)return s}return null}};function BC(){}BC.prototype={hasFeature:function(r,t){return!0},createDocument:function(r,t,e){var s=new Yl;if(s.implementation=this,s.childNodes=new Cs,s.doctype=e||null,e&&s.appendChild(e),t){var i=s.createElementNS(r,t);s.appendChild(i)}return s},createDocumentType:function(r,t,e){var s=new $f;return s.name=r,s.nodeName=r,s.publicId=t||"",s.systemId=e||"",s}};function wt(){}wt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,t){return zf(this,r,t)},replaceChild:function(r,t){zf(this,r,t,FC),t&&this.removeChild(t)},removeChild:function(r){return DC(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return OC(this.ownerDocument||this,this,r)},normalize:function(){pe(this,null,{enter:function(r){for(var t=r.firstChild;t;){var e=t.nextSibling;e!==null&&e.nodeType===Hf&&t.nodeType===Hf?(r.removeChild(e),t.appendData(e.data)):t=e}return!0}})},isSupported:function(r,t){return this.ownerDocument.implementation.hasFeature(r,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var t=this;t;){var e=t._nsMap;if(e){for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===r)return s}t=t.nodeType==da?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(r){for(var t=this;t;){var e=t._nsMap;if(e&&Object.prototype.hasOwnProperty.call(e,r))return e[r];t=t.nodeType==da?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(r){var t=this.lookupPrefix(r);return t==null}};function RC(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}$l(Qe,wt);$l(Qe,wt.prototype);function Vf(r,t){return pe(r,null,{enter:function(e){return t(e)?pe.STOP:!0}})===pe.STOP}function pe(r,t,e){for(var s=[{node:r,context:t,phase:pe.ENTER}];s.length>0;){var i=s.pop();if(i.phase===pe.ENTER){var n=e.enter(i.node,i.context);if(n===pe.STOP)return pe.STOP;if(s.push({node:i.node,context:n,phase:pe.EXIT}),n==null)continue;for(var o=i.node.lastChild;o;)s.push({node:o,context:n,phase:pe.ENTER}),o=o.previousSibling}else e.exit&&e.exit(i.node,i.context)}}pe.STOP=Symbol("walkDOM.STOP");pe.ENTER=0;pe.EXIT=1;function Yl(){this.ownerDocument=this}function jR(r,t,e){r&&r._inc++;var s=e.namespaceURI;s===zl.XMLNS&&(t._nsMap[e.prefix?e.localName:""]=e.value)}function MC(r,t,e,s){r&&r._inc++;var i=e.namespaceURI;i===zl.XMLNS&&delete t._nsMap[e.prefix?e.localName:""]}function cv(r,t,e){if(r&&r._inc){r._inc++;var s=t.childNodes;if(e)s[s.length++]=e;else{for(var i=t.firstChild,n=0;i;)s[n++]=i,i=i.nextSibling;s.length=n,delete s[s.length]}}}function DC(r,t){var e=t.previousSibling,s=t.nextSibling;return e?e.nextSibling=s:r.firstChild=s,s?s.previousSibling=e:r.lastChild=e,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,cv(r.ownerDocument,r),t}function qR(r){return r&&(r.nodeType===wt.DOCUMENT_NODE||r.nodeType===wt.DOCUMENT_FRAGMENT_NODE||r.nodeType===wt.ELEMENT_NODE)}function KR(r){return r&&(qr(r)||hv(r)||As(r)||r.nodeType===wt.DOCUMENT_FRAGMENT_NODE||r.nodeType===wt.COMMENT_NODE||r.nodeType===wt.PROCESSING_INSTRUCTION_NODE)}function As(r){return r&&r.nodeType===wt.DOCUMENT_TYPE_NODE}function qr(r){return r&&r.nodeType===wt.ELEMENT_NODE}function hv(r){return r&&r.nodeType===wt.TEXT_NODE}function bC(r,t){var e=r.childNodes||[];if(jr(e,qr)||As(t))return!1;var s=jr(e,As);return!(t&&s&&e.indexOf(s)>e.indexOf(t))}function yC(r,t){var e=r.childNodes||[];function s(n){return qr(n)&&n!==t}if(jr(e,s))return!1;var i=jr(e,As);return!(t&&i&&e.indexOf(i)>e.indexOf(t))}function ZR(r,t,e){if(!qR(r))throw new Bt(Ke,"Unexpected parent node type "+r.nodeType);if(e&&e.parentNode!==r)throw new Bt(wC,"child not in parent");if(!KR(t)||As(t)&&r.nodeType!==wt.DOCUMENT_NODE)throw new Bt(Ke,"Unexpected node type "+t.nodeType+" for parent node type "+r.nodeType)}function QR(r,t,e){var s=r.childNodes||[],i=t.childNodes||[];if(t.nodeType===wt.DOCUMENT_FRAGMENT_NODE){var n=i.filter(qr);if(n.length>1||jr(i,hv))throw new Bt(Ke,"More than one element or text in fragment");if(n.length===1&&!bC(r,e))throw new Bt(Ke,"Element in fragment can not be inserted before doctype")}if(qr(t)&&!bC(r,e))throw new Bt(Ke,"Only one element can be added and only after doctype");if(As(t)){if(jr(s,As))throw new Bt(Ke,"Only one doctype is allowed");var o=jr(s,qr);if(e&&s.indexOf(o)<s.indexOf(e))throw new Bt(Ke,"Doctype can only be inserted before an element");if(!e&&o)throw new Bt(Ke,"Doctype can not be appended since element is present")}}function FC(r,t,e){var s=r.childNodes||[],i=t.childNodes||[];if(t.nodeType===wt.DOCUMENT_FRAGMENT_NODE){var n=i.filter(qr);if(n.length>1||jr(i,hv))throw new Bt(Ke,"More than one element or text in fragment");if(n.length===1&&!yC(r,e))throw new Bt(Ke,"Element in fragment can not be inserted before doctype")}if(qr(t)&&!yC(r,e))throw new Bt(Ke,"Only one element can be added and only after doctype");if(As(t)){let u=function(l){return As(l)&&l!==e};var a=u;if(jr(s,u))throw new Bt(Ke,"Only one doctype is allowed");var o=jr(s,qr);if(e&&s.indexOf(o)<s.indexOf(e))throw new Bt(Ke,"Doctype can only be inserted before an element")}}function zf(r,t,e,s){ZR(r,t,e),r.nodeType===wt.DOCUMENT_NODE&&(s||QR)(r,t,e);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===Es){var n=t.firstChild;if(n==null)return t;var o=t.lastChild}else n=o=t;var a=e?e.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=e,a?a.nextSibling=n:r.firstChild=n,e==null?r.lastChild=o:e.previousSibling=o;do{n.parentNode=r;var u=r.ownerDocument||r;Xl(n,u)}while(n!==o&&(n=n.nextSibling));return cv(r.ownerDocument||r,r),t.nodeType==Es&&(t.firstChild=t.lastChild=null),t}function Xl(r,t){if(r.ownerDocument!==t){if(r.ownerDocument=t,r.nodeType===pr&&r.attributes)for(var e=0;e<r.attributes.length;e++){var s=r.attributes.item(e);s&&(s.ownerDocument=t)}for(var i=r.firstChild;i;)Xl(i,t),i=i.nextSibling}}function JR(r,t){t.parentNode&&t.parentNode.removeChild(t),t.parentNode=r,t.previousSibling=r.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:r.firstChild=t,r.lastChild=t,cv(r.ownerDocument,r,t);var e=r.ownerDocument||r;return Xl(t,e),t}Yl.prototype={nodeName:"#document",nodeType:CC,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,t){if(r.nodeType==Es){for(var e=r.firstChild;e;){var s=e.nextSibling;this.insertBefore(e,t),e=s}return r}return zf(this,r,t),Xl(r,this),this.documentElement===null&&r.nodeType===pr&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),DC(this,r)},replaceChild:function(r,t){zf(this,r,t,FC),Xl(r,this),t&&this.removeChild(t),qr(r)&&(this.documentElement=r)},importNode:function(r,t){return tM(this,r,t)},getElementById:function(r){var t=null;return Vf(this.documentElement,function(e){if(e.nodeType==pr&&e.getAttribute("id")==r)return t=e,!0}),t},getElementsByClassName:function(r){var t=mC(r);return new fa(this,function(e){var s=[];return t.length>0&&Vf(e.documentElement,function(i){if(i!==e&&i.nodeType===pr){var n=i.getAttribute("class");if(n){var o=r===n;if(!o){var a=mC(n);o=t.every(zR(a))}o&&s.push(i)}}}),s})},createElement:function(r){var t=new dn;t.ownerDocument=this,t.nodeName=r,t.tagName=r,t.localName=r,t.childNodes=new Cs;var e=t.attributes=new Wf;return e._ownerElement=t,t},createDocumentFragment:function(){var r=new Yf;return r.ownerDocument=this,r.childNodes=new Cs,r},createTextNode:function(r){var t=new dv;return t.ownerDocument=this,t.appendData(r),t},createComment:function(r){var t=new fv;return t.ownerDocument=this,t.appendData(r),t},createCDATASection:function(r){if(r.indexOf("]]>")!==-1)throw new Bt(YR,'data contains "]]>"');var t=new pv;return t.ownerDocument=this,t.appendData(r),t},createProcessingInstruction:function(r,t){var e=new gv;return e.ownerDocument=this,e.tagName=e.nodeName=e.target=r,e.nodeValue=e.data=t,e},createAttribute:function(r){var t=new Xf;return t.ownerDocument=this,t.name=r,t.nodeName=r,t.localName=r,t.specified=!0,t},createEntityReference:function(r){var t=new mv;return t.ownerDocument=this,t.nodeName=r,t},createElementNS:function(r,t){var e=new dn,s=t.split(":"),i=e.attributes=new Wf;return e.childNodes=new Cs,e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.namespaceURI=r,s.length==2?(e.prefix=s[0],e.localName=s[1]):e.localName=t,i._ownerElement=e,e},createAttributeNS:function(r,t){var e=new Xf,s=t.split(":");return e.ownerDocument=this,e.nodeName=t,e.name=t,e.namespaceURI=r,e.specified=!0,s.length==2?(e.prefix=s[0],e.localName=s[1]):e.localName=t,e}};Ze(Yl,wt);function dn(){this._nsMap={}}dn.prototype={nodeType:pr,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var t=this.getAttributeNode(r);return t&&t.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,t){var e=this.ownerDocument.createAttribute(r);e.value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(r){var t=this.getAttributeNode(r);t&&this.removeAttributeNode(t)},appendChild:function(r){return r.nodeType===Es?this.insertBefore(r,null):JR(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,t){var e=this.getAttributeNodeNS(r,t);e&&this.removeAttributeNode(e)},hasAttributeNS:function(r,t){return this.getAttributeNodeNS(r,t)!=null},getAttributeNS:function(r,t){var e=this.getAttributeNodeNS(r,t);return e&&e.value||""},setAttributeNS:function(r,t,e){var s=this.ownerDocument.createAttributeNS(r,t);s.value=s.nodeValue=""+e,this.setAttributeNode(s)},getAttributeNodeNS:function(r,t){return this.attributes.getNamedItemNS(r,t)},getElementsByTagName:function(r){return new fa(this,function(t){var e=[];return Vf(t,function(s){s!==t&&s.nodeType==pr&&(r==="*"||s.tagName==r)&&e.push(s)}),e})},getElementsByTagNameNS:function(r,t){return new fa(this,function(e){var s=[];return Vf(e,function(i){i!==e&&i.nodeType===pr&&(r==="*"||i.namespaceURI===r)&&(t==="*"||i.localName==t)&&s.push(i)}),s})}};Yl.prototype.getElementsByTagName=dn.prototype.getElementsByTagName;Yl.prototype.getElementsByTagNameNS=dn.prototype.getElementsByTagNameNS;Ze(dn,wt);function Xf(){}Xf.prototype.nodeType=da;Ze(Xf,wt);function jl(){}jl.prototype={data:"",substringData:function(r,t){return this.data.substring(r,r+t)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,t){this.replaceData(r,0,t)},appendChild:function(r){throw new Error(me[Ke])},deleteData:function(r,t){this.replaceData(r,t,"")},replaceData:function(r,t,e){var s=this.data.substring(0,r),i=this.data.substring(r+t);e=s+e+i,this.nodeValue=this.data=e,this.length=e.length}};Ze(jl,wt);function dv(){}dv.prototype={nodeName:"#text",nodeType:Hf,splitText:function(r){var t=this.data,e=t.substring(r);t=t.substring(0,r),this.data=this.nodeValue=t,this.length=t.length;var s=this.ownerDocument.createTextNode(e);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Ze(dv,jl);function fv(){}fv.prototype={nodeName:"#comment",nodeType:uv};Ze(fv,jl);function pv(){}pv.prototype={nodeName:"#cdata-section",nodeType:SC};Ze(pv,jl);function $f(){}$f.prototype.nodeType=AC;Ze($f,wt);function GC(){}GC.prototype.nodeType=$R;Ze(GC,wt);function UC(){}UC.prototype.nodeType=XR;Ze(UC,wt);function mv(){}mv.prototype.nodeType=EC;Ze(mv,wt);function Yf(){}Yf.prototype.nodeName="#document-fragment";Yf.prototype.nodeType=Es;Ze(Yf,wt);function gv(){}gv.prototype.nodeType=av;Ze(gv,wt);function IC(){}IC.prototype.serializeToString=function(r,t,e,s){return kC.call(r,t,e,s)};wt.prototype.toString=kC;function kC(r,t,e){var s=!!e&&!!e.requireWellFormed,i=[],n=this.nodeType==9&&this.documentElement||this,o=n.prefix,a=n.namespaceURI;if(a&&o==null){var o=n.lookupPrefix(a);if(o==null)var u=[{namespace:a,prefix:null}]}return xv(this,i,r,t,u,s),i.join("")}function vC(r,t,e){var s=r.prefix||"",i=r.namespaceURI;if(!i||s==="xml"&&i===zl.XML||i===zl.XMLNS)return!1;for(var n=e.length;n--;){var o=e[n];if(o.prefix===s)return o.namespace!==i}return!0}function Nf(r,t,e){r.push(" ",t,'="',e.replace(/[<>&"\t\n\r]/g,RC),'"')}function xv(r,t,e,s,i,n){i||(i=[]),pe(r,{ns:i,isHTML:e},{enter:function(o,a){var u=a.ns,l=a.isHTML;if(s)if(o=s(o),o){if(typeof o=="string")return t.push(o),null}else return null;switch(o.nodeType){case pr:var c=o.attributes,h=c.length,d=o.tagName;l=zl.isHTML(o.namespaceURI)||l;var f=d;if(!l&&!o.prefix&&o.namespaceURI){for(var p,g=0;g<c.length;g++)if(c.item(g).name==="xmlns"){p=c.item(g).value;break}if(!p)for(var _=u.length-1;_>=0;_--){var b=u[_];if(b.prefix===""&&b.namespace===o.namespaceURI){p=b.namespace;break}}if(p!==o.namespaceURI)for(var _=u.length-1;_>=0;_--){var b=u[_];if(b.namespace===o.namespaceURI){b.prefix&&(f=b.prefix+":"+d);break}}}t.push("<",f);for(var y=u.slice(),v=0;v<h;v++){var T=c.item(v);T.prefix=="xmlns"?y.push({prefix:T.localName,namespace:T.value}):T.nodeName=="xmlns"&&y.push({prefix:"",namespace:T.value})}for(var v=0;v<h;v++){var T=c.item(v);if(vC(T,l,y)){var S=T.prefix||"",E=T.namespaceURI;Nf(t,S?"xmlns:"+S:"xmlns",E),y.push({prefix:S,namespace:E})}var w=s?s(T):T;w&&(typeof w=="string"?t.push(w):Nf(t,w.name,w.value))}if(d===f&&vC(o,l,y)){var M=o.prefix||"",E=o.namespaceURI;Nf(t,M?"xmlns:"+M:"xmlns",E),y.push({prefix:M,namespace:E})}var P=o.firstChild;if(P||l&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),l&&/^script$/i.test(d)){for(;P;)P.data?t.push(P.data):xv(P,t,l,s,y.slice(),n),P=P.nextSibling;return t.push("</",d,">"),null}return{ns:y,isHTML:l,tag:f}}else return t.push("/>"),null;case CC:case Es:return{ns:u.slice(),isHTML:l,tag:null};case da:return Nf(t,o.name,o.value),null;case Hf:return t.push(o.data.replace(/[<&>]/g,RC)),null;case SC:if(n&&o.data.indexOf("]]>")!==-1)throw new Bt(ha,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",o.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case uv:if(n&&o.data.indexOf("-->")!==-1)throw new Bt(ha,'The comment node data contains "-->"');return t.push("<!--",o.data,"-->"),null;case AC:if(n){if(o.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(o.publicId))throw new Bt(ha,"DocumentType publicId is not a valid PubidLiteral");if(o.systemId&&!/^("[^"]*"|'[^']*')$/.test(o.systemId))throw new Bt(ha,"DocumentType systemId is not a valid SystemLiteral");if(o.internalSubset&&o.internalSubset.indexOf("]>")!==-1)throw new Bt(ha,'DocumentType internalSubset contains "]>"')}var R=o.publicId,A=o.systemId;if(t.push("<!DOCTYPE ",o.name),R)t.push(" PUBLIC ",R),A&&A!="."&&t.push(" ",A),t.push(">");else if(A&&A!=".")t.push(" SYSTEM ",A,">");else{var G=o.internalSubset;G&&t.push(" [",G,"]"),t.push(">")}return null;case av:if(n&&o.data.indexOf("?>")!==-1)throw new Bt(ha,'The ProcessingInstruction data contains "?>"');return t.push("<?",o.target," ",o.data,"?>"),null;case EC:return t.push("&",o.nodeName,";"),null;default:return t.push("??",o.nodeName),null}},exit:function(o,a){a&&a.tag&&t.push("</",a.tag,">")}})}function tM(r,t,e){var s;return pe(t,null,{enter:function(i,n){var o=i.cloneNode(!1);o.ownerDocument=r,o.parentNode=null,n===null?s=o:n.appendChild(o);var a=i.nodeType===da||e;return a?o:null}}),s}function OC(r,t,e){var s;return pe(t,null,{enter:function(i,n){var o=new i.constructor;for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)){var u=i[a];typeof u!="object"&&u!=o[a]&&(o[a]=u)}i.childNodes&&(o.childNodes=new Cs),o.ownerDocument=r;var l=e;switch(o.nodeType){case pr:var c=i.attributes,h=o.attributes=new Wf,d=c.length;h._ownerElement=o;for(var f=0;f<d;f++)o.setAttributeNode(OC(r,c.item(f),!0));break;case da:l=!0}return n!==null?n.appendChild(o):s=o,l?o:null}}),s}function LC(r,t,e){r[t]=e}try{Object.defineProperty&&(Object.defineProperty(fa.prototype,"length",{get:function(){return lv(this),this.$$length}}),Object.defineProperty(wt.prototype,"textContent",{get:function(){if(this.nodeType===pr||this.nodeType===Es){var r=[];return pe(this,null,{enter:function(t){if(t.nodeType===pr||t.nodeType===Es)return!0;if(t.nodeType===av||t.nodeType===uv)return null;r.push(t.nodeValue)}}),r.join("")}return this.nodeValue},set:function(r){switch(this.nodeType){case pr:case Es:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}}}),LC=function(r,t,e){r["$$"+t]=e})}catch{}ws.DocumentType=$f;ws.DOMException=Bt;ws.DOMImplementation=BC;ws.Element=dn;ws.Node=wt;ws.NodeList=Cs;ws.walkDOM=pe;ws.XMLSerializer=IC});var HC=hi(ql=>{"use strict";var NC=Vl().freeze;ql.XML_ENTITIES=NC({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});ql.HTML_ENTITIES=NC({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
913
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});ql.entityMap=ql.HTML_ENTITIES});var qC=hi(yv=>{"use strict";var Jl=Vl().NAMESPACE,bv=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,WC=new RegExp("[\\-\\.0-9"+bv.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),VC=new RegExp("^"+bv.source+WC.source+"*(?::"+bv.source+WC.source+"*)?$"),Kl=0,ci=1,pa=2,Zl=3,ma=4,ga=5,Ql=6,jf=7;function xa(r,t){this.message=r,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,xa)}xa.prototype=new Error;xa.prototype.name=xa.name;function $C(){}$C.prototype={parse:function(r,t,e){var s=this.domBuilder;s.startDocument(),YC(t,t={}),eM(r,t,e,s,this.errorHandler),s.endDocument()}};function eM(r,t,e,s,i){function n(B){if(B>65535){B-=65536;var U=55296+(B>>10),z=56320+(B&1023);return String.fromCharCode(U,z)}else return String.fromCharCode(B)}function o(B){var U=B.slice(1,-1);return Object.hasOwnProperty.call(e,U)?e[U]:U.charAt(0)==="#"?n(parseInt(U.substr(1).replace("x","0x"))):(i.error("entity not found:"+B),B)}function a(B){if(B>g){var U=r.substring(g,B).replace(/&#?\w+;/g,o);d&&u(g),s.characters(U,0,B-g),g=B}}function u(B,U){for(;B>=c&&(U=h.exec(r));)l=U.index,c=l+U[0].length,d.lineNumber++;d.columnNumber=B-l+1}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=s.locator,f=[{currentNSMap:t}],p={},g=0;;){try{var _=r.indexOf("<",g);if(_<0){if(!r.substr(g).match(/^\s*$/)){var b=s.doc,y=b.createTextNode(r.substr(g));b.appendChild(y),s.currentElement=y}return}switch(_>g&&a(_),r.charAt(_+1)){case"/":var A=r.indexOf(">",_+3),v=r.substring(_+2,A).replace(/[ \t\n\r]+$/g,""),T=f.pop();A<0?(v=r.substring(_+2).replace(/[\s<].*/,""),i.error("end tag name: "+v+" is not complete:"+T.tagName),A=_+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),i.error("end tag name: "+v+" maybe not complete"),A=_+1+v.length);var S=T.localNSMap,E=T.tagName==v,w=E||T.tagName&&T.tagName.toLowerCase()==v.toLowerCase();if(w){if(s.endElement(T.uri,T.localName,v),S)for(var M in S)Object.prototype.hasOwnProperty.call(S,M)&&s.endPrefixMapping(M);E||i.fatalError("end tag name: "+v+" is not match the current start tagName:"+T.tagName)}else f.push(T);A++;break;case"?":d&&u(_),A=oM(r,_,s);break;case"!":d&&u(_),A=nM(r,_,s,i);break;default:d&&u(_);var P=new jC,R=f[f.length-1].currentNSMap,A=rM(r,_,P,R,o,i),G=P.length;if(!P.closed&&iM(r,A,P.tagName,p)&&(P.closed=!0,e.nbsp||i.warning("unclosed xml attribute")),d&&G){for(var H=zC(d,{}),W=0;W<G;W++){var $=P[W];u($.offset),$.locator=zC(d,{})}s.locator=H,XC(P,s,R)&&f.push(P),s.locator=d}else XC(P,s,R)&&f.push(P);Jl.isHTML(P.uri)&&!P.closed?A=sM(r,A,P.tagName,o,s):A++}}catch(B){if(B instanceof xa)throw B;i.error("element parse error: "+B),A=-1}A>g?g=A:a(Math.max(_,g)+1)}}function zC(r,t){return t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber,t}function rM(r,t,e,s,i,n){function o(f,p,g){e.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),e.addValue(f,p.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),g)}for(var a,u,l=++t,c=Kl;;){var h=r.charAt(l);switch(h){case"=":if(c===ci)a=r.slice(t,l),c=Zl;else if(c===pa)c=Zl;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===Zl||c===ci)if(c===ci&&(n.warning('attribute value must after "="'),a=r.slice(t,l)),t=l+1,l=r.indexOf(h,t),l>0)u=r.slice(t,l),o(a,u,t-1),c=ga;else throw new Error("attribute value no end '"+h+"' match");else if(c==ma)u=r.slice(t,l),o(a,u,t),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),t=l+1,c=ga;else throw new Error('attribute value must after "="');break;case"/":switch(c){case Kl:e.setTagName(r.slice(t,l));case ga:case Ql:case jf:c=jf,e.closed=!0;case ma:case ci:break;case pa:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),c==Kl&&e.setTagName(r.slice(t,l)),l;case">":switch(c){case Kl:e.setTagName(r.slice(t,l));case ga:case Ql:case jf:break;case ma:case ci:u=r.slice(t,l),u.slice(-1)==="/"&&(e.closed=!0,u=u.slice(0,-1));case pa:c===pa&&(u=a),c==ma?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,t)):((!Jl.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,t));break;case Zl:throw new Error("attribute value missed!!")}return l;case"\x80":h=" ";default:if(h<=" ")switch(c){case Kl:e.setTagName(r.slice(t,l)),c=Ql;break;case ci:a=r.slice(t,l),c=pa;break;case ma:var u=r.slice(t,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,t);case ga:c=Ql;break}else switch(c){case pa:var d=e.tagName;(!Jl.isHTML(s[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,t),t=l,c=ci;break;case ga:n.warning('attribute space is required"'+a+'"!!');case Ql:c=ci,t=l;break;case Zl:c=ma,t=l;break;case jf:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function XC(r,t,e){for(var s=r.tagName,i=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==!1&&(i==null&&(i={},YC(e,e={})),e[c]=i[c]=a,n.uri=Jl.XMLNS,t.startPrefixMapping(c,a))}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=Jl.XML),u!=="xmlns"&&(n.uri=e[u||""]))}var d=s.indexOf(":");d>0?(u=r.prefix=s.slice(0,d),l=r.localName=s.slice(d+1)):(u=null,l=r.localName=s);var f=r.uri=e[u||""];if(t.startElement(f,l,s,r),r.closed){if(t.endElement(f,l,s),i)for(u in i)Object.prototype.hasOwnProperty.call(i,u)&&t.endPrefixMapping(u)}else return r.currentNSMap=e,r.localNSMap=i,!0}function sM(r,t,e,s,i){if(/^(?:script|textarea)$/i.test(e)){var n=r.indexOf("</"+e+">",t),o=r.substring(t+1,n);if(/[&<]/.test(o))return/^script$/i.test(e)?(i.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,s),i.characters(o,0,o.length),n)}return t+1}function iM(r,t,e,s){var i=s[e];return i==null&&(i=r.lastIndexOf("</"+e+">"),i<t&&(i=r.lastIndexOf("</"+e)),s[e]=i),i<t}function YC(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function nM(r,t,e,s){var i=r.charAt(t+2);switch(i){case"-":if(r.charAt(t+3)==="-"){var n=r.indexOf("-->",t+4);return n>t?(e.comment(r,t+4,n-t-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(t+3,6)=="CDATA["){var n=r.indexOf("]]>",t+9);return e.startCDATA(),e.characters(r,t+9,n-t-9),e.endCDATA(),n+3}var o=aM(r,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return e.startDTD(u,l,c),e.endDTD(),h.index+h[0].length}}return-1}function oM(r,t,e){var s=r.indexOf("?>",t);if(s){var i=r.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(i){var n=i[0].length;return e.processingInstruction(i[1],i[2]),s+2}else return-1}return-1}function jC(){this.attributeNames={}}jC.prototype={setTagName:function(r){if(!VC.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,t,e){if(!VC.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:t,offset:e}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function aM(r,t){var e,s=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(r);e=i.exec(r);)if(s.push(e),e[1])return s}yv.XMLReader=$C;yv.ParseError=xa});var rA=hi(Kf=>{"use strict";var uM=Vl(),lM=_v(),KC=HC(),JC=qC(),cM=lM.DOMImplementation,ZC=uM.NAMESPACE,hM=JC.ParseError,dM=JC.XMLReader;function tA(r){return r.replace(/\r[\n\u0085]/g,`
|
|
912
|
+
`)b();else if(!S&&E){let R=E.xAdvance+(E.kerning?.[o]||0)+c;n.width+=R,n.spaceWidth=R,n.spacesIndex.push(n.charPositions.length),n.chars.push(T)}}else if(E){let P=E.kerning?.[o]||0,R=E.xAdvance+P+c;f&&y(u.width+R)&&(a||b(),_(u),b()),u.positions[u.index++]=u.width+P,u.chars.push(T),u.width+=R,Sf(T)&&(!a&&t.wordWrap&&y(n.width+u.width)&&b(),_(u))}o=T}return b(),t.align==="center"?EB(i):t.align==="right"?CB(i):t.align==="justify"&&AB(i),i}function EB(r){for(let t=0;t<r.lines.length;t++){let e=r.lines[t],s=r.width/2-e.width/2;for(let i=0;i<e.charPositions.length;i++)e.charPositions[i]+=s}}function CB(r){for(let t=0;t<r.lines.length;t++){let e=r.lines[t],s=r.width-e.width;for(let i=0;i<e.charPositions.length;i++)e.charPositions[i]+=s}}function AB(r){let t=r.width;for(let e=0;e<r.lines.length-2;e++){let s=r.lines[e],i=0,n=s.spacesIndex[i++],o=0,a=s.spacesIndex.length,l=(t-s.width)/a;for(let c=0;c<s.charPositions.length;c++)c===n&&(n=s.spacesIndex[i++],o+=l),s.charPositions[c]+=o}}var Pl=x(()=>{"use strict";na()});function C2(r){if(r==="")return[];typeof r=="string"&&(r=[r]);let t=[];for(let e=0,s=r.length;e<s;e++){let i=r[e];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=i[0].charCodeAt(0),o=i[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)t.push(String.fromCharCode(a))}else t.push(...Array.from(i))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}var A2=x(()=>{"use strict"});var Af,w2,Yr,oa=x(()=>{"use strict";g2();Tr();xt();pt();bs();fr();E2();Pl();A2();Af=0,w2=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=bf(1e3)}getFont(t,e){let s=`${e.fontFamily}-bitmap`,i=!0;if(at.has(s)){let o=at.get(s);return o.ensureCharacters?.(t),o}if(e._fill.fill&&!e._stroke?(s+=e._fill.fill.styleKey,i=!1):(e._stroke||e.dropShadow)&&(s=`${e.styleKey}-bitmap`,i=!1),s+=`-${e.fontStyle}`,s+=`-${e.fontVariant}`,s+=`-${e.fontWeight}`,!at.has(s)){let o=Object.create(e);o._lineHeight=0;let a=new Cf({style:o,overrideFill:i,overrideSize:!0,...this.defaultOptions});Af++,Af>50&&k("BitmapText",`You have dynamically created ${Af} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{Af--,at.remove(s)}),at.set(s,a)}let n=at.get(s);return n.ensureCharacters?.(t),n}getLayout(t,e,s=!0){let i=this.getFont(t,e),n=`${t}-${e.styleKey}-${s}`;if(this.measureCache.has(n))return this.measureCache.get(n);let o=At.graphemeSegmenter(t),a=fn(o,e,i,s);return this.measureCache.set(n,a),a}measureText(t,e,s=!0){return this.getLayout(t,e,s)}install(...t){let e=t[0];typeof e=="string"&&(e={name:e,style:t[1],chars:t[2]?.chars,resolution:t[2]?.resolution,padding:t[2]?.padding,skipKerning:t[2]?.skipKerning},I(V,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let s=e?.name;if(!s)throw new Error("[BitmapFontManager] Property `name` is required.");e={...this.defaultOptions,...e};let i=e.style,n=i instanceof Ot?i:new Ot(i),o=e.dynamicFill??this._canUseTintForStyle(n),a=new Cf({style:n,overrideFill:o,skipKerning:e.skipKerning,padding:e.padding,resolution:e.resolution,overrideSize:!1,textureStyle:e.textureStyle}),u=C2(e.chars);return a.ensureCharacters(u.join("")),at.set(`${s}-bitmap`,a),a.once("destroy",()=>at.remove(`${s}-bitmap`)),a}uninstall(t){let e=`${t}-bitmap`,s=at.get(e);s&&s.destroy()}_canUseTintForStyle(t){return!t._stroke&&(!t.dropShadow||t.dropShadow.color===0)&&!t._fill.fill&&t._fill.color===16777215}},Yr=new w2});var JE={};Ec(JE,{BitmapFont:()=>wf});var wf,P2=x(()=>{"use strict";Hs();jt();ht();_f();oa();wf=class extends un{constructor(t,e){super();let{textures:s,data:i}=t;Object.keys(i.pages).forEach(n=>{let o=i.pages[parseInt(n,10)],a=s[o.id];this.pages.push({texture:a})}),Object.keys(i.chars).forEach(n=>{let o=i.chars[n],{frame:a,source:u,rotate:l}=s[o.page],c=q.transformRectCoords(o,a,l,new J),h=new D({frame:c,orig:new J(0,0,o.width,o.height),source:u,rotate:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:h}}),this.baseRenderedFontSize=i.fontSize,this.baseMeasurementFontSize=i.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:i.fontSize},this.baseLineOffset=i.baseLineOffset,this.lineHeight=i.lineHeight,this.fontFamily=i.fontFamily,this.distanceField=i.distanceField??{type:"none",range:0},this.url=e}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){let{texture:e}=this.pages[t];e.destroy(!0)}this.pages=null}static install(t){Yr.install(t)}static uninstall(t){Yr.uninstall(t)}}});var da=fi(Es=>{"use strict";function NR(r,t,e){if(e===void 0&&(e=Array.prototype),r&&typeof e.find=="function")return e.find.call(r,t);for(var s=0;s<r.length;s++)if(Object.prototype.hasOwnProperty.call(r,s)){var i=r[s];if(t.call(void 0,i,s,r))return i}}function uv(r,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(r):r}function HR(r,t){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r}var mC=uv({HTML:"text/html",isHTML:function(r){return r===mC.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),gC=uv({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===gC.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),Nf=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,av=new RegExp("[\\-\\.0-9"+Nf.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),WR=new RegExp("^"+Nf.source+av.source+"*(?::"+Nf.source+av.source+"*)?$");Es.assign=HR;Es.find=NR;Es.freeze=uv;Es.MIME_TYPE=mC;Es.NAMESPACE=gC;Es.nameStartChar=Nf;Es.nameChar=av;Es.tagNamePattern=WR});var vv=fi(Ps=>{"use strict";var lv=da(),jr=lv.find,zl=lv.NAMESPACE,EC=lv.tagNamePattern;function VR(r){return r!==""}function zR(r){return r?r.split(/[\t\n\f\r ]+/).filter(VR):[]}function XR(r,t){return r.hasOwnProperty(t)||(r[t]=!0),r}function xC(r){if(!r)return[];var t=zR(r);return Object.keys(t.reduce(XR,{}))}function $R(r){return function(t){return r&&r.indexOf(t)!==-1}}function $l(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function Ze(r,t){var e=r.prototype;if(!(e instanceof t)){let i=function(){};var s=i;i.prototype=t.prototype,i=new i,$l(e,i),r.prototype=e=i}e.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),e.constructor=r)}var Qe={},pr=Qe.ELEMENT_NODE=1,fa=Qe.ATTRIBUTE_NODE=2,Wf=Qe.TEXT_NODE=3,CC=Qe.CDATA_SECTION_NODE=4,AC=Qe.ENTITY_REFERENCE_NODE=5,YR=Qe.ENTITY_NODE=6,cv=Qe.PROCESSING_INSTRUCTION_NODE=7,hv=Qe.COMMENT_NODE=8,wC=Qe.DOCUMENT_NODE=9,PC=Qe.DOCUMENT_TYPE_NODE=10,Cs=Qe.DOCUMENT_FRAGMENT_NODE=11,jR=Qe.NOTATION_NODE=12,Re={},me={},Vst=Re.INDEX_SIZE_ERR=(me[1]="Index size error",1),zst=Re.DOMSTRING_SIZE_ERR=(me[2]="DOMString size error",2),Ke=Re.HIERARCHY_REQUEST_ERR=(me[3]="Hierarchy request error",3),Xst=Re.WRONG_DOCUMENT_ERR=(me[4]="Wrong document",4),qR=Re.INVALID_CHARACTER_ERR=(me[5]="Invalid character",5),$st=Re.NO_DATA_ALLOWED_ERR=(me[6]="No data allowed",6),Yst=Re.NO_MODIFICATION_ALLOWED_ERR=(me[7]="No modification allowed",7),BC=Re.NOT_FOUND_ERR=(me[8]="Not found",8),jst=Re.NOT_SUPPORTED_ERR=(me[9]="Not supported",9),_C=Re.INUSE_ATTRIBUTE_ERR=(me[10]="Attribute in use",10),hi=Re.INVALID_STATE_ERR=(me[11]="Invalid state",11),qst=Re.SYNTAX_ERR=(me[12]="Syntax error",12),Kst=Re.INVALID_MODIFICATION_ERR=(me[13]="Invalid modification",13),Zst=Re.NAMESPACE_ERR=(me[14]="Invalid namespace",14),Qst=Re.INVALID_ACCESS_ERR=(me[15]="Invalid access",15);function wt(r,t){if(t instanceof Error)var e=t;else e=this,Error.call(this,me[r]),this.message=me[r],Error.captureStackTrace&&Error.captureStackTrace(this,wt);return e.code=r,t&&(this.message=this.message+": "+t),e}wt.prototype=Error.prototype;$l(Re,wt);function As(){}As.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,t,e){for(var s=!!e&&!!e.requireWellFormed,i=[],n=0;n<this.length;n++)yv(this[n],i,r,t,null,s);return i.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function pa(r,t){this._node=r,this._refresh=t,dv(this)}function dv(r){var t=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==t){var e=r._refresh(r._node);if(HC(r,"length",e.length),!r.$$length||e.length<r.$$length)for(var s=e.length;s in r;s++)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];$l(e,r),r._inc=t}}pa.prototype.item=function(r){return dv(this),this[r]||null};Ze(pa,As);function Vf(){}function RC(r,t){for(var e=r.length;e--;)if(r[e]===t)return e}function bC(r,t,e,s){if(s?t[RC(t,s)]=e:t[t.length++]=e,r){e.ownerElement=r;var i=r.ownerDocument;i&&(s&&FC(i,r,s),KR(i,r,e))}}function yC(r,t,e){var s=RC(t,e);if(s>=0){for(var i=t.length-1;s<i;)t[s]=t[++s];if(t.length=i,r){var n=r.ownerDocument;n&&(FC(n,r,e),e.ownerElement=null)}}else throw new wt(BC,new Error(r.tagName+"@"+e))}Vf.prototype={length:0,item:As.prototype.item,getNamedItem:function(r){for(var t=this.length;t--;){var e=this[t];if(e.nodeName==r)return e}},setNamedItem:function(r){var t=r.ownerElement;if(t&&t!=this._ownerElement)throw new wt(_C);var e=this.getNamedItem(r.nodeName);return bC(this._ownerElement,this,r,e),e},setNamedItemNS:function(r){var t=r.ownerElement,e;if(t&&t!=this._ownerElement)throw new wt(_C);return e=this.getNamedItemNS(r.namespaceURI,r.localName),bC(this._ownerElement,this,r,e),e},removeNamedItem:function(r){var t=this.getNamedItem(r);return yC(this._ownerElement,this,t),t},removeNamedItemNS:function(r,t){var e=this.getNamedItemNS(r,t);return yC(this._ownerElement,this,e),e},getNamedItemNS:function(r,t){for(var e=this.length;e--;){var s=this[e];if(s.localName==t&&s.namespaceURI==r)return s}return null}};function MC(){}MC.prototype={hasFeature:function(r,t){return!0},createDocument:function(r,t,e){var s=new Yl;if(s.implementation=this,s.childNodes=new As,s.doctype=e||null,e&&s.appendChild(e),t){var i=s.createElementNS(r,t);s.appendChild(i)}return s},createDocumentType:function(r,t,e){var s=new Yf;return s.name=r,s.nodeName=r,s.publicId=t||"",s.systemId=e||"",s}};function Pt(){}Pt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,t){return Xf(this,r,t)},replaceChild:function(r,t){Xf(this,r,t,UC),t&&this.removeChild(t)},removeChild:function(r){return GC(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return NC(this.ownerDocument||this,this,r)},normalize:function(){pe(this,null,{enter:function(r){for(var t=r.firstChild;t;){var e=t.nextSibling;e!==null&&e.nodeType===Wf&&t.nodeType===Wf?(r.removeChild(e),t.appendData(e.data)):t=e}return!0}})},isSupported:function(r,t){return this.ownerDocument.implementation.hasFeature(r,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var t=this;t;){var e=t._nsMap;if(e){for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===r)return s}t=t.nodeType==fa?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(r){for(var t=this;t;){var e=t._nsMap;if(e&&Object.prototype.hasOwnProperty.call(e,r))return e[r];t=t.nodeType==fa?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(r){var t=this.lookupPrefix(r);return t==null}};function DC(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}$l(Qe,Pt);$l(Qe,Pt.prototype);function zf(r,t){return pe(r,null,{enter:function(e){return t(e)?pe.STOP:!0}})===pe.STOP}function pe(r,t,e){for(var s=[{node:r,context:t,phase:pe.ENTER}];s.length>0;){var i=s.pop();if(i.phase===pe.ENTER){var n=e.enter(i.node,i.context);if(n===pe.STOP)return pe.STOP;if(s.push({node:i.node,context:n,phase:pe.EXIT}),n==null)continue;for(var o=i.node.lastChild;o;)s.push({node:o,context:n,phase:pe.ENTER}),o=o.previousSibling}else e.exit&&e.exit(i.node,i.context)}}pe.STOP=Symbol("walkDOM.STOP");pe.ENTER=0;pe.EXIT=1;function Yl(){this.ownerDocument=this}function KR(r,t,e){r&&r._inc++;var s=e.namespaceURI;s===zl.XMLNS&&(t._nsMap[e.prefix?e.localName:""]=e.value)}function FC(r,t,e,s){r&&r._inc++;var i=e.namespaceURI;i===zl.XMLNS&&delete t._nsMap[e.prefix?e.localName:""]}function fv(r,t,e){if(r&&r._inc){r._inc++;var s=t.childNodes;if(e)s[s.length++]=e;else{for(var i=t.firstChild,n=0;i;)s[n++]=i,i=i.nextSibling;s.length=n,delete s[s.length]}}}function GC(r,t){var e=t.previousSibling,s=t.nextSibling;return e?e.nextSibling=s:r.firstChild=s,s?s.previousSibling=e:r.lastChild=e,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,fv(r.ownerDocument,r),t}function ZR(r){return r&&(r.nodeType===Pt.DOCUMENT_NODE||r.nodeType===Pt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Pt.ELEMENT_NODE)}function QR(r){return r&&(qr(r)||pv(r)||ws(r)||r.nodeType===Pt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Pt.COMMENT_NODE||r.nodeType===Pt.PROCESSING_INSTRUCTION_NODE)}function ws(r){return r&&r.nodeType===Pt.DOCUMENT_TYPE_NODE}function qr(r){return r&&r.nodeType===Pt.ELEMENT_NODE}function pv(r){return r&&r.nodeType===Pt.TEXT_NODE}function vC(r,t){var e=r.childNodes||[];if(jr(e,qr)||ws(t))return!1;var s=jr(e,ws);return!(t&&s&&e.indexOf(s)>e.indexOf(t))}function TC(r,t){var e=r.childNodes||[];function s(n){return qr(n)&&n!==t}if(jr(e,s))return!1;var i=jr(e,ws);return!(t&&i&&e.indexOf(i)>e.indexOf(t))}function JR(r,t,e){if(!ZR(r))throw new wt(Ke,"Unexpected parent node type "+r.nodeType);if(e&&e.parentNode!==r)throw new wt(BC,"child not in parent");if(!QR(t)||ws(t)&&r.nodeType!==Pt.DOCUMENT_NODE)throw new wt(Ke,"Unexpected node type "+t.nodeType+" for parent node type "+r.nodeType)}function tM(r,t,e){var s=r.childNodes||[],i=t.childNodes||[];if(t.nodeType===Pt.DOCUMENT_FRAGMENT_NODE){var n=i.filter(qr);if(n.length>1||jr(i,pv))throw new wt(Ke,"More than one element or text in fragment");if(n.length===1&&!vC(r,e))throw new wt(Ke,"Element in fragment can not be inserted before doctype")}if(qr(t)&&!vC(r,e))throw new wt(Ke,"Only one element can be added and only after doctype");if(ws(t)){if(jr(s,ws))throw new wt(Ke,"Only one doctype is allowed");var o=jr(s,qr);if(e&&s.indexOf(o)<s.indexOf(e))throw new wt(Ke,"Doctype can only be inserted before an element");if(!e&&o)throw new wt(Ke,"Doctype can not be appended since element is present")}}function UC(r,t,e){var s=r.childNodes||[],i=t.childNodes||[];if(t.nodeType===Pt.DOCUMENT_FRAGMENT_NODE){var n=i.filter(qr);if(n.length>1||jr(i,pv))throw new wt(Ke,"More than one element or text in fragment");if(n.length===1&&!TC(r,e))throw new wt(Ke,"Element in fragment can not be inserted before doctype")}if(qr(t)&&!TC(r,e))throw new wt(Ke,"Only one element can be added and only after doctype");if(ws(t)){let u=function(l){return ws(l)&&l!==e};var a=u;if(jr(s,u))throw new wt(Ke,"Only one doctype is allowed");var o=jr(s,qr);if(e&&s.indexOf(o)<s.indexOf(e))throw new wt(Ke,"Doctype can only be inserted before an element")}}function Xf(r,t,e,s){JR(r,t,e),r.nodeType===Pt.DOCUMENT_NODE&&(s||tM)(r,t,e);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===Cs){var n=t.firstChild;if(n==null)return t;var o=t.lastChild}else n=o=t;var a=e?e.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=e,a?a.nextSibling=n:r.firstChild=n,e==null?r.lastChild=o:e.previousSibling=o;do{n.parentNode=r;var u=r.ownerDocument||r;Xl(n,u)}while(n!==o&&(n=n.nextSibling));return fv(r.ownerDocument||r,r),t.nodeType==Cs&&(t.firstChild=t.lastChild=null),t}function Xl(r,t){if(r.ownerDocument!==t){if(r.ownerDocument=t,r.nodeType===pr&&r.attributes)for(var e=0;e<r.attributes.length;e++){var s=r.attributes.item(e);s&&(s.ownerDocument=t)}for(var i=r.firstChild;i;)Xl(i,t),i=i.nextSibling}}function eM(r,t){t.parentNode&&t.parentNode.removeChild(t),t.parentNode=r,t.previousSibling=r.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:r.firstChild=t,r.lastChild=t,fv(r.ownerDocument,r,t);var e=r.ownerDocument||r;return Xl(t,e),t}Yl.prototype={nodeName:"#document",nodeType:wC,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,t){if(r.nodeType==Cs){for(var e=r.firstChild;e;){var s=e.nextSibling;this.insertBefore(e,t),e=s}return r}return Xf(this,r,t),Xl(r,this),this.documentElement===null&&r.nodeType===pr&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),GC(this,r)},replaceChild:function(r,t){Xf(this,r,t,UC),Xl(r,this),t&&this.removeChild(t),qr(r)&&(this.documentElement=r)},importNode:function(r,t){return rM(this,r,t)},getElementById:function(r){var t=null;return zf(this.documentElement,function(e){if(e.nodeType==pr&&e.getAttribute("id")==r)return t=e,!0}),t},getElementsByClassName:function(r){var t=xC(r);return new pa(this,function(e){var s=[];return t.length>0&&zf(e.documentElement,function(i){if(i!==e&&i.nodeType===pr){var n=i.getAttribute("class");if(n){var o=r===n;if(!o){var a=xC(n);o=t.every($R(a))}o&&s.push(i)}}}),s})},createElement:function(r){var t=new pn;t.ownerDocument=this,t.nodeName=r,t.tagName=r,t.localName=r,t.childNodes=new As;var e=t.attributes=new Vf;return e._ownerElement=t,t},createDocumentFragment:function(){var r=new jf;return r.ownerDocument=this,r.childNodes=new As,r},createTextNode:function(r){var t=new mv;return t.ownerDocument=this,t.appendData(r),t},createComment:function(r){var t=new gv;return t.ownerDocument=this,t.appendData(r),t},createCDATASection:function(r){if(r.indexOf("]]>")!==-1)throw new wt(qR,'data contains "]]>"');var t=new xv;return t.ownerDocument=this,t.appendData(r),t},createProcessingInstruction:function(r,t){var e=new bv;return e.ownerDocument=this,e.tagName=e.nodeName=e.target=r,e.nodeValue=e.data=t,e},createAttribute:function(r){var t=new $f;return t.ownerDocument=this,t.name=r,t.nodeName=r,t.localName=r,t.specified=!0,t},createEntityReference:function(r){var t=new _v;return t.ownerDocument=this,t.nodeName=r,t},createElementNS:function(r,t){var e=new pn,s=t.split(":"),i=e.attributes=new Vf;return e.childNodes=new As,e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.namespaceURI=r,s.length==2?(e.prefix=s[0],e.localName=s[1]):e.localName=t,i._ownerElement=e,e},createAttributeNS:function(r,t){var e=new $f,s=t.split(":");return e.ownerDocument=this,e.nodeName=t,e.name=t,e.namespaceURI=r,e.specified=!0,s.length==2?(e.prefix=s[0],e.localName=s[1]):e.localName=t,e}};Ze(Yl,Pt);function pn(){this._nsMap={}}pn.prototype={nodeType:pr,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var t=this.getAttributeNode(r);return t&&t.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,t){var e=this.ownerDocument.createAttribute(r);e.value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(r){var t=this.getAttributeNode(r);t&&this.removeAttributeNode(t)},appendChild:function(r){return r.nodeType===Cs?this.insertBefore(r,null):eM(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,t){var e=this.getAttributeNodeNS(r,t);e&&this.removeAttributeNode(e)},hasAttributeNS:function(r,t){return this.getAttributeNodeNS(r,t)!=null},getAttributeNS:function(r,t){var e=this.getAttributeNodeNS(r,t);return e&&e.value||""},setAttributeNS:function(r,t,e){var s=this.ownerDocument.createAttributeNS(r,t);s.value=s.nodeValue=""+e,this.setAttributeNode(s)},getAttributeNodeNS:function(r,t){return this.attributes.getNamedItemNS(r,t)},getElementsByTagName:function(r){return new pa(this,function(t){var e=[];return zf(t,function(s){s!==t&&s.nodeType==pr&&(r==="*"||s.tagName==r)&&e.push(s)}),e})},getElementsByTagNameNS:function(r,t){return new pa(this,function(e){var s=[];return zf(e,function(i){i!==e&&i.nodeType===pr&&(r==="*"||i.namespaceURI===r)&&(t==="*"||i.localName==t)&&s.push(i)}),s})}};Yl.prototype.getElementsByTagName=pn.prototype.getElementsByTagName;Yl.prototype.getElementsByTagNameNS=pn.prototype.getElementsByTagNameNS;Ze(pn,Pt);function $f(){}$f.prototype.nodeType=fa;Ze($f,Pt);function jl(){}jl.prototype={data:"",substringData:function(r,t){return this.data.substring(r,r+t)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,t){this.replaceData(r,0,t)},appendChild:function(r){throw new Error(me[Ke])},deleteData:function(r,t){this.replaceData(r,t,"")},replaceData:function(r,t,e){var s=this.data.substring(0,r),i=this.data.substring(r+t);e=s+e+i,this.nodeValue=this.data=e,this.length=e.length}};Ze(jl,Pt);function mv(){}mv.prototype={nodeName:"#text",nodeType:Wf,splitText:function(r){var t=this.data,e=t.substring(r);t=t.substring(0,r),this.data=this.nodeValue=t,this.length=t.length;var s=this.ownerDocument.createTextNode(e);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Ze(mv,jl);function gv(){}gv.prototype={nodeName:"#comment",nodeType:hv};Ze(gv,jl);function xv(){}xv.prototype={nodeName:"#cdata-section",nodeType:CC};Ze(xv,jl);function Yf(){}Yf.prototype.nodeType=PC;Ze(Yf,Pt);function IC(){}IC.prototype.nodeType=jR;Ze(IC,Pt);function kC(){}kC.prototype.nodeType=YR;Ze(kC,Pt);function _v(){}_v.prototype.nodeType=AC;Ze(_v,Pt);function jf(){}jf.prototype.nodeName="#document-fragment";jf.prototype.nodeType=Cs;Ze(jf,Pt);function bv(){}bv.prototype.nodeType=cv;Ze(bv,Pt);function OC(){}OC.prototype.serializeToString=function(r,t,e,s){return LC.call(r,t,e,s)};Pt.prototype.toString=LC;function LC(r,t,e){var s=!!e&&!!e.requireWellFormed,i=[],n=this.nodeType==9&&this.documentElement||this,o=n.prefix,a=n.namespaceURI;if(a&&o==null){var o=n.lookupPrefix(a);if(o==null)var u=[{namespace:a,prefix:null}]}return yv(this,i,r,t,u,s),i.join("")}function SC(r,t,e){var s=r.prefix||"",i=r.namespaceURI;if(!i||s==="xml"&&i===zl.XML||i===zl.XMLNS)return!1;for(var n=e.length;n--;){var o=e[n];if(o.prefix===s)return o.namespace!==i}return!0}function Hf(r,t,e,s){if(s&&!EC.test(t))throw new wt(hi,'The attribute name "'+t+'" is not a valid XML QName');r.push(" ",t,'="',e.replace(/[<>&"\t\n\r]/g,DC),'"')}function yv(r,t,e,s,i,n){i||(i=[]),pe(r,{ns:i,isHTML:e},{enter:function(o,a){var u=a.ns,l=a.isHTML;if(s)if(o=s(o),o){if(typeof o=="string")return t.push(o),null}else return null;switch(o.nodeType){case pr:var c=o.attributes,h=c.length,d=o.tagName;l=zl.isHTML(o.namespaceURI)||l;var f=d;if(!l&&!o.prefix&&o.namespaceURI){for(var p,g=0;g<c.length;g++)if(c.item(g).name==="xmlns"){p=c.item(g).value;break}if(!p)for(var _=u.length-1;_>=0;_--){var b=u[_];if(b.prefix===""&&b.namespace===o.namespaceURI){p=b.namespace;break}}if(p!==o.namespaceURI)for(var _=u.length-1;_>=0;_--){var b=u[_];if(b.namespace===o.namespaceURI){b.prefix&&(f=b.prefix+":"+d);break}}}if(n&&!EC.test(f))throw new wt(hi,'The element name "'+f+'" is not a valid XML QName');t.push("<",f);for(var y=u.slice(),v=0;v<h;v++){var T=c.item(v);T.prefix=="xmlns"?y.push({prefix:T.localName,namespace:T.value}):T.nodeName=="xmlns"&&y.push({prefix:"",namespace:T.value})}for(var v=0;v<h;v++){var T=c.item(v);if(SC(T,l,y)){var S=T.prefix||"",E=T.namespaceURI;Hf(t,S?"xmlns:"+S:"xmlns",E,n),y.push({prefix:S,namespace:E})}var w=s?s(T):T;w&&(typeof w=="string"?t.push(w):Hf(t,w.name,w.value,n))}if(d===f&&SC(o,l,y)){var M=o.prefix||"",E=o.namespaceURI;Hf(t,M?"xmlns:"+M:"xmlns",E,n),y.push({prefix:M,namespace:E})}var P=o.firstChild;if(P||l&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),l&&/^script$/i.test(d)){for(;P;)P.data?t.push(P.data):yv(P,t,l,s,y.slice(),n),P=P.nextSibling;return t.push("</",d,">"),null}return{ns:y,isHTML:l,tag:f}}else return t.push("/>"),null;case wC:case Cs:return{ns:u.slice(),isHTML:l,tag:null};case fa:return Hf(t,o.name,o.value,n),null;case Wf:return t.push(o.data.replace(/[<&>]/g,DC)),null;case CC:if(n&&o.data.indexOf("]]>")!==-1)throw new wt(hi,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",o.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case hv:if(n&&o.data.indexOf("-->")!==-1)throw new wt(hi,'The comment node data contains "-->"');return t.push("<!--",o.data,"-->"),null;case PC:if(n){if(o.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(o.publicId))throw new wt(hi,"DocumentType publicId is not a valid PubidLiteral");if(o.systemId&&!/^("[^"]*"|'[^']*')$/.test(o.systemId))throw new wt(hi,"DocumentType systemId is not a valid SystemLiteral");if(o.internalSubset&&o.internalSubset.indexOf("]>")!==-1)throw new wt(hi,'DocumentType internalSubset contains "]>"')}var R=o.publicId,A=o.systemId;if(t.push("<!DOCTYPE ",o.name),R)t.push(" PUBLIC ",R),A&&A!="."&&t.push(" ",A),t.push(">");else if(A&&A!=".")t.push(" SYSTEM ",A,">");else{var G=o.internalSubset;G&&t.push(" [",G,"]"),t.push(">")}return null;case cv:if(n&&o.data.indexOf("?>")!==-1)throw new wt(hi,'The ProcessingInstruction data contains "?>"');return t.push("<?",o.target," ",o.data,"?>"),null;case AC:return t.push("&",o.nodeName,";"),null;default:return t.push("??",o.nodeName),null}},exit:function(o,a){a&&a.tag&&t.push("</",a.tag,">")}})}function rM(r,t,e){var s;return pe(t,null,{enter:function(i,n){var o=i.cloneNode(!1);o.ownerDocument=r,o.parentNode=null,n===null?s=o:n.appendChild(o);var a=i.nodeType===fa||e;return a?o:null}}),s}function NC(r,t,e){var s;return pe(t,null,{enter:function(i,n){var o=new i.constructor;for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)){var u=i[a];typeof u!="object"&&u!=o[a]&&(o[a]=u)}i.childNodes&&(o.childNodes=new As),o.ownerDocument=r;var l=e;switch(o.nodeType){case pr:var c=i.attributes,h=o.attributes=new Vf,d=c.length;h._ownerElement=o;for(var f=0;f<d;f++)o.setAttributeNode(NC(r,c.item(f),!0));break;case fa:l=!0}return n!==null?n.appendChild(o):s=o,l?o:null}}),s}function HC(r,t,e){r[t]=e}try{Object.defineProperty&&(Object.defineProperty(pa.prototype,"length",{get:function(){return dv(this),this.$$length}}),Object.defineProperty(Pt.prototype,"textContent",{get:function(){if(this.nodeType===pr||this.nodeType===Cs){var r=[];return pe(this,null,{enter:function(t){if(t.nodeType===pr||t.nodeType===Cs)return!0;if(t.nodeType===cv||t.nodeType===hv)return null;r.push(t.nodeValue)}}),r.join("")}return this.nodeValue},set:function(r){switch(this.nodeType){case pr:case Cs:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}}}),HC=function(r,t,e){r["$$"+t]=e})}catch{}Ps.DocumentType=Yf;Ps.DOMException=wt;Ps.DOMImplementation=MC;Ps.Element=pn;Ps.Node=Pt;Ps.NodeList=As;Ps.walkDOM=pe;Ps.XMLSerializer=OC});var VC=fi(ql=>{"use strict";var WC=da().freeze;ql.XML_ENTITIES=WC({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});ql.HTML_ENTITIES=WC({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
913
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});ql.entityMap=ql.HTML_ENTITIES});var KC=fi(Tv=>{"use strict";var Jl=da().NAMESPACE,zC=da().tagNamePattern,Kl=0,di=1,ma=2,Zl=3,ga=4,xa=5,Ql=6,qf=7;function _a(r,t){this.message=r,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,_a)}_a.prototype=new Error;_a.prototype.name=_a.name;function YC(){}YC.prototype={parse:function(r,t,e){var s=this.domBuilder;s.startDocument(),jC(t,t={}),sM(r,t,e,s,this.errorHandler),s.endDocument()}};function sM(r,t,e,s,i){function n(B){if(B>65535){B-=65536;var U=55296+(B>>10),z=56320+(B&1023);return String.fromCharCode(U,z)}else return String.fromCharCode(B)}function o(B){var U=B.slice(1,-1);return Object.hasOwnProperty.call(e,U)?e[U]:U.charAt(0)==="#"?n(parseInt(U.substr(1).replace("x","0x"))):(i.error("entity not found:"+B),B)}function a(B){if(B>g){var U=r.substring(g,B).replace(/&#?\w+;/g,o);d&&u(g),s.characters(U,0,B-g),g=B}}function u(B,U){for(;B>=c&&(U=h.exec(r));)l=U.index,c=l+U[0].length,d.lineNumber++;d.columnNumber=B-l+1}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=s.locator,f=[{currentNSMap:t}],p={},g=0;;){try{var _=r.indexOf("<",g);if(_<0){if(!r.substr(g).match(/^\s*$/)){var b=s.doc,y=b.createTextNode(r.substr(g));b.appendChild(y),s.currentElement=y}return}switch(_>g&&a(_),r.charAt(_+1)){case"/":var A=r.indexOf(">",_+3),v=r.substring(_+2,A).replace(/[ \t\n\r]+$/g,""),T=f.pop();A<0?(v=r.substring(_+2).replace(/[\s<].*/,""),i.error("end tag name: "+v+" is not complete:"+T.tagName),A=_+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),i.error("end tag name: "+v+" maybe not complete"),A=_+1+v.length);var S=T.localNSMap,E=T.tagName==v,w=E||T.tagName&&T.tagName.toLowerCase()==v.toLowerCase();if(w){if(s.endElement(T.uri,T.localName,v),S)for(var M in S)Object.prototype.hasOwnProperty.call(S,M)&&s.endPrefixMapping(M);E||i.fatalError("end tag name: "+v+" is not match the current start tagName:"+T.tagName)}else f.push(T);A++;break;case"?":d&&u(_),A=uM(r,_,s);break;case"!":d&&u(_),A=aM(r,_,s,i);break;default:d&&u(_);var P=new qC,R=f[f.length-1].currentNSMap,A=iM(r,_,P,R,o,i),G=P.length;if(!P.closed&&oM(r,A,P.tagName,p)&&(P.closed=!0,e.nbsp||i.warning("unclosed xml attribute")),d&&G){for(var H=XC(d,{}),W=0;W<G;W++){var $=P[W];u($.offset),$.locator=XC(d,{})}s.locator=H,$C(P,s,R)&&f.push(P),s.locator=d}else $C(P,s,R)&&f.push(P);Jl.isHTML(P.uri)&&!P.closed?A=nM(r,A,P.tagName,o,s):A++}}catch(B){if(B instanceof _a)throw B;i.error("element parse error: "+B),A=-1}A>g?g=A:a(Math.max(_,g)+1)}}function XC(r,t){return t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber,t}function iM(r,t,e,s,i,n){function o(f,p,g){e.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),e.addValue(f,p.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),g)}for(var a,u,l=++t,c=Kl;;){var h=r.charAt(l);switch(h){case"=":if(c===di)a=r.slice(t,l),c=Zl;else if(c===ma)c=Zl;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===Zl||c===di)if(c===di&&(n.warning('attribute value must after "="'),a=r.slice(t,l)),t=l+1,l=r.indexOf(h,t),l>0)u=r.slice(t,l),o(a,u,t-1),c=xa;else throw new Error("attribute value no end '"+h+"' match");else if(c==ga)u=r.slice(t,l),o(a,u,t),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),t=l+1,c=xa;else throw new Error('attribute value must after "="');break;case"/":switch(c){case Kl:e.setTagName(r.slice(t,l));case xa:case Ql:case qf:c=qf,e.closed=!0;case ga:case di:break;case ma:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),c==Kl&&e.setTagName(r.slice(t,l)),l;case">":switch(c){case Kl:e.setTagName(r.slice(t,l));case xa:case Ql:case qf:break;case ga:case di:u=r.slice(t,l),u.slice(-1)==="/"&&(e.closed=!0,u=u.slice(0,-1));case ma:c===ma&&(u=a),c==ga?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,t)):((!Jl.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,t));break;case Zl:throw new Error("attribute value missed!!")}return l;case"\x80":h=" ";default:if(h<=" ")switch(c){case Kl:e.setTagName(r.slice(t,l)),c=Ql;break;case di:a=r.slice(t,l),c=ma;break;case ga:var u=r.slice(t,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,t);case xa:c=Ql;break}else switch(c){case ma:var d=e.tagName;(!Jl.isHTML(s[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,t),t=l,c=di;break;case xa:n.warning('attribute space is required"'+a+'"!!');case Ql:c=di,t=l;break;case Zl:c=ga,t=l;break;case qf:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function $C(r,t,e){for(var s=r.tagName,i=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==!1&&(i==null&&(i={},jC(e,e={})),e[c]=i[c]=a,n.uri=Jl.XMLNS,t.startPrefixMapping(c,a))}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=Jl.XML),u!=="xmlns"&&(n.uri=e[u||""]))}var d=s.indexOf(":");d>0?(u=r.prefix=s.slice(0,d),l=r.localName=s.slice(d+1)):(u=null,l=r.localName=s);var f=r.uri=e[u||""];if(t.startElement(f,l,s,r),r.closed){if(t.endElement(f,l,s),i)for(u in i)Object.prototype.hasOwnProperty.call(i,u)&&t.endPrefixMapping(u)}else return r.currentNSMap=e,r.localNSMap=i,!0}function nM(r,t,e,s,i){if(/^(?:script|textarea)$/i.test(e)){var n=r.indexOf("</"+e+">",t),o=r.substring(t+1,n);if(/[&<]/.test(o))return/^script$/i.test(e)?(i.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,s),i.characters(o,0,o.length),n)}return t+1}function oM(r,t,e,s){var i=s[e];return i==null&&(i=r.lastIndexOf("</"+e+">"),i<t&&(i=r.lastIndexOf("</"+e)),s[e]=i),i<t}function jC(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function aM(r,t,e,s){var i=r.charAt(t+2);switch(i){case"-":if(r.charAt(t+3)==="-"){var n=r.indexOf("-->",t+4);return n>t?(e.comment(r,t+4,n-t-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(t+3,6)=="CDATA["){var n=r.indexOf("]]>",t+9);return e.startCDATA(),e.characters(r,t+9,n-t-9),e.endCDATA(),n+3}var o=lM(r,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return e.startDTD(u,l,c),e.endDTD(),h.index+h[0].length}}return-1}function uM(r,t,e){var s=r.indexOf("?>",t);if(s){var i=r.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(i){var n=i[0].length;return e.processingInstruction(i[1],i[2]),s+2}else return-1}return-1}function qC(){this.attributeNames={}}qC.prototype={setTagName:function(r){if(!zC.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,t,e){if(!zC.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:t,offset:e}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function lM(r,t){var e,s=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(r);e=i.exec(r);)if(s.push(e),e[1])return s}Tv.XMLReader=YC;Tv.ParseError=_a});var sA=fi(Zf=>{"use strict";var cM=da(),hM=vv(),ZC=VC(),tA=KC(),dM=hM.DOMImplementation,QC=cM.NAMESPACE,fM=tA.ParseError,pM=tA.XMLReader;function eA(r){return r.replace(/\r[\n\u0085]/g,`
|
|
914
914
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
915
|
-
`)}function
|
|
916
|
-
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function
|
|
915
|
+
`)}function rA(r){this.options=r||{locator:{}}}rA.prototype.parseFromString=function(r,t){var e=this.options,s=new pM,i=e.domBuilder||new tc,n=e.errorHandler,o=e.locator,a=e.xmlns||{},u=/\/x?html?$/.test(t),l=u?ZC.HTML_ENTITIES:ZC.XML_ENTITIES;o&&i.setDocumentLocator(o),s.errorHandler=mM(n,i,o),s.domBuilder=e.domBuilder||i,u&&(a[""]=QC.HTML),a.xml=a.xml||QC.XML;var c=e.normalizeLineEndings||eA;return r&&typeof r=="string"?s.parse(c(r),a,l):s.errorHandler.error("invalid doc source"),i.doc};function mM(r,t,e){if(!r){if(t instanceof tc)return t;r=t}var s={},i=r instanceof Function;e=e||{};function n(o){var a=r[o];!a&&i&&(a=r.length==2?function(u){r(o,u)}:r),s[o]=a&&function(u){a("[xmldom "+o+"] "+u+Sv(e))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function tc(){this.cdata=!1}function ba(r,t){t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber}tc.prototype={startDocument:function(){this.doc=new dM().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,t,e,s){var i=this.doc,n=i.createElementNS(r,e||t),o=s.length;Kf(this,n),this.currentElement=n,this.locator&&ba(this.locator,n);for(var a=0;a<o;a++){var r=s.getURI(a),u=s.getValue(a),e=s.getQName(a),l=i.createAttributeNS(r,e);this.locator&&ba(s.getLocator(a),l),l.value=l.nodeValue=u,n.setAttributeNode(l)}},endElement:function(r,t,e){var s=this.currentElement,i=s.tagName;this.currentElement=s.parentNode},startPrefixMapping:function(r,t){},endPrefixMapping:function(r){},processingInstruction:function(r,t){var e=this.doc.createProcessingInstruction(r,t);this.locator&&ba(this.locator,e),Kf(this,e)},ignorableWhitespace:function(r,t,e){},characters:function(r,t,e){if(r=JC.apply(this,arguments),r){if(this.cdata)var s=this.doc.createCDATASection(r);else var s=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(r)&&this.doc.appendChild(s),this.locator&&ba(this.locator,s)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,t,e){r=JC.apply(this,arguments);var s=this.doc.createComment(r);this.locator&&ba(this.locator,s),Kf(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,t,e){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(r,t,e);this.locator&&ba(this.locator,i),Kf(this,i),this.doc.doctype=i}},warning:function(r){console.warn("[xmldom warning] "+r,Sv(this.locator))},error:function(r){console.error("[xmldom error] "+r,Sv(this.locator))},fatalError:function(r){throw new fM(r,this.locator)}};function Sv(r){if(r)return`
|
|
916
|
+
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function JC(r,t,e){return typeof r=="string"?r.substr(t,e):r.length>=t+e||t?new java.lang.String(r,t,e)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){tc.prototype[r]=function(){return null}});function Kf(r,t){r.currentElement?r.currentElement.appendChild(t):r.doc.appendChild(t)}Zf.__DOMHandler=tc;Zf.normalizeLineEndings=eA;Zf.DOMParser=rA});var nA=fi(Qf=>{"use strict";var iA=vv();Qf.DOMImplementation=iA.DOMImplementation;Qf.XMLSerializer=iA.XMLSerializer;Qf.DOMParser=sA().DOMParser});C();var oS={extension:{type:m.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(()=>(nS(),o3))}};C();var uS={extension:{type:m.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(aS(),a3))}};C();C();sh();Qc();C();Oe();Ye();te();ht();Sr();var Zg=`
|
|
917
917
|
in vec2 vTextureCoord;
|
|
918
918
|
in vec4 vColor;
|
|
919
919
|
|
|
@@ -934,7 +934,7 @@ void main()
|
|
|
934
934
|
|
|
935
935
|
{MAIN}
|
|
936
936
|
}
|
|
937
|
-
`;var
|
|
937
|
+
`;var Qg=`in vec2 aPosition;
|
|
938
938
|
out vec2 vTextureCoord;
|
|
939
939
|
out vec2 backgroundUv;
|
|
940
940
|
|
|
@@ -962,7 +962,7 @@ void main(void)
|
|
|
962
962
|
gl_Position = filterVertexPosition();
|
|
963
963
|
vTextureCoord = filterTextureCoord();
|
|
964
964
|
}
|
|
965
|
-
`;var
|
|
965
|
+
`;var Jg=`
|
|
966
966
|
struct GlobalFilterUniforms {
|
|
967
967
|
uInputSize:vec4<f32>,
|
|
968
968
|
uInputPixel:vec4<f32>,
|
|
@@ -1036,7 +1036,7 @@ fn mainFragment(
|
|
|
1036
1036
|
{MAIN}
|
|
1037
1037
|
|
|
1038
1038
|
return out;
|
|
1039
|
-
}`;var ut=class extends ae{constructor(t){let e=t.gpu,s=
|
|
1039
|
+
}`;var ut=class extends ae{constructor(t){let e=t.gpu,s=lS({source:Jg,...e}),i=Mt.from({vertex:{source:s,entryPoint:"mainVertex"},fragment:{source:s,entryPoint:"mainFragment"}}),n=t.gl,o=lS({source:Zg,...n}),a=Rt.from({vertex:Qg,fragment:o}),u=new dt({uBlend:{value:1,type:"f32"}});super({gpuProgram:i,glProgram:a,blendRequired:!0,resources:{blendUniforms:u,uBackTexture:D.EMPTY}})}};function lS(r){let{source:t,functions:e,main:s}=r;return t.replace("{FUNCTIONS}",e).replace("{MAIN}",s)}var Mi=`
|
|
1040
1040
|
float getLuminosity(vec3 c) {
|
|
1041
1041
|
return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
|
|
1042
1042
|
}
|
|
@@ -1115,7 +1115,7 @@ fn mainFragment(
|
|
|
1115
1115
|
|
|
1116
1116
|
return color;
|
|
1117
1117
|
}
|
|
1118
|
-
`;var
|
|
1118
|
+
`;var Di=`
|
|
1119
1119
|
fn getLuminosity(c: vec3<f32>) -> f32
|
|
1120
1120
|
{
|
|
1121
1121
|
return 0.3*c.r + 0.59*c.g + 0.11*c.b;
|
|
@@ -1213,7 +1213,7 @@ fn mainFragment(
|
|
|
1213
1213
|
return color;
|
|
1214
1214
|
}
|
|
1215
1215
|
`;var gh=class extends ut{constructor(){super({gl:{functions:`
|
|
1216
|
-
${
|
|
1216
|
+
${Mi}
|
|
1217
1217
|
|
|
1218
1218
|
vec3 blendColor(vec3 base, vec3 blend, float opacity)
|
|
1219
1219
|
{
|
|
@@ -1222,7 +1222,7 @@ fn mainFragment(
|
|
|
1222
1222
|
`,main:`
|
|
1223
1223
|
finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
|
|
1224
1224
|
`},gpu:{functions:`
|
|
1225
|
-
${
|
|
1225
|
+
${Di}
|
|
1226
1226
|
|
|
1227
1227
|
fn blendColorOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
1228
1228
|
{
|
|
@@ -1594,7 +1594,7 @@ fn mainFragment(
|
|
|
1594
1594
|
`,main:`
|
|
1595
1595
|
out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1596
1596
|
`}})}};Ph.extension={name:"linear-light",type:m.BlendMode};C();var Bh=class extends ut{constructor(){super({gl:{functions:`
|
|
1597
|
-
${
|
|
1597
|
+
${Mi}
|
|
1598
1598
|
|
|
1599
1599
|
vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
|
|
1600
1600
|
{
|
|
@@ -1604,7 +1604,7 @@ fn mainFragment(
|
|
|
1604
1604
|
`,main:`
|
|
1605
1605
|
finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
|
|
1606
1606
|
`},gpu:{functions:`
|
|
1607
|
-
${
|
|
1607
|
+
${Di}
|
|
1608
1608
|
|
|
1609
1609
|
fn blendLuminosity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
1610
1610
|
{
|
|
@@ -1710,7 +1710,7 @@ fn mainFragment(
|
|
|
1710
1710
|
`,main:`
|
|
1711
1711
|
out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1712
1712
|
`}})}};Dh.extension={name:"pin-light",type:m.BlendMode};C();var Fh=class extends ut{constructor(){super({gl:{functions:`
|
|
1713
|
-
${
|
|
1713
|
+
${Mi}
|
|
1714
1714
|
|
|
1715
1715
|
vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
|
|
1716
1716
|
{
|
|
@@ -1720,7 +1720,7 @@ fn mainFragment(
|
|
|
1720
1720
|
`,main:`
|
|
1721
1721
|
finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
|
|
1722
1722
|
`},gpu:{functions:`
|
|
1723
|
-
${
|
|
1723
|
+
${Di}
|
|
1724
1724
|
|
|
1725
1725
|
fn blendSaturation(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
1726
1726
|
{
|
|
@@ -1857,8 +1857,8 @@ fn mainFragment(
|
|
|
1857
1857
|
}
|
|
1858
1858
|
`,main:`
|
|
1859
1859
|
out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1860
|
-
`}})}};Ih.extension={name:"vivid-light",type:m.BlendMode};C();mt();Ui();var Xh;function hs(r){return Xh!==void 0||(Xh=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:r??Er.defaultOptions.failIfMajorPerformanceCaveat};try{if(!N.get().getWebGLRenderingContext())return!1;let s=N.get().createCanvas().getContext("webgl",t),i=!!s?.getContextAttributes()?.stencil;if(s){let n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,i}catch{return!1}})()),Xh}mt();var $h;async function ds(r={}){return $h!==void 0||($h=await(async()=>{let t=N.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(r)).requestDevice(),!0}catch{return!1}})()),$h}Ui();var FE=["webgl","webgpu","canvas"];async function d2(r){let t=[];r.preference?Array.isArray(r.preference)?t=r.preference.slice():(t.push(r.preference),FE.forEach(n=>{n!==r.preference&&t.push(n)})):t=FE.slice();let e,s={};for(let n=0;n<t.length;n++){let o=t[n];if(o==="webgpu"&&await ds()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(xb(),jS));e=a,s={...r,...r.webgpu};break}else if(o==="webgl"&&hs(r.failIfMajorPerformanceCaveat??Er.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(V0(),uE));e=a,s={...r,...r.webgl};break}else if(o==="canvas"){let{CanvasRenderer:a}=await Promise.resolve().then(()=>(h2(),DE));e=a,s={...r,...r.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!e)throw new Error("No available renderer for the current environment");let i=new e;return await i.init(s),i}_e();od();xt();C();C();var ea=class{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(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 e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{let{clientWidth:i,clientHeight:n}=this._resizeTo;e=i,s=n}this.renderer.resize(e,s),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}};ea.extension=m.Application;C();Vs();is();var ra=class{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Se.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Gt.shared:new Gt,t.autoStart&&this.start()}static destroy(){if(this._ticker){let t=this._ticker;this.ticker=null,t.destroy()}}};ra.extension=m.Application;O.add(ea);O.add(ra);var GE=class f2{constructor(...t){this.stage=new lt,t[0]!==void 0&&I(V,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new lt),this.renderer=await d2(t),f2._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return I(V,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,e=!1){let s=f2._plugins.slice(0);s.reverse(),s.forEach(i=>{i.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};GE._plugins=[];var UE=GE;O.handleByList(m.Application,UE._plugins);O.add(qn);C();ir();Kc();mt();C();zs();var vl={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let t=r.match(/^[a-z]+\s+.+$/gm),e={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in t){let d=t[h].match(/^[a-z]+/gm)[0],f=t[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),p={};for(let g in f){let _=f[g].split("="),b=_[0],y=_[1].replace(/"/gm,""),v=parseFloat(y),T=isNaN(v)?y:v;p[b]=T}e[d].push(p)}let s={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=e.info,[n]=e.common,[o]=e.distanceField??[];o&&(s.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),s.fontSize=parseInt(i.size,10),s.fontFamily=i.face,s.lineHeight=parseInt(n.lineHeight,10);let a=e.page;for(let h=0;h<a.length;h++)s.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};s.baseLineOffset=s.lineHeight-parseInt(n.base,10);let l=e.char;for(let h=0;h<l.length;h++){let d=l[h],f=parseInt(d.id,10),p=d.letter??d.char??String.fromCharCode(f);p==="space"&&(p=" "),u[f]=p,s.chars[p]={id:f,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}}}let c=e.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),f=parseInt(c[h].second,10),p=parseInt(c[h].amount,10);s.chars[u[f]]&&(s.chars[u[f]].kerning[u[d]]=p)}return s}};mt();var gf={test(r){let t=r;return typeof t!="string"&&"getElementsByTagName"in t&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let t={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},e=r.getElementsByTagName("info")[0],s=r.getElementsByTagName("common")[0],i=r.getElementsByTagName("distanceField")[0];i&&(t.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");t.fontSize=parseInt(e.getAttribute("size"),10),t.fontFamily=e.getAttribute("face"),t.lineHeight=parseInt(s.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)t.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};t.baseLineOffset=t.lineHeight-parseInt(s.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,t.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}}}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);t.chars[u[h]]&&(t.chars[u[h]].kerning[u[c]]=d)}return t}};var xf={test(r){return typeof r=="string"&&r.match(/<font(\s|>)/)?gf.test(N.get().parseXML(r)):!1},parse(r){return gf.parse(N.get().parseXML(r))}};var AB=[".xml",".fnt"],P2={extension:{type:m.CacheParser,name:"cacheBitmapFont"},test:r=>!!r?.pages&&!!r?.chars&&typeof r?.fontFamily=="string"&&r.fontFamily!=="",getCacheableAssets(r,t){let e={};return r.forEach(s=>{e[s]=t,e[`${s}-bitmap`]=t}),e[`${t.fontFamily}-bitmap`]=t,e}},B2={extension:{type:m.LoadParser,priority:Lt.Normal},name:"loadBitmapFont",id:"bitmap-font",test(r){return AB.includes(ee.extname(r).toLowerCase())},async testParse(r){return vl.test(r)||xf.test(r)},async parse(r,t,e){let s=vl.test(r)?vl.parse(r):xf.parse(r),{src:i}=t,{pages:n}=s,o=[],a=s.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let d=0;d<n.length;++d){let f=n[d].file,p=ee.join(ee.dirname(i),f);p=Rn(p,i),o.push({src:p,data:a})}let[u,{BitmapFont:l}]=await Promise.all([e.load(o),Promise.resolve().then(()=>(w2(),ZE))]),c=o.map(d=>u[d.src]);return new l({data:s,textures:c},i)},async load(r,t){return await(await N.get().fetch(r)).text()},async unload(r,t,e){await Promise.all(r.pages.map(s=>e.unload(s.texture.source._sourceOrigin))),r.destroy()}};pt();var Pl=class{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),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;let t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)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())}};Tr();C();ht();var R2={extension:{type:m.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(t=>t instanceof D),getCacheableAssets:(r,t)=>{let e={};return r.forEach(s=>{t.forEach((i,n)=>{e[s+(n===0?"":n+1)]=i})}),e}};C();async function Bl(r){if("Image"in globalThis)return new Promise(t=>{let e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let t=await(await fetch(r)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}var M2={extension:{type:m.DetectionParser,priority:1},test:async()=>Bl("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};C();var QE=["png","jpg","jpeg"],D2={extension:{type:m.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...QE],remove:async r=>r.filter(t=>!QE.includes(t))};C();var wB="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Ts(r){return wB?!1:document.createElement("video").canPlayType(r)!==""}var F2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};C();var G2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};C();var U2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};C();var I2={extension:{type:m.DetectionParser,priority:0},test:async()=>Bl("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};pt();zs();Bn();iu();var JE=class Pf{constructor(){this.loadOptions={...Pf.defaultOptions},this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){let s={promise:null,parser:null};return s.promise=(async()=>{let i=null,n=null;if((e.parser||e.loadParser)&&(n=this._parserHash[e.parser||e.loadParser],e.loadParser&&k(`[Assets] "loadParser" is deprecated, use "parser" instead for ${t}`),n||k(`[Assets] specified load parser "${e.parser||e.loadParser}" not found while loading ${t}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(t,e,this)){n=a;break}}if(!n)return k(`[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 n.load(t,e,this),s.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(i,e,this)&&(i=await a.parse(i,e,this)||i,s.parser=a)}return i})(),s}async load(t,e){this._parsersValidated||this._validateParsers();let s=typeof e=="function"?{...Pf.defaultOptions,...this.loadOptions,onProgress:e}:{...Pf.defaultOptions,...this.loadOptions,...e||{}},{onProgress:i,onError:n,strategy:o,retryCount:a,retryDelay:u}=s,l=0,c={},h=Xs(t),d=Ce(t,g=>({alias:[g],src:g,data:{}})),f=d.reduce((g,_)=>g+(_.progressSize||1),0),p=d.map(async g=>{let _=ee.toAbsolute(g.src);c[g.src]||(await this._loadAssetWithRetry(_,g,{onProgress:i,onError:n,strategy:o,retryCount:a,retryDelay:u},c),l+=g.progressSize||1,i&&i(l/f))});return await Promise.all(p),h?c[d[0].src]:c}async unload(t){let s=Ce(t,i=>({alias:[i],src:i})).map(async i=>{let n=ee.toAbsolute(i.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,i,this)}});await Promise.all(s)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,e)=>(!e.name&&!e.id?k("[Assets] parser should have an id"):(t[e.name]||t[e.id])&&k(`[Assets] parser id conflict "${e.id}"`),t[e.name]=e,e.id&&(t[e.id]=e),t),{})}async _loadAssetWithRetry(t,e,s,i){let n=0,{onError:o,strategy:a,retryCount:u,retryDelay:l}=s,c=h=>new Promise(d=>setTimeout(d,h));for(;;)try{this.promiseCache[t]||(this.promiseCache[t]=this._getLoadPromiseAndParser(t,e)),i[e.src]=await this.promiseCache[t].promise;return}catch(h){delete this.promiseCache[t],delete i[e.src],n++;let d=a!=="retry"||n>u;if(a==="retry"&&!d){o&&o(h,e),await c(l);continue}if(a==="skip"){o&&o(h,e);return}o&&o(h,e);let f=new Error(`[Loader.load] Failed to load ${t}.
|
|
1861
|
-
${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};
|
|
1860
|
+
`}})}};Ih.extension={name:"vivid-light",type:m.BlendMode};C();mt();ki();var Xh;function hs(r){return Xh!==void 0||(Xh=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:r??Er.defaultOptions.failIfMajorPerformanceCaveat};try{if(!N.get().getWebGLRenderingContext())return!1;let s=N.get().createCanvas().getContext("webgl",t),i=!!s?.getContextAttributes()?.stencil;if(s){let n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,i}catch{return!1}})()),Xh}mt();var $h;async function ds(r={}){return $h!==void 0||($h=await(async()=>{let t=N.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(r)).requestDevice(),!0}catch{return!1}})()),$h}ki();var UE=["webgl","webgpu","canvas"];async function f2(r){let t=[];r.preference?Array.isArray(r.preference)?t=r.preference.slice():(t.push(r.preference),UE.forEach(n=>{n!==r.preference&&t.push(n)})):t=UE.slice();let e,s={};for(let n=0;n<t.length;n++){let o=t[n];if(o==="webgpu"&&await ds()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(_b(),KS));e=a,s={...r,...r.webgpu};break}else if(o==="webgl"&&hs(r.failIfMajorPerformanceCaveat??Er.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(z0(),cE));e=a,s={...r,...r.webgl};break}else if(o==="canvas"){let{CanvasRenderer:a}=await Promise.resolve().then(()=>(d2(),GE));e=a,s={...r,...r.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!e)throw new Error("No available renderer for the current environment");let i=new e;return await i.init(s),i}_e();od();xt();C();C();var sa=class{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(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 e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{let{clientWidth:i,clientHeight:n}=this._resizeTo;e=i,s=n}this.renderer.resize(e,s),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}};sa.extension=m.Application;C();zs();is();var ia=class{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Se.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Gt.shared:new Gt,t.autoStart&&this.start()}static destroy(){if(this._ticker){let t=this._ticker;this.ticker=null,t.destroy()}}};ia.extension=m.Application;O.add(sa);O.add(ia);var IE=class p2{constructor(...t){this.stage=new lt,t[0]!==void 0&&I(V,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new lt),this.renderer=await f2(t),p2._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return I(V,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,e=!1){let s=p2._plugins.slice(0);s.reverse(),s.forEach(i=>{i.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};IE._plugins=[];var kE=IE;O.handleByList(m.Application,kE._plugins);O.add(Zn);C();ir();Kc();mt();C();Xs();var Tl={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let t=r.match(/^[a-z]+\s+.+$/gm),e={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in t){let d=t[h].match(/^[a-z]+/gm)[0],f=t[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),p={};for(let g in f){let _=f[g].split("="),b=_[0],y=_[1].replace(/"/gm,""),v=parseFloat(y),T=isNaN(v)?y:v;p[b]=T}e[d].push(p)}let s={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=e.info,[n]=e.common,[o]=e.distanceField??[];o&&(s.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),s.fontSize=parseInt(i.size,10),s.fontFamily=i.face,s.lineHeight=parseInt(n.lineHeight,10);let a=e.page;for(let h=0;h<a.length;h++)s.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};s.baseLineOffset=s.lineHeight-parseInt(n.base,10);let l=e.char;for(let h=0;h<l.length;h++){let d=l[h],f=parseInt(d.id,10),p=d.letter??d.char??String.fromCharCode(f);p==="space"&&(p=" "),u[f]=p,s.chars[p]={id:f,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}}}let c=e.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),f=parseInt(c[h].second,10),p=parseInt(c[h].amount,10);s.chars[u[f]]&&(s.chars[u[f]].kerning[u[d]]=p)}return s}};mt();var gf={test(r){let t=r;return typeof t!="string"&&"getElementsByTagName"in t&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let t={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},e=r.getElementsByTagName("info")[0],s=r.getElementsByTagName("common")[0],i=r.getElementsByTagName("distanceField")[0];i&&(t.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");t.fontSize=parseInt(e.getAttribute("size"),10),t.fontFamily=e.getAttribute("face"),t.lineHeight=parseInt(s.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)t.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};t.baseLineOffset=t.lineHeight-parseInt(s.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,t.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}}}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);t.chars[u[h]]&&(t.chars[u[h]].kerning[u[c]]=d)}return t}};var xf={test(r){return typeof r=="string"&&r.match(/<font(\s|>)/)?gf.test(N.get().parseXML(r)):!1},parse(r){return gf.parse(N.get().parseXML(r))}};var wB=[".xml",".fnt"],B2={extension:{type:m.CacheParser,name:"cacheBitmapFont"},test:r=>!!r?.pages&&!!r?.chars&&typeof r?.fontFamily=="string"&&r.fontFamily!=="",getCacheableAssets(r,t){let e={};return r.forEach(s=>{e[s]=t,e[`${s}-bitmap`]=t}),e[`${t.fontFamily}-bitmap`]=t,e}},R2={extension:{type:m.LoadParser,priority:Lt.Normal},name:"loadBitmapFont",id:"bitmap-font",test(r){return wB.includes(ee.extname(r).toLowerCase())},async testParse(r){return Tl.test(r)||xf.test(r)},async parse(r,t,e){let s=Tl.test(r)?Tl.parse(r):xf.parse(r),{src:i}=t,{pages:n}=s,o=[],a=s.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let d=0;d<n.length;++d){let f=n[d].file,p=ee.join(ee.dirname(i),f);p=Dn(p,i),o.push({src:p,data:a})}let[u,{BitmapFont:l}]=await Promise.all([e.load(o),Promise.resolve().then(()=>(P2(),JE))]),c=o.map(d=>u[d.src]);return new l({data:s,textures:c},i)},async load(r,t){return await(await N.get().fetch(r)).text()},async unload(r,t,e){await Promise.all(r.pages.map(s=>e.unload(s.texture.source._sourceOrigin))),r.destroy()}};pt();var Bl=class{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),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;let t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)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())}};Tr();C();ht();var M2={extension:{type:m.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(t=>t instanceof D),getCacheableAssets:(r,t)=>{let e={};return r.forEach(s=>{t.forEach((i,n)=>{e[s+(n===0?"":n+1)]=i})}),e}};C();async function Rl(r){if("Image"in globalThis)return new Promise(t=>{let e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let t=await(await fetch(r)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}var D2={extension:{type:m.DetectionParser,priority:1},test:async()=>Rl("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};C();var tC=["png","jpg","jpeg"],F2={extension:{type:m.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...tC],remove:async r=>r.filter(t=>!tC.includes(t))};C();var PB="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Ts(r){return PB?!1:document.createElement("video").canPlayType(r)!==""}var G2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};C();var U2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};C();var I2={extension:{type:m.DetectionParser,priority:0},test:async()=>Ts("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};C();var k2={extension:{type:m.DetectionParser,priority:0},test:async()=>Rl("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};pt();Xs();Mn();nu();var eC=class Pf{constructor(){this.loadOptions={...Pf.defaultOptions},this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){let s={promise:null,parser:null};return s.promise=(async()=>{let i=null,n=null;if((e.parser||e.loadParser)&&(n=this._parserHash[e.parser||e.loadParser],e.loadParser&&k(`[Assets] "loadParser" is deprecated, use "parser" instead for ${t}`),n||k(`[Assets] specified load parser "${e.parser||e.loadParser}" not found while loading ${t}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(t,e,this)){n=a;break}}if(!n)return k(`[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 n.load(t,e,this),s.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(i,e,this)&&(i=await a.parse(i,e,this)||i,s.parser=a)}return i})(),s}async load(t,e){this._parsersValidated||this._validateParsers();let s=typeof e=="function"?{...Pf.defaultOptions,...this.loadOptions,onProgress:e}:{...Pf.defaultOptions,...this.loadOptions,...e||{}},{onProgress:i,onError:n,strategy:o,retryCount:a,retryDelay:u}=s,l=0,c={},h=$s(t),d=Ce(t,g=>({alias:[g],src:g,data:{}})),f=d.reduce((g,_)=>g+(_.progressSize||1),0),p=d.map(async g=>{let _=ee.toAbsolute(g.src);c[g.src]||(await this._loadAssetWithRetry(_,g,{onProgress:i,onError:n,strategy:o,retryCount:a,retryDelay:u},c),l+=g.progressSize||1,i&&i(l/f))});return await Promise.all(p),h?c[d[0].src]:c}async unload(t){let s=Ce(t,i=>({alias:[i],src:i})).map(async i=>{let n=ee.toAbsolute(i.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,i,this)}});await Promise.all(s)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,e)=>(!e.name&&!e.id?k("[Assets] parser should have an id"):(t[e.name]||t[e.id])&&k(`[Assets] parser id conflict "${e.id}"`),t[e.name]=e,e.id&&(t[e.id]=e),t),{})}async _loadAssetWithRetry(t,e,s,i){let n=0,{onError:o,strategy:a,retryCount:u,retryDelay:l}=s,c=h=>new Promise(d=>setTimeout(d,h));for(;;)try{this.promiseCache[t]||(this.promiseCache[t]=this._getLoadPromiseAndParser(t,e)),i[e.src]=await this.promiseCache[t].promise;return}catch(h){delete this.promiseCache[t],delete i[e.src],n++;let d=a!=="retry"||n>u;if(a==="retry"&&!d){o&&o(h,e),await c(l);continue}if(a==="skip"){o&&o(h,e);return}o&&o(h,e);let f=new Error(`[Loader.load] Failed to load ${t}.
|
|
1861
|
+
${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};eC.defaultOptions={onProgress:void 0,onError:void 0,strategy:"throw",retryCount:3,retryDelay:250};var O2=eC;mt();C();function nr(r,t){if(Array.isArray(t)){for(let e of t)if(r.startsWith(`data:${e}`))return!0;return!1}return r.startsWith(`data:${t}`)}Xs();function Xt(r,t){let e=r.split("?")[0],s=ee.extname(e).toLowerCase();return Array.isArray(t)?t.includes(s):s===t}ir();var BB=".json",RB="application/json",L2={extension:{type:m.LoadParser,priority:Lt.Low},name:"loadJson",id:"json",test(r){return nr(r,RB)||Xt(r,BB)},async load(r){return await(await N.get().fetch(r)).json()}};mt();C();ir();var MB=".txt",DB="text/plain",N2={name:"loadTxt",id:"text",extension:{type:m.LoadParser,priority:Lt.Low,name:"loadTxt"},test(r){return nr(r,DB)||Xt(r,MB)},async load(r){return await(await N.get().fetch(r)).text()}};mt();C();pt();Xs();Tr();ir();var FB=["normal","bold","100","200","300","400","500","600","700","800","900"],GB=[".ttf",".otf",".woff",".woff2"],UB=["font/ttf","font/otf","font/woff","font/woff2"],IB=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function rC(r){let t=ee.extname(r),i=ee.basename(r,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)),n=i.length>0;for(let a of i)if(!a.match(IB)){n=!1;break}let o=i.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}var kB=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function OB(r){return kB.test(r)?r:encodeURI(r)}var H2={extension:{type:m.LoadParser,priority:Lt.Low},name:"loadWebFont",id:"web-font",test(r){return nr(r,UB)||Xt(r,GB)},async load(r,t){let e=N.get().getFontFaceSet();if(e){let s=[],i=t.data?.family??rC(r),n=t.data?.weights?.filter(a=>FB.includes(a))??["normal"],o=t.data??{};for(let a=0;a<n.length;a++){let u=n[a],l=new FontFace(i,`url('${OB(r)}')`,{...o,weight:u});await l.load(),e.add(l),s.push(l)}return at.has(`${i}-and-url`)?at.get(`${i}-and-url`).entries.push({url:r,faces:s}):at.set(`${i}-and-url`,{entries:[{url:r,faces:s}]}),s.length===1?s[0]:s}return k("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){let t=Array.isArray(r)?r:[r],e=t[0].family,s=at.get(`${e}-and-url`),i=s.entries.find(n=>n.faces.some(o=>t.indexOf(o)!==-1));i.faces=i.faces.filter(n=>t.indexOf(n)===-1),i.faces.length===0&&(s.entries=s.entries.filter(n=>n!==i)),t.forEach(n=>{N.get().getFontFaceSet().delete(n)}),s.entries.length===0&&at.remove(`${e}-and-url`)}};mt();C();wi();ci();Ys();function We(r,t=1){let e=Ae.RETINA_PREFIX?.exec(r);return e?parseFloat(e[1]):t}ir();ht();pt();Tr();function Ve(r,t,e){r.label=e,r._sourceOrigin=e;let s=new D({source:r,label:e}),i=()=>{delete t.promiseCache[e],at.has(e)&&at.remove(e)};return s.source.once("destroy",()=>{t.promiseCache[e]&&(k("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),i())}),s.once("destroy",()=>{r.destroyed||(k("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),i())}),s}var LB=".svg",NB="image/svg+xml",W2={extension:{type:m.LoadParser,priority:Lt.Low,name:"loadSVG"},name:"loadSVG",id:"svg",config:{crossOrigin:"anonymous",parseAsGraphicsContext:!1},test(r){return nr(r,NB)||Xt(r,LB)},async load(r,t,e){return t.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?WB(r):HB(r,t,e,this.config.crossOrigin)},unload(r){r.destroy(!0)}};async function HB(r,t,e,s){let i=await N.get().fetch(r),n=N.get().createImage();n.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await i.text())}`,n.crossOrigin=s,await n.decode();let o=t.data?.width??n.width,a=t.data?.height??n.height,u=t.data?.resolution||We(r),l=Math.ceil(o*u),c=Math.ceil(a*u),h=N.get().createCanvas(l,c),d=h.getContext("2d");d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(n,0,0,o*u,a*u);let{parseAsGraphicsContext:f,...p}=t.data??{},g=new ke({resource:h,alphaMode:"premultiply-alpha-on-upload",resolution:u,...p});return Ve(g,e,r)}async function WB(r){let e=await(await N.get().fetch(r)).text(),s=new Kt;return s.svg(e),s}mt();C();wi();var VB=`(function () {
|
|
1862
1862
|
'use strict';
|
|
1863
1863
|
|
|
1864
1864
|
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
|
@@ -1878,7 +1878,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};JE.defaultOptio
|
|
|
1878
1878
|
});
|
|
1879
1879
|
|
|
1880
1880
|
})();
|
|
1881
|
-
`,
|
|
1881
|
+
`,aa=null,ua=class{constructor(){aa||(aa=URL.createObjectURL(new Blob([VB],{type:"application/javascript"}))),this.worker=new Worker(aa)}};ua.revokeObjectURL=function(){aa&&(URL.revokeObjectURL(aa),aa=null)};var zB=`(function () {
|
|
1882
1882
|
'use strict';
|
|
1883
1883
|
|
|
1884
1884
|
async function loadImageBitmap(url, alphaMode) {
|
|
@@ -1907,7 +1907,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};JE.defaultOptio
|
|
|
1907
1907
|
};
|
|
1908
1908
|
|
|
1909
1909
|
})();
|
|
1910
|
-
`,aa=null,Rl=class{constructor(){aa||(aa=URL.createObjectURL(new Blob([VB],{type:"application/javascript"}))),this.worker=new Worker(aa)}};Rl.revokeObjectURL=function(){aa&&(URL.revokeObjectURL(aa),aa=null)};var eC=0,W2,V2=class{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=>{let{worker:e}=new oa;e.addEventListener("message",s=>{e.terminate(),oa.revokeObjectURL(),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){W2===void 0&&(W2=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<W2&&(this._createdWorkers++,t=new Rl().worker,t.addEventListener("message",e=>{this._complete(e.data),this._returnWorker(e.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){this._resolveHash[t.uuid]&&(t.error!==void 0?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),delete this._resolveHash[t.uuid])}async _run(t,e){await this._initWorkers();let s=new Promise((i,n)=>{this._queue.push({id:t,arguments:e,resolve:i,reject:n})});return this._next(),s}_next(){if(!this._queue.length)return;let t=this._getWorker();if(!t)return;let e=this._queue.pop(),s=e.id;this._resolveHash[eC]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:eC++,id:s})}reset(){this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:t})=>{t?.(new Error("WorkerManager has been reset before completion"))}),this._resolveHash={},this._queue.length=0,this._initialized=!1,this._createdWorkers=0}},Bf=new V2;ir();var zB=[".jpeg",".jpg",".png",".webp",".avif"],XB=["image/jpeg","image/png","image/webp","image/avif"];async function rC(r,t){let e=await N.get().fetch(r);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${e.status} ${e.statusText}`);let s=await e.blob();return t?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(s,{premultiplyAlpha:"none"}):createImageBitmap(s)}var Ml={name:"loadTextures",id:"texture",extension:{type:m.LoadParser,priority:Lt.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return nr(r,XB)||Xt(r,zB)},async load(r,t,e){let s=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Bf.isImageBitmapSupported()?s=await Bf.loadImageBitmap(r,t):s=await rC(r,t):s=await new Promise((n,o)=>{s=N.get().createImage(),s.crossOrigin=this.config.crossOrigin,s.src=r,s.complete?n(s):(s.onload=()=>{n(s)},s.onerror=o)});let i=new ke({resource:s,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||We(r),...t.data});return Ve(i,e,r)},unload(r){r.destroy(!0)}};C();rh();th();var $B=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],z2,X2;function sC(r,t,e){e===void 0&&!t.startsWith("data:")?r.crossOrigin=nC(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}function iC(r){return new Promise((t,e)=>{r.addEventListener("canplaythrough",s),r.addEventListener("error",i),r.load();function s(){n(),t()}function i(o){n(),e(o)}function n(){r.removeEventListener("canplaythrough",s),r.removeEventListener("error",i)}})}function nC(r,t=globalThis.location){if(r.startsWith("data:"))return"";t||(t=globalThis.location);let e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function YB(){let r=[],t=[];for(let e of $B){let s=qs.MIME_TYPES[e.substring(1)]||`video/${e.substring(1)}`;Ts(s)&&(r.push(e),t.includes(s)||t.push(s))}return{validVideoExtensions:r,validVideoMime:t}}var $2={name:"loadVideo",id:"video",extension:{type:m.LoadParser,name:"loadVideo"},test(r){if(!z2||!X2){let{validVideoExtensions:s,validVideoMime:i}=YB();z2=s,X2=i}let t=nr(r,X2),e=Xt(r,z2);return t||e},async load(r,t,e){let s={...qs.defaultOptions,resolution:t.data?.resolution||We(r),alphaMode:t.data?.alphaMode||await lu(),...t.data},i=document.createElement("video"),n={preload:s.autoLoad!==!1?"auto":void 0,"webkit-playsinline":s.playsinline!==!1?"":void 0,playsinline:s.playsinline!==!1?"":void 0,muted:s.muted===!0?"":void 0,loop:s.loop===!0?"":void 0,autoplay:s.autoPlay!==!1?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&i.setAttribute(u,l)}),s.muted===!0&&(i.muted=!0),sC(i,r,s.crossorigin);let o=document.createElement("source"),a;if(s.mime)a=s.mime;else if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=qs.MIME_TYPES[u]||`video/${u}`}return o.src=r,a&&(o.type=a),new Promise((u,l)=>{s.preload&&!s.autoPlay&&i.load(),i.addEventListener("canplay",c),i.addEventListener("error",h),o.addEventListener("error",h),i.appendChild(o);async function c(){let f=new qs({...s,resource:i});d(),t.data.preload&&await iC(i),u(Ve(f,e,r))}function h(f){d(),l(f)}function d(){i.removeEventListener("canplay",c),i.removeEventListener("error",h),o.removeEventListener("error",h)}})},unload(r){r.destroy(!0)}};C();$s();C();$s();var Dl={extension:{type:m.ResolveParser,name:"resolveTexture"},test:Ml.test,parse:r=>({resolution:parseFloat(Ae.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var Y2={extension:{type:m.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Ae.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Dl.parse};$s();Bn();iu();var Rf=class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Ae,this.loader=new k2,this.cache=at,this._backgroundLoader=new Pl(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized){k("[Assets]AssetManager already initialized, did you load before calling this Assets.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 n=t.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n)}let e=t.texturePreference?.resolution??1,s=typeof e=="number"?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:s}}),t.preferences&&this.setPreferences(t.preferences),t.loadOptions&&(this.loader.loadOptions={...this.loader.loadOptions,...t.loadOptions})}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();let s=Xs(t),i=Ce(t).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(i),o=await this._mapLoadToResolve(n,e);return s?o[i[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);let i=this.resolver.resolveBundle(t),n={},o=Object.keys(i),a=0,u=[],l=()=>{e?.(u.reduce((h,d)=>h+d,0)/a)},c=o.map((h,d)=>{let f=i[h],p=Object.values(f),_=[...new Set(p.flat())].reduce((b,y)=>b+(y.progressSize||1),0);return u.push(0),a+=_,this._mapLoadToResolve(f,b=>{u[d]=b*_,l()}).then(b=>{n[h]=b})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolveBundle(t);Object.values(e).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return at.get(t);let e={};for(let s=0;s<t.length;s++)e[s]=at.get(t[s]);return e}async _mapLoadToResolve(t,e){let s=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;let i=await this.loader.load(s,e);this._backgroundLoader.active=!0;let n={};return s.forEach(o=>{let a=i[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a}),at.set(u,a)}),n}async unload(t){this._initialized||await this.init();let e=Ce(t).map(i=>typeof i!="string"?i.src:i),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=Ce(t);let e=this.resolver.resolveBundle(t),s=Object.keys(e).map(i=>this._unloadFromResolved(e[i]));await Promise.all(s)}async _unloadFromResolved(t){let e=Object.values(t);e.forEach(s=>{at.remove(s.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(let s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((s,i)=>e.indexOf(s)===i),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(s=>s in t).forEach(s=>{e.config[s]=t[s]})})}},Fl=new Rf;O.handleByList(m.LoadParser,Fl.loader.parsers).handleByList(m.ResolveParser,Fl.resolver.parsers).handleByList(m.CacheParser,Fl.cache.parsers).handleByList(m.DetectionParser,Fl.detections);O.add(R2,D2,M2,I2,F2,G2,U2,O2,L2,N2,H2,Ml,$2,B2,P2,Dl,Y2);var oC={loader:m.LoadParser,resolver:m.ResolveParser,cache:m.CacheParser,detection:m.DetectionParser};O.handle(m.Asset,r=>{let t=r.ref;Object.entries(oC).filter(([e])=>!!t[e]).forEach(([e,s])=>O.add(Object.assign(t[e],{extension:t[e].extension??s})))},r=>{let t=r.ref;Object.keys(oC).filter(e=>!!t[e]).forEach(e=>O.remove(t[e]))});C();var jB={extension:{type:m.DetectionParser,priority:3},test:async()=>!!(await ds()||hs()),add:async r=>[...r,"basis"],remove:async r=>r.filter(t=>t!=="basis")};ir();C();Wt();var Gr=class extends st{constructor(t){super({...t,mipLevelCount:t.resource.length}),this.uploadMethodId="compressed"}};mt();var Mf;function Df(){if(Mf)return Mf;let t=N.get().createCanvas(1,1).getContext("webgl");return t?(Mf=[...t.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...t.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...t.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...t.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Mf):[]}mt();var Ff;async function Gf(){if(Ff)return Ff;let r=await N.get().getNavigator().gpu.requestAdapter();return Ff=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Ff}var Uf;async function Gl(){return Uf!==void 0||(Uf=await(async()=>{let r=await ds(),t=hs();if(r&&t){let e=await Gf(),s=Df();return e.filter(i=>s.includes(i))}else{if(r)return await Gf();if(t)return Df()}return[]})()),Uf}var aC=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"],If;async function Ss(){if(If!==void 0)return If;let r=await Gl();return If=[...aC,...r],If}var qB=`(function () {
|
|
1910
|
+
`,la=null,Ml=class{constructor(){la||(la=URL.createObjectURL(new Blob([zB],{type:"application/javascript"}))),this.worker=new Worker(la)}};Ml.revokeObjectURL=function(){la&&(URL.revokeObjectURL(la),la=null)};var sC=0,V2,z2=class{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=>{let{worker:e}=new ua;e.addEventListener("message",s=>{e.terminate(),ua.revokeObjectURL(),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){V2===void 0&&(V2=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<V2&&(this._createdWorkers++,t=new Ml().worker,t.addEventListener("message",e=>{this._complete(e.data),this._returnWorker(e.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){this._resolveHash[t.uuid]&&(t.error!==void 0?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),delete this._resolveHash[t.uuid])}async _run(t,e){await this._initWorkers();let s=new Promise((i,n)=>{this._queue.push({id:t,arguments:e,resolve:i,reject:n})});return this._next(),s}_next(){if(!this._queue.length)return;let t=this._getWorker();if(!t)return;let e=this._queue.pop(),s=e.id;this._resolveHash[sC]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:sC++,id:s})}reset(){this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:t})=>{t?.(new Error("WorkerManager has been reset before completion"))}),this._resolveHash={},this._queue.length=0,this._initialized=!1,this._createdWorkers=0}},Bf=new z2;ir();var XB=[".jpeg",".jpg",".png",".webp",".avif"],$B=["image/jpeg","image/png","image/webp","image/avif"];async function iC(r,t){let e=await N.get().fetch(r);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${e.status} ${e.statusText}`);let s=await e.blob();return t?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(s,{premultiplyAlpha:"none"}):createImageBitmap(s)}var Dl={name:"loadTextures",id:"texture",extension:{type:m.LoadParser,priority:Lt.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return nr(r,$B)||Xt(r,XB)},async load(r,t,e){let s=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Bf.isImageBitmapSupported()?s=await Bf.loadImageBitmap(r,t):s=await iC(r,t):s=await new Promise((n,o)=>{s=N.get().createImage(),s.crossOrigin=this.config.crossOrigin,s.src=r,s.complete?n(s):(s.onload=()=>{n(s)},s.onerror=o)});let i=new ke({resource:s,alphaMode:"premultiply-alpha-on-upload",resolution:t.data?.resolution||We(r),...t.data});return Ve(i,e,r)},unload(r){r.destroy(!0)}};C();rh();th();var YB=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],X2,$2;function nC(r,t,e){e===void 0&&!t.startsWith("data:")?r.crossOrigin=aC(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}function oC(r){return new Promise((t,e)=>{r.addEventListener("canplaythrough",s),r.addEventListener("error",i),r.load();function s(){n(),t()}function i(o){n(),e(o)}function n(){r.removeEventListener("canplaythrough",s),r.removeEventListener("error",i)}})}function aC(r,t=globalThis.location){if(r.startsWith("data:"))return"";t||(t=globalThis.location);let e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function jB(){let r=[],t=[];for(let e of YB){let s=Ks.MIME_TYPES[e.substring(1)]||`video/${e.substring(1)}`;Ts(s)&&(r.push(e),t.includes(s)||t.push(s))}return{validVideoExtensions:r,validVideoMime:t}}var Y2={name:"loadVideo",id:"video",extension:{type:m.LoadParser,name:"loadVideo"},test(r){if(!X2||!$2){let{validVideoExtensions:s,validVideoMime:i}=jB();X2=s,$2=i}let t=nr(r,$2),e=Xt(r,X2);return t||e},async load(r,t,e){let s={...Ks.defaultOptions,resolution:t.data?.resolution||We(r),alphaMode:t.data?.alphaMode||await cu(),...t.data},i=document.createElement("video"),n={preload:s.autoLoad!==!1?"auto":void 0,"webkit-playsinline":s.playsinline!==!1?"":void 0,playsinline:s.playsinline!==!1?"":void 0,muted:s.muted===!0?"":void 0,loop:s.loop===!0?"":void 0,autoplay:s.autoPlay!==!1?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&i.setAttribute(u,l)}),s.muted===!0&&(i.muted=!0),nC(i,r,s.crossorigin);let o=document.createElement("source"),a;if(s.mime)a=s.mime;else if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=Ks.MIME_TYPES[u]||`video/${u}`}return o.src=r,a&&(o.type=a),new Promise((u,l)=>{s.preload&&!s.autoPlay&&i.load(),i.addEventListener("canplay",c),i.addEventListener("error",h),o.addEventListener("error",h),i.appendChild(o);async function c(){let f=new Ks({...s,resource:i});d(),t.data.preload&&await oC(i),u(Ve(f,e,r))}function h(f){d(),l(f)}function d(){i.removeEventListener("canplay",c),i.removeEventListener("error",h),o.removeEventListener("error",h)}})},unload(r){r.destroy(!0)}};C();Ys();C();Ys();var Fl={extension:{type:m.ResolveParser,name:"resolveTexture"},test:Dl.test,parse:r=>({resolution:parseFloat(Ae.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var j2={extension:{type:m.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Ae.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Fl.parse};Ys();Mn();nu();var Rf=class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new Ae,this.loader=new O2,this.cache=at,this._backgroundLoader=new Bl(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized){k("[Assets]AssetManager already initialized, did you load before calling this Assets.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 n=t.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n)}let e=t.texturePreference?.resolution??1,s=typeof e=="number"?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:s}}),t.preferences&&this.setPreferences(t.preferences),t.loadOptions&&(this.loader.loadOptions={...this.loader.loadOptions,...t.loadOptions})}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();let s=$s(t),i=Ce(t).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(i),o=await this._mapLoadToResolve(n,e);return s?o[i[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);let i=this.resolver.resolveBundle(t),n={},o=Object.keys(i),a=0,u=[],l=()=>{e?.(u.reduce((h,d)=>h+d,0)/a)},c=o.map((h,d)=>{let f=i[h],p=Object.values(f),_=[...new Set(p.flat())].reduce((b,y)=>b+(y.progressSize||1),0);return u.push(0),a+=_,this._mapLoadToResolve(f,b=>{u[d]=b*_,l()}).then(b=>{n[h]=b})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);let e=this.resolver.resolveBundle(t);Object.values(e).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return at.get(t);let e={};for(let s=0;s<t.length;s++)e[s]=at.get(t[s]);return e}async _mapLoadToResolve(t,e){let s=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;let i=await this.loader.load(s,e);this._backgroundLoader.active=!0;let n={};return s.forEach(o=>{let a=i[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a}),at.set(u,a)}),n}async unload(t){this._initialized||await this.init();let e=Ce(t).map(i=>typeof i!="string"?i.src:i),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=Ce(t);let e=this.resolver.resolveBundle(t),s=Object.keys(e).map(i=>this._unloadFromResolved(e[i]));await Promise.all(s)}async _unloadFromResolved(t){let e=Object.values(t);e.forEach(s=>{at.remove(s.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(let s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((s,i)=>e.indexOf(s)===i),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(s=>s in t).forEach(s=>{e.config[s]=t[s]})})}},Gl=new Rf;O.handleByList(m.LoadParser,Gl.loader.parsers).handleByList(m.ResolveParser,Gl.resolver.parsers).handleByList(m.CacheParser,Gl.cache.parsers).handleByList(m.DetectionParser,Gl.detections);O.add(M2,F2,D2,k2,G2,U2,I2,L2,N2,H2,W2,Dl,Y2,R2,B2,Fl,j2);var uC={loader:m.LoadParser,resolver:m.ResolveParser,cache:m.CacheParser,detection:m.DetectionParser};O.handle(m.Asset,r=>{let t=r.ref;Object.entries(uC).filter(([e])=>!!t[e]).forEach(([e,s])=>O.add(Object.assign(t[e],{extension:t[e].extension??s})))},r=>{let t=r.ref;Object.keys(uC).filter(e=>!!t[e]).forEach(e=>O.remove(t[e]))});C();var qB={extension:{type:m.DetectionParser,priority:3},test:async()=>!!(await ds()||hs()),add:async r=>[...r,"basis"],remove:async r=>r.filter(t=>t!=="basis")};ir();C();Wt();var Gr=class extends st{constructor(t){super({...t,mipLevelCount:t.resource.length}),this.uploadMethodId="compressed"}};mt();var Mf;function Df(){if(Mf)return Mf;let t=N.get().createCanvas(1,1).getContext("webgl");return t?(Mf=[...t.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...t.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...t.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...t.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Mf):[]}mt();var Ff;async function Gf(){if(Ff)return Ff;let r=await N.get().getNavigator().gpu.requestAdapter();return Ff=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Ff}var Uf;async function Ul(){return Uf!==void 0||(Uf=await(async()=>{let r=await ds(),t=hs();if(r&&t){let e=await Gf(),s=Df();return e.filter(i=>s.includes(i))}else{if(r)return await Gf();if(t)return Df()}return[]})()),Uf}var lC=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"],If;async function Ss(){if(If!==void 0)return If;let r=await Ul();return If=[...lC,...r],If}var KB=`(function () {
|
|
1911
1911
|
'use strict';
|
|
1912
1912
|
|
|
1913
1913
|
function createLevelBuffers(basisTexture, basisTranscoderFormat) {
|
|
@@ -2041,8 +2041,8 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};JE.defaultOptio
|
|
|
2041
2041
|
});
|
|
2042
2042
|
|
|
2043
2043
|
})();
|
|
2044
|
-
`,ua=null,Ul=class{constructor(){ua||(ua=URL.createObjectURL(new Blob([qB],{type:"application/javascript"}))),this.worker=new Worker(ua)}};Ul.revokeObjectURL=function(){ua&&(URL.revokeObjectURL(ua),ua=null)};var Il={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.wasm"};function KB(r){Object.assign(Il,r)}var kl,uC={};function ZB(r){return kl||(kl=new Ul().worker,kl.onmessage=t=>{let{success:e,url:s,textureOptions:i}=t.data;e||console.warn("Failed to load Basis texture",s),uC[s](i)},kl.postMessage({type:"init",jsUrl:Il.jsUrl,wasmUrl:Il.wasmUrl,supportedTextures:r})),kl}function j2(r,t){let e=ZB(t);return new Promise(s=>{uC[r]=s,e.postMessage({type:"load",url:r})})}var QB={extension:{type:m.LoadParser,priority:Lt.High,name:"loadBasis"},name:"loadBasis",id:"basis",test(r){return Xt(r,[".basis"])},async load(r,t,e){let s=await Ss(),i=await j2(r,s),n=new Gr({...i,resolution:t.data?.resolution||We(r)});return Ve(n,e,r)},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};function JB(r,t){let e=r.getNumImages(),s=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<s;++o)for(let a=0;a<e;++a){let u=r.getImageTranscodedSizeInBytes(a,o,t),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,t,1,0))throw new Error("transcodeImage failed");n.push(l)}return n}var tR={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};function eR(r){let t=tR[r];if(t)return t;throw new Error(`Unsupported transcoderFormat: ${r}`)}var rR={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},sR={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},q2=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(q2||{}),K2=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(K2||{});function fe(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var qe=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=fe("UYVY")]="UYVY",r[r.R8G8_B8G8=fe("RGBG")]="R8G8_B8G8",r[r.YUY2=fe("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=fe("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=fe("DXT1")]="DXT1",r[r.DXT2=fe("DXT2")]="DXT2",r[r.DXT3=fe("DXT3")]="DXT3",r[r.DXT4=fe("DXT4")]="DXT4",r[r.DXT5=fe("DXT5")]="DXT5",r[r.ATI1=fe("ATI1")]="ATI1",r[r.AT1N=fe("AT1N")]="AT1N",r[r.ATI2=fe("ATI2")]="ATI2",r[r.AT2N=fe("AT2N")]="AT2N",r[r.BC4U=fe("BC4U")]="BC4U",r[r.BC4S=fe("BC4S")]="BC4S",r[r.BC5U=fe("BC5U")]="BC5U",r[r.BC5S=fe("BC5S")]="BC5S",r[r.DX10=fe("DX10")]="DX10",r))(qe||{}),kf={[qe.DXT1]:"bc1-rgba-unorm",[qe.DXT2]:"bc2-rgba-unorm",[qe.DXT3]:"bc2-rgba-unorm",[qe.DXT4]:"bc3-rgba-unorm",[qe.DXT5]:"bc3-rgba-unorm",[qe.ATI1]:"bc4-r-unorm",[qe.BC4U]:"bc4-r-unorm",[qe.BC4S]:"bc4-r-snorm",[qe.ATI2]:"bc5-rg-unorm",[qe.BC5U]:"bc5-rg-unorm",[qe.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},ze={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},it={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:rR,HEADER_DX10_FIELDS:sR,DXGI_FORMAT:q2,D3D10_RESOURCE_DIMENSION:K2,D3DFMT:qe},Z2={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};ir();C();function Q2(r,t){let{format:e,fourCC:s,width:i,height:n,dataOffset:o,mipmapCount:a}=nR(r);if(!t.includes(e))throw new Error(`Unsupported texture format: ${s} ${e}, supported: ${t}`);if(a<=1)return{format:e,width:i,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=iR(e,i,n,o,a,r);return{format:e,width:i,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function iR(r,t,e,s,i,n){let o=[],a=Z2[r],u=t,l=e,c=s;for(let h=0;h<i;++h){let d=Math.ceil(Math.max(4,u)/4)*4,f=Math.ceil(Math.max(4,l)/4)*4,p=a?d/4*f/4*a:u*l*4,g=new Uint8Array(n,c,p);o.push(g),c+=p,u=Math.max(u>>1,1),l=Math.max(l>>1,1)}return o}function nR(r){let t=new Uint32Array(r,0,it.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(t[it.HEADER_FIELDS.MAGIC]!==it.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let e=t[it.HEADER_FIELDS.HEIGHT],s=t[it.HEADER_FIELDS.WIDTH],i=Math.max(1,t[it.HEADER_FIELDS.MIPMAP_COUNT]),n=t[it.HEADER_FIELDS.PF_FLAGS],o=t[it.HEADER_FIELDS.FOURCC],a=oR(t,n,o,r),u=it.MAGIC_SIZE+it.HEADER_SIZE+(o===it.D3DFMT.DX10?it.HEADER_DX10_SIZE:0);return{format:a,fourCC:o,width:s,height:e,dataOffset:u,mipmapCount:i}}function oR(r,t,e,s){if(t&it.PIXEL_FORMAT_FLAGS.FOURCC){if(e===it.D3DFMT.DX10){let i=new Uint32Array(s,it.MAGIC_SIZE+it.HEADER_SIZE,it.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(i[it.HEADER_DX10_FIELDS.MISC_FLAG]===it.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(i[it.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===it.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=i[it.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in ze)return ze[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(e in kf)return kf[e];throw new Error(`DDSParser cannot parse texture data with fourCC format ${e}`)}if(t&it.PIXEL_FORMAT_FLAGS.RGB||t&it.PIXEL_FORMAT_FLAGS.RGBA)return aR(r);throw t&it.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):t&it.PIXEL_FORMAT_FLAGS.LUMINANCE||t&it.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):t&it.PIXEL_FORMAT_FLAGS.ALPHA||t&it.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}function aR(r){let t=r[it.HEADER_FIELDS.RGB_BITCOUNT],e=r[it.HEADER_FIELDS.R_BIT_MASK],s=r[it.HEADER_FIELDS.G_BIT_MASK],i=r[it.HEADER_FIELDS.B_BIT_MASK],n=r[it.HEADER_FIELDS.A_BIT_MASK];switch(t){case 32:if(e===255&&s===65280&&i===16711680&&n===4278190080)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(e===16711680&&s===65280&&i===255&&n===4278190080)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(e===1072693248&&s===1047552&&i===1023&&n===3221225472)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(e===65535&&s===4294901760&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(e===4294967295&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(e===31744&&s===992&&i===31&&n===32768)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(e===63488&&s===2016&&i===31&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(e===3840&&s===240&&i===15&&n===61440)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(e===255&&s===0&&i===0&&n===65280)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(e===65535&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(e===255&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2045
|
-
bitCount = ${t}, rBitMask = ${e}, gBitMask = ${s}, aBitMask = ${n}`)}var
|
|
2044
|
+
`,ca=null,Il=class{constructor(){ca||(ca=URL.createObjectURL(new Blob([KB],{type:"application/javascript"}))),this.worker=new Worker(ca)}};Il.revokeObjectURL=function(){ca&&(URL.revokeObjectURL(ca),ca=null)};var kl={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.wasm"};function ZB(r){Object.assign(kl,r)}var Ol,cC={};function QB(r){return Ol||(Ol=new Il().worker,Ol.onmessage=t=>{let{success:e,url:s,textureOptions:i}=t.data;e||console.warn("Failed to load Basis texture",s),cC[s](i)},Ol.postMessage({type:"init",jsUrl:kl.jsUrl,wasmUrl:kl.wasmUrl,supportedTextures:r})),Ol}function q2(r,t){let e=QB(t);return new Promise(s=>{cC[r]=s,e.postMessage({type:"load",url:r})})}var JB={extension:{type:m.LoadParser,priority:Lt.High,name:"loadBasis"},name:"loadBasis",id:"basis",test(r){return Xt(r,[".basis"])},async load(r,t,e){let s=await Ss(),i=await q2(r,s),n=new Gr({...i,resolution:t.data?.resolution||We(r)});return Ve(n,e,r)},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};function tR(r,t){let e=r.getNumImages(),s=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<s;++o)for(let a=0;a<e;++a){let u=r.getImageTranscodedSizeInBytes(a,o,t),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,t,1,0))throw new Error("transcodeImage failed");n.push(l)}return n}var eR={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};function rR(r){let t=eR[r];if(t)return t;throw new Error(`Unsupported transcoderFormat: ${r}`)}var sR={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},iR={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},K2=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(K2||{}),Z2=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(Z2||{});function fe(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var qe=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=fe("UYVY")]="UYVY",r[r.R8G8_B8G8=fe("RGBG")]="R8G8_B8G8",r[r.YUY2=fe("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=fe("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=fe("DXT1")]="DXT1",r[r.DXT2=fe("DXT2")]="DXT2",r[r.DXT3=fe("DXT3")]="DXT3",r[r.DXT4=fe("DXT4")]="DXT4",r[r.DXT5=fe("DXT5")]="DXT5",r[r.ATI1=fe("ATI1")]="ATI1",r[r.AT1N=fe("AT1N")]="AT1N",r[r.ATI2=fe("ATI2")]="ATI2",r[r.AT2N=fe("AT2N")]="AT2N",r[r.BC4U=fe("BC4U")]="BC4U",r[r.BC4S=fe("BC4S")]="BC4S",r[r.BC5U=fe("BC5U")]="BC5U",r[r.BC5S=fe("BC5S")]="BC5S",r[r.DX10=fe("DX10")]="DX10",r))(qe||{}),kf={[qe.DXT1]:"bc1-rgba-unorm",[qe.DXT2]:"bc2-rgba-unorm",[qe.DXT3]:"bc2-rgba-unorm",[qe.DXT4]:"bc3-rgba-unorm",[qe.DXT5]:"bc3-rgba-unorm",[qe.ATI1]:"bc4-r-unorm",[qe.BC4U]:"bc4-r-unorm",[qe.BC4S]:"bc4-r-snorm",[qe.ATI2]:"bc5-rg-unorm",[qe.BC5U]:"bc5-rg-unorm",[qe.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},ze={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},it={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:sR,HEADER_DX10_FIELDS:iR,DXGI_FORMAT:K2,D3D10_RESOURCE_DIMENSION:Z2,D3DFMT:qe},Q2={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};ir();C();function J2(r,t){let{format:e,fourCC:s,width:i,height:n,dataOffset:o,mipmapCount:a}=oR(r);if(!t.includes(e))throw new Error(`Unsupported texture format: ${s} ${e}, supported: ${t}`);if(a<=1)return{format:e,width:i,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=nR(e,i,n,o,a,r);return{format:e,width:i,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function nR(r,t,e,s,i,n){let o=[],a=Q2[r],u=t,l=e,c=s;for(let h=0;h<i;++h){let d=Math.ceil(Math.max(4,u)/4)*4,f=Math.ceil(Math.max(4,l)/4)*4,p=a?d/4*f/4*a:u*l*4,g=new Uint8Array(n,c,p);o.push(g),c+=p,u=Math.max(u>>1,1),l=Math.max(l>>1,1)}return o}function oR(r){let t=new Uint32Array(r,0,it.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(t[it.HEADER_FIELDS.MAGIC]!==it.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let e=t[it.HEADER_FIELDS.HEIGHT],s=t[it.HEADER_FIELDS.WIDTH],i=Math.max(1,t[it.HEADER_FIELDS.MIPMAP_COUNT]),n=t[it.HEADER_FIELDS.PF_FLAGS],o=t[it.HEADER_FIELDS.FOURCC],a=aR(t,n,o,r),u=it.MAGIC_SIZE+it.HEADER_SIZE+(o===it.D3DFMT.DX10?it.HEADER_DX10_SIZE:0);return{format:a,fourCC:o,width:s,height:e,dataOffset:u,mipmapCount:i}}function aR(r,t,e,s){if(t&it.PIXEL_FORMAT_FLAGS.FOURCC){if(e===it.D3DFMT.DX10){let i=new Uint32Array(s,it.MAGIC_SIZE+it.HEADER_SIZE,it.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(i[it.HEADER_DX10_FIELDS.MISC_FLAG]===it.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(i[it.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===it.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=i[it.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in ze)return ze[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(e in kf)return kf[e];throw new Error(`DDSParser cannot parse texture data with fourCC format ${e}`)}if(t&it.PIXEL_FORMAT_FLAGS.RGB||t&it.PIXEL_FORMAT_FLAGS.RGBA)return uR(r);throw t&it.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):t&it.PIXEL_FORMAT_FLAGS.LUMINANCE||t&it.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):t&it.PIXEL_FORMAT_FLAGS.ALPHA||t&it.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}function uR(r){let t=r[it.HEADER_FIELDS.RGB_BITCOUNT],e=r[it.HEADER_FIELDS.R_BIT_MASK],s=r[it.HEADER_FIELDS.G_BIT_MASK],i=r[it.HEADER_FIELDS.B_BIT_MASK],n=r[it.HEADER_FIELDS.A_BIT_MASK];switch(t){case 32:if(e===255&&s===65280&&i===16711680&&n===4278190080)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(e===16711680&&s===65280&&i===255&&n===4278190080)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(e===1072693248&&s===1047552&&i===1023&&n===3221225472)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(e===65535&&s===4294901760&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(e===4294967295&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(e===31744&&s===992&&i===31&&n===32768)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(e===63488&&s===2016&&i===31&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(e===3840&&s===240&&i===15&&n===61440)return ze[it.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(e===255&&s===0&&i===0&&n===65280)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(e===65535&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(e===255&&s===0&&i===0&&n===0)return ze[it.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2045
|
+
bitCount = ${t}, rBitMask = ${e}, gBitMask = ${s}, aBitMask = ${n}`)}var lR={extension:{type:m.LoadParser,priority:Lt.High,name:"loadDDS"},name:"loadDDS",id:"dds",test(r){return Xt(r,[".dds"])},async load(r,t,e){let s=await Ss(),n=await(await fetch(r)).arrayBuffer(),o=J2(n,s),a=new Gr({...o,resolution:t.data?.resolution||We(r)});return Ve(a,e,r)},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};ir();C();var hC=(r=>(r[r.RGBA8_SNORM=36759]="RGBA8_SNORM",r[r.RGBA=6408]="RGBA",r[r.RGBA8UI=36220]="RGBA8UI",r[r.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",r[r.RGBA8I=36238]="RGBA8I",r[r.RGBA8=32856]="RGBA8",r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",r[r.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",r[r.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",r[r.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",r[r.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",r[r.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",r[r.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",r[r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",r[r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",r[r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",r))(hC||{});var cR={33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},hR=[171,75,84,88,32,49,49,187,13,10,26,10],dR={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},fR=64,pR=67305985,mR={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},gR={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},xR={32819:2,32820:2,33635:2},_R={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},$t={FILE_HEADER_SIZE:fR,FILE_IDENTIFIER:hR,FORMATS_TO_COMPONENTS:gR,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:_R,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:cR,FIELDS:dR,TYPES_TO_BYTES_PER_COMPONENT:mR,TYPES_TO_BYTES_PER_PIXEL:xR,ENDIANNESS:pR};function tv(r,t){let e=new DataView(r);if(!TR(e))throw new Error("Invalid KTX identifier in header");let{littleEndian:s,glType:i,glFormat:n,glInternalFormat:o,pixelWidth:a,pixelHeight:u,numberOfMipmapLevels:l,offset:c}=vR(e),h=$t.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[o];if(!h)throw new Error(`Unknown texture format ${o}`);if(!t.includes(h))throw new Error(`Unsupported texture format: ${h}, supportedFormats: ${t}`);let d=yR(i,n,o),f=bR(e,i,d,a,u,c,l,s);return{format:h,width:a,height:u,resource:f,alphaMode:"no-premultiply-alpha"}}function bR(r,t,e,s,i,n,o,a){let u=s+3&-4,l=i+3&-4,c=s*i;t===0&&(c=u*l);let h=c*e,d=s,f=i,p=u,g=l,_=n,b=new Array(o);for(let y=0;y<o;y++){let v=r.getUint32(_,a),T=_+4;b[y]=new Uint8Array(r.buffer,T,h),T+=h,_+=v+4,_=_%4!==0?_+4-_%4:_,d=d>>1||1,f=f>>1||1,p=d+4-1&-4,g=f+4-1&-4,h=p*g*e}return b}function yR(r,t,e){let s=$t.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[e];if(r!==0&&($t.TYPES_TO_BYTES_PER_COMPONENT[r]?s=$t.TYPES_TO_BYTES_PER_COMPONENT[r]*$t.FORMATS_TO_COMPONENTS[t]:s=$t.TYPES_TO_BYTES_PER_PIXEL[r]),s===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");return s}function vR(r){let t=r.getUint32($t.FIELDS.ENDIANNESS,!0)===$t.ENDIANNESS,e=r.getUint32($t.FIELDS.GL_TYPE,t),s=r.getUint32($t.FIELDS.GL_FORMAT,t),i=r.getUint32($t.FIELDS.GL_INTERNAL_FORMAT,t),n=r.getUint32($t.FIELDS.PIXEL_WIDTH,t),o=r.getUint32($t.FIELDS.PIXEL_HEIGHT,t)||1,a=r.getUint32($t.FIELDS.PIXEL_DEPTH,t)||1,u=r.getUint32($t.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,t)||1,l=r.getUint32($t.FIELDS.NUMBER_OF_FACES,t),c=r.getUint32($t.FIELDS.NUMBER_OF_MIPMAP_LEVELS,t),h=r.getUint32($t.FIELDS.BYTES_OF_KEY_VALUE_DATA,t);if(o===0||a!==1)throw new Error("Only 2D textures are supported");if(l!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");return{littleEndian:t,glType:e,glFormat:s,glInternalFormat:i,pixelWidth:n,pixelHeight:o,numberOfMipmapLevels:c,offset:$t.FILE_HEADER_SIZE+h}}function TR(r){for(let t=0;t<$t.FILE_IDENTIFIER.length;t++)if(r.getUint8(t)!==$t.FILE_IDENTIFIER[t])return!1;return!0}var SR={extension:{type:m.LoadParser,priority:Lt.High,name:"loadKTX"},name:"loadKTX",id:"ktx",test(r){return Xt(r,".ktx")},async load(r,t,e){let s=await Ss(),n=await(await fetch(r)).arrayBuffer(),o=tv(n,s),a=new Gr({...o,resolution:t.data?.resolution||We(r)});return Ve(a,e,r)},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};ir();C();var ER=`(function () {
|
|
2046
2046
|
'use strict';
|
|
2047
2047
|
|
|
2048
2048
|
const converters = {
|
|
@@ -2292,7 +2292,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};JE.defaultOptio
|
|
|
2292
2292
|
});
|
|
2293
2293
|
|
|
2294
2294
|
})();
|
|
2295
|
-
`,
|
|
2295
|
+
`,ha=null,Ll=class{constructor(){ha||(ha=URL.createObjectURL(new Blob([ER],{type:"application/javascript"}))),this.worker=new Worker(ha)}};Ll.revokeObjectURL=function(){ha&&(URL.revokeObjectURL(ha),ha=null)};var Nl={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.wasm"};function CR(r){Object.assign(Nl,r)}var Hl,dC={},fC={};function AR(r){return Hl||(Hl=new Ll().worker,Hl.onmessage=t=>{let{err:e,success:s,url:i,textureOptions:n}=t.data;if(e){fC[i](e);return}s||console.warn("Failed to load KTX texture",i),dC[i](n)},Hl.postMessage({type:"init",jsUrl:Nl.jsUrl,wasmUrl:Nl.wasmUrl,supportedTextures:r})),Hl}function ev(r,t){let e=AR(t);return new Promise((s,i)=>{dC[r]=s,fC[r]=i,e.postMessage({type:"load",url:r})})}var wR={extension:{type:m.LoadParser,priority:Lt.High,name:"loadKTX2"},name:"loadKTX2",id:"ktx2",test(r){return Xt(r,".ktx2")},async load(r,t,e){let s=await Ss(),i=await ev(r,s),n=new Gr({...i,resolution:t.data?.resolution||We(r)});return Ve(n,e,r)},async unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};var rv={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:pC},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:pC}};function PR(r){let t=r.format;if(rv[t]){let e=rv[t].convertFunction,s=r.resource;for(let i=0;i<s.length;i++)s[i]=e(s[i]);r.format=rv[t].convertedFormat}}function pC(r){let t=r.byteLength/3,e=new Uint32Array(t);for(let s=0;s<t;++s)e[s]=r[s*3]+(r[s*3+1]<<8)+(r[s*3+2]<<16)+4278190080;return new Uint8Array(e.buffer)}function BR(r){let t=[];for(let e=0;e<r.numLevels;e++){let s=r.getImageData(e,0,0),i=new Uint8Array(s.byteLength);i.set(s),t.push(i)}return t}var RR={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};function sv(r){let t=RR[r];if(t)return t;throw new Error(`Unsupported glInternalFormat: ${r}`)}var MR={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};function iv(r){let t=MR[r];if(t)return t;throw new Error(`Unsupported VkFormat: ${r}`)}function DR(r){return r.classId===2?iv(r.vkFormat):sv(r.glInternalformat)}var FR={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};function GR(r){let t=FR[r];if(t)return t;throw new Error(`Unsupported transcoderFormat: ${r}`)}C();Ys();C();var Wl=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],UR={extension:m.ResolveParser,test:r=>Xt(r,[".ktx",".ktx2",".dds"]),parse:r=>{let t,e=r.split(".");if(e.length>2){let s=e[e.length-2];Wl.includes(s)&&(t=s)}else t=e[e.length-1];return{resolution:parseFloat(Ae.RETINA_PREFIX.exec(r)?.[1]??"1"),format:t,src:r}}};var Of,IR={extension:{type:m.DetectionParser,priority:2},test:async()=>!!(await ds()||hs()),add:async r=>{let t=await Ul();return Of=kR(t),[...Of,...r]},remove:async r=>Of?r.filter(t=>!(t in Of)):r};function kR(r){let t=["basis"],e={};return r.forEach(s=>{let i=s.split("-")[0];i&&!e[i]&&(e[i]=!0,t.push(i))}),t.sort((s,i)=>{let n=Wl.indexOf(s),o=Wl.indexOf(i);return n===-1?1:o===-1?-1:n-o}),t}ot();jt();he();pi();var OR=new _t,LR=new F,Vl=new J,nv=class{cull(t,e,s=!0){this._cullRecursive(t,e,s)}_cullRecursive(t,e,s=!0){if(t.cullable&&t.measurable&&t.includeInBuild)if(t.cullArea){Vl.x=e.x,Vl.y=e.y,Vl.width=e.width,Vl.height=e.height;let i=s?t.worldTransform:t.getGlobalTransform(LR,s);t.culled=!Vl.intersects(t.cullArea,i)}else{let i=rs(t,s,OR);t.culled=i.x>=e.x+e.width||i.y>=e.y+e.height||i.x+i.width<=e.x||i.y+i.height<=e.y}else t.culled=!1;if(!(!t.cullableChildren||t.culled||!t.renderable||!t.measurable||!t.includeInBuild))for(let i=0;i<t.children.length;i++)this._cullRecursive(t.children[i],e,s)}};nv.shared=new nv;var ov=nv;C();var Lf=class{static init(t){this._renderRef=this.render.bind(this),this.render=()=>{let e=t?.culler?.updateTransform!==!0;ov.shared.cull(this.stage,this.renderer.screen,e),this.renderer.render({container:this.stage})}}static destroy(){this.render=this._renderRef}};Lf.extension={priority:10,type:m.Application,name:"culler"};var oA=N1(nA(),1),gM={createCanvas:(r,t)=>new OffscreenCanvas(r??0,t??0),createImage:()=>new Image,getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new oA.DOMParser().parseFromString(r,"text/xml")};Oe();Ye();te();Sr();Nn();var Ev=`
|
|
2296
2296
|
in vec2 vTextureCoord;
|
|
2297
2297
|
|
|
2298
2298
|
out vec4 finalColor;
|
|
@@ -2304,7 +2304,7 @@ void main()
|
|
|
2304
2304
|
{
|
|
2305
2305
|
finalColor = texture(uTexture, vTextureCoord) * uAlpha;
|
|
2306
2306
|
}
|
|
2307
|
-
`;var
|
|
2307
|
+
`;var Jf=`struct GlobalFilterUniforms {
|
|
2308
2308
|
uInputSize:vec4<f32>,
|
|
2309
2309
|
uInputPixel:vec4<f32>,
|
|
2310
2310
|
uInputClamp:vec4<f32>,
|
|
@@ -2372,9 +2372,9 @@ fn mainFragment(
|
|
|
2372
2372
|
var sample = textureSample(uTexture, uSampler, uv);
|
|
2373
2373
|
|
|
2374
2374
|
return sample * alphaUniforms.uAlpha;
|
|
2375
|
-
}`;var
|
|
2376
|
-
`);function
|
|
2377
|
-
`}return
|
|
2375
|
+
}`;var aA=class uA extends ae{constructor(t){t={...uA.defaultOptions,...t};let e=Mt.from({vertex:{source:Jf,entryPoint:"mainVertex"},fragment:{source:Jf,entryPoint:"mainFragment"}}),s=Rt.from({vertex:ls,fragment:Ev,name:"alpha-filter"}),{alpha:i,...n}=t,o=new dt({uAlpha:{value:i,type:"f32"}});super({...n,gpuProgram:e,glProgram:s,resources:{alphaUniforms:o}})}get alpha(){return this.resources.alphaUniforms.uniforms.uAlpha}set alpha(t){this.resources.alphaUniforms.uniforms.uAlpha=t}};aA.defaultOptions={alpha:1};var xM=aA;_r();Pe();xt();Sr();_r();Pe();Sr();Oe();var ec={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]};var _M=["in vec2 vBlurTexCoords[%size%];","uniform sampler2D uTexture;","out vec4 finalColor;","void main(void)","{"," %blur%","}"].join(`
|
|
2376
|
+
`);function Cv(r){let t=ec[r],e=t.length,s="",i="finalColor = ",n=" + ",o="texture(uTexture, vBlurTexCoords[%index%]) * %value%";for(let a=0;a<r;a++){let u=a===0?i:n,l=a<e?a:r-a-1,c=o.replace("%index%",a.toString()).replace("%value%",t[l].toString());s+=`${u}${c}
|
|
2377
|
+
`}return _M.replace("%blur%",`${s};`).replace("%size%",r.toString())}var bM=`
|
|
2378
2378
|
in vec2 aPosition;
|
|
2379
2379
|
|
|
2380
2380
|
uniform float uStrength;
|
|
@@ -2408,8 +2408,8 @@ fn mainFragment(
|
|
|
2408
2408
|
|
|
2409
2409
|
vec2 textureCoord = filterTextureCoord();
|
|
2410
2410
|
%blur%
|
|
2411
|
-
}`;function
|
|
2412
|
-
`}return s=s.replace("%blur%",i),s=s.replace("%size%",r.toString()),s=s.replace("%dimension%",t?"z":"w"),s}function
|
|
2411
|
+
}`;function Av(r,t){let e=Math.ceil(r/2),s=bM,i="",n;t?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * pixelStrength);";for(let o=0;o<r;o++){let a=n.replace("%index%",o.toString());a=a.replace("%sampleIndex%",`${o-(e-1)}.0`),i+=a,i+=`
|
|
2412
|
+
`}return s=s.replace("%blur%",i),s=s.replace("%size%",r.toString()),s=s.replace("%dimension%",t?"z":"w"),s}function wv(r,t){let e=Av(t,r),s=Cv(t);return Rt.from({vertex:e,fragment:s,name:`blur-${r?"horizontal":"vertical"}-pass-filter`})}Ye();var Pv=`
|
|
2413
2413
|
|
|
2414
2414
|
struct GlobalFilterUniforms {
|
|
2415
2415
|
uInputSize:vec4<f32>,
|
|
@@ -2489,10 +2489,10 @@ fn mainFragment(
|
|
|
2489
2489
|
|
|
2490
2490
|
return finalColor;
|
|
2491
2491
|
}
|
|
2492
|
-
`;function
|
|
2492
|
+
`;function Bv(r,t){let e=ec[t],s=e.length,i=[],n=[],o=[];for(let h=0;h<t;h++){i[h]=`@location(${h}) offset${h}: vec2<f32>,`,r?n[h]=`filteredCord + vec2(${h-s+1} * pixelStrength, 0.0),`:n[h]=`filteredCord + vec2(0.0, ${h-s+1} * pixelStrength),`;let d=h<s?h:t-h-1,f=e[d].toString();o[h]=`finalColor += textureSample(uTexture, uSampler, offset${h}) * ${f};`}let a=i.join(`
|
|
2493
2493
|
`),u=n.join(`
|
|
2494
2494
|
`),l=o.join(`
|
|
2495
|
-
`),c=
|
|
2495
|
+
`),c=Pv.replace("%blur-struct%",a).replace("%blur-vertex-out%",u).replace("%blur-fragment-in%",a).replace("%blur-sampling%",l).replace("%dimension%",r?"z":"w");return Mt.from({vertex:{source:c,entryPoint:"mainVertex"},fragment:{source:c,entryPoint:"mainFragment"}})}var lA=class cA extends ae{constructor(t){t={...cA.defaultOptions,...t};let e=wv(t.horizontal,t.kernelSize),s=Bv(t.horizontal,t.kernelSize);super({glProgram:e,gpuProgram:s,resources:{blurUniforms:{uStrength:{value:0,type:"f32"}}},...t}),this.horizontal=t.horizontal,this.legacy=t.legacy??!1,this._quality=0,this.quality=t.quality,this.blur=t.strength,this._blurUniforms=this.resources.blurUniforms,this._uniforms=this._blurUniforms.uniforms}apply(t,e,s,i){this.legacy?this._applyLegacy(t,e,s,i):this._applyOptimized(t,e,s,i)}_applyLegacy(t,e,s,i){if(this._uniforms.uStrength=this.strength/this.passes,this.passes===1)t.applyFilter(this,e,s,i);else{let n=yt.getSameSizeTexture(e),o=e,a=n;this._state.blend=!1;let u=t.renderer.type===Tt.WEBGPU;for(let l=0;l<this.passes-1;l++){t.applyFilter(this,o,a,l===0?!0:u);let c=a;a=o,o=c}this._state.blend=!0,t.applyFilter(this,o,s,i),yt.returnTexture(n)}}_applyOptimized(t,e,s,i){if(this._uniforms.uStrength=this._calculateInitialStrength(),this.passes===1)t.applyFilter(this,e,s,i);else{let n=yt.getSameSizeTexture(e),o=e,a=n;this._state.blend=!1;let u=t.renderer,l=u.type===Tt.WEBGPU,c=l?u.renderPipes.uniformBatch:null;for(let h=0;h<this.passes-1;h++){c&&this.groups[1].setResource(c.getUboResource(this._blurUniforms),0),t.applyFilter(this,o,a,l);let d=a;a=o,o=d,this._uniforms.uStrength*=.5}c&&this.groups[1].setResource(c.getUboResource(this._blurUniforms),0),this._state.blend=!0,t.applyFilter(this,o,s,i),yt.returnTexture(n)}}_calculateInitialStrength(){let t=1,e=.5;for(let s=1;s<this.passes;s++)t+=e*e,e*=.5;return this.strength/Math.sqrt(t)}get blur(){return this.strength}set blur(t){this.padding=1+Math.abs(t)*2,this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}};lA.defaultOptions={strength:8,quality:4,kernelSize:5,legacy:!1};var rc=lA;var tp=class extends ae{constructor(...t){let e=t[0]??{};typeof e=="number"&&(I(V,"BlurFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }"),e={strength:e},t[1]!==void 0&&(e.quality=t[1]),t[2]!==void 0&&(e.resolution=t[2]||"inherit"),t[3]!==void 0&&(e.kernelSize=t[3])),e={...rc.defaultOptions,...e};let{strength:s,strengthX:i,strengthY:n,quality:o,...a}=e;super({...a,compatibleRenderers:Tt.BOTH,resources:{}}),this._repeatEdgePixels=!1,this.blurXFilter=new rc({horizontal:!0,...e}),this.blurYFilter=new rc({horizontal:!1,...e}),this.quality=o,this.strengthX=i??s,this.strengthY=n??s,this.repeatEdgePixels=!1}apply(t,e,s,i){let n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){let a=yt.getSameSizeTexture(e);this.blurXFilter.blendMode="normal",this.blurXFilter.apply(t,e,a,!0),this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(t,a,s,i),yt.returnTexture(a)}else o?(this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(t,e,s,i)):(this.blurXFilter.blendMode=this.blendMode,this.blurXFilter.apply(t,e,s,i))}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.blur),Math.abs(this.blurYFilter.blur))*2}get strength(){if(this.strengthX!==this.strengthY)throw new Error("BlurFilter's strengthX and strengthY are different");return this.strengthX}set strength(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get strengthX(){return this.blurXFilter.blur}set strengthX(t){this.blurXFilter.blur=t,this.updatePadding()}get strengthY(){return this.blurYFilter.blur}set strengthY(t){this.blurYFilter.blur=t,this.updatePadding()}get blur(){return I("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength}set blur(t){I("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength=t}get blurX(){return I("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX}set blurX(t){I("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX=t}get blurY(){return I("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY}set blurY(t){I("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}};tp.defaultOptions={strength:8,quality:4,kernelSize:5,legacy:!1};It();Oe();Ye();te();Sr();Nn();var Rv=`
|
|
2496
2496
|
in vec2 vTextureCoord;
|
|
2497
2497
|
in vec4 vColor;
|
|
2498
2498
|
|
|
@@ -2556,7 +2556,7 @@ void main()
|
|
|
2556
2556
|
|
|
2557
2557
|
finalColor = vec4(rgb, result.a);
|
|
2558
2558
|
}
|
|
2559
|
-
`;var
|
|
2559
|
+
`;var ep=`struct GlobalFilterUniforms {
|
|
2560
2560
|
uInputSize:vec4<f32>,
|
|
2561
2561
|
uInputPixel:vec4<f32>,
|
|
2562
2562
|
uInputClamp:vec4<f32>,
|
|
@@ -2664,7 +2664,7 @@ fn mainFragment(
|
|
|
2664
2664
|
rgb.b *= result.a;
|
|
2665
2665
|
|
|
2666
2666
|
return vec4(rgb, result.a);
|
|
2667
|
-
}`;var
|
|
2667
|
+
}`;var Mv=class extends ae{constructor(t={}){let e=new dt({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),s=Mt.from({vertex:{source:ep,entryPoint:"mainVertex"},fragment:{source:ep,entryPoint:"mainFragment"}}),i=Rt.from({vertex:ls,fragment:Rv,name:"color-matrix-filter"});super({...t,gpuProgram:s,glProgram:i,resources:{colorMatrixUniforms:e}}),this.alpha=1}_loadMatrix(t,e=!1){if(e){let s=[...t];this._multiply(s,this.matrix,t),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=s}else this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t;this.resources.colorMatrixUniforms.update()}_multiply(t,e,s){return t[0]=e[0]*s[0]+e[1]*s[5]+e[2]*s[10]+e[3]*s[15],t[1]=e[0]*s[1]+e[1]*s[6]+e[2]*s[11]+e[3]*s[16],t[2]=e[0]*s[2]+e[1]*s[7]+e[2]*s[12]+e[3]*s[17],t[3]=e[0]*s[3]+e[1]*s[8]+e[2]*s[13]+e[3]*s[18],t[4]=e[0]*s[4]+e[1]*s[9]+e[2]*s[14]+e[3]*s[19]+e[4],t[5]=e[5]*s[0]+e[6]*s[5]+e[7]*s[10]+e[8]*s[15],t[6]=e[5]*s[1]+e[6]*s[6]+e[7]*s[11]+e[8]*s[16],t[7]=e[5]*s[2]+e[6]*s[7]+e[7]*s[12]+e[8]*s[17],t[8]=e[5]*s[3]+e[6]*s[8]+e[7]*s[13]+e[8]*s[18],t[9]=e[5]*s[4]+e[6]*s[9]+e[7]*s[14]+e[8]*s[19]+e[9],t[10]=e[10]*s[0]+e[11]*s[5]+e[12]*s[10]+e[13]*s[15],t[11]=e[10]*s[1]+e[11]*s[6]+e[12]*s[11]+e[13]*s[16],t[12]=e[10]*s[2]+e[11]*s[7]+e[12]*s[12]+e[13]*s[17],t[13]=e[10]*s[3]+e[11]*s[8]+e[12]*s[13]+e[13]*s[18],t[14]=e[10]*s[4]+e[11]*s[9]+e[12]*s[14]+e[13]*s[19]+e[14],t[15]=e[15]*s[0]+e[16]*s[5]+e[17]*s[10]+e[18]*s[15],t[16]=e[15]*s[1]+e[16]*s[6]+e[17]*s[11]+e[18]*s[16],t[17]=e[15]*s[2]+e[16]*s[7]+e[17]*s[12]+e[18]*s[17],t[18]=e[15]*s[3]+e[16]*s[8]+e[17]*s[13]+e[18]*s[18],t[19]=e[15]*s[4]+e[16]*s[9]+e[17]*s[14]+e[18]*s[19]+e[19],t}brightness(t,e){let s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}tint(t,e){let[s,i,n]=X.shared.setValue(t).toArray(),o=[s,0,0,0,0,0,i,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,e)}greyscale(t,e){let s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}grayscale(t,e){this.greyscale(t,e)}blackAndWhite(t){let e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)}hue(t,e){t=(t||0)/180*Math.PI;let s=Math.cos(t),i=Math.sin(t),n=Math.sqrt,o=1/3,a=n(o),u=s+(1-s)*o,l=o*(1-s)-a*i,c=o*(1-s)+a*i,h=o*(1-s)+a*i,d=s+o*(1-s),f=o*(1-s)-a*i,p=o*(1-s)-a*i,g=o*(1-s)+a*i,_=s+o*(1-s),b=[u,l,c,0,0,h,d,f,0,0,p,g,_,0,0,0,0,0,1,0];this._loadMatrix(b,e)}contrast(t,e){let s=(t||0)+1,i=-.5*(s-1),n=[s,0,0,0,i,0,s,0,0,i,0,0,s,0,i,0,0,0,1,0];this._loadMatrix(n,e)}saturate(t=0,e){let s=t*2/3+1,i=(s-1)*-.5,n=[s,i,i,0,0,i,s,i,0,0,i,i,s,0,0,0,0,0,1,0];this._loadMatrix(n,e)}desaturate(){this.saturate(-1)}negative(t){let e=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(e,t)}sepia(t){let e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)}technicolor(t){let e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,.046249425232852304,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-.2758903984886823,-.231103377548616,-.7501899197440212,1.847597816108189,0,.12137623870388682,0,0,0,1,0];this._loadMatrix(e,t)}polaroid(t){let e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)}toBGR(t){let e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)}kodachrome(t){let e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,.24991995145868634,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,.09698983488904393,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,.13972481597886063,0,0,0,1,0];this._loadMatrix(e,t)}browni(t){let e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,.1860075629647401,-.037703249837783157,.8609577587992641,.15059552388459913,0,-.14497417640467167,.24113635128153335,-.07441037908422492,.44972182064877153,0,-.029655197167024642,0,0,0,1,0];this._loadMatrix(e,t)}vintage(t){let e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,.037848179746251466,.02578397704808868,.6441188644374771,.03259127616149294,0,.029265996770472907,.0466055556782719,-.0851232987247891,.5241648018700465,0,.020232119953863904,0,0,0,1,0];this._loadMatrix(e,t)}colorTone(t,e,s,i,n){t||(t=.2),e||(e=.15),s||(s=16770432),i||(i=3375104);let o=X.shared,[a,u,l]=o.setValue(s).toArray(),[c,h,d]=o.setValue(i).toArray(),f=[.3,.59,.11,0,0,a,u,l,t,0,c,h,d,e,0,a-c,u-h,l-d,0,0];this._loadMatrix(f,n)}night(t,e){t||(t=.1);let s=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(s,e)}predator(t,e){let s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,e)}lsd(t){let e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)}reset(){let t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.resources.colorMatrixUniforms.uniforms.uColorMatrix}set matrix(t){this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t}get alpha(){return this.resources.colorMatrixUniforms.uniforms.uAlpha}set alpha(t){this.resources.colorMatrixUniforms.uniforms.uAlpha=t}};ot();Ue();Oe();Ye();te();js();xt();Sr();var Dv=`
|
|
2668
2668
|
in vec2 vTextureCoord;
|
|
2669
2669
|
in vec2 vFilterUv;
|
|
2670
2670
|
|
|
@@ -2686,7 +2686,7 @@ void main()
|
|
|
2686
2686
|
|
|
2687
2687
|
finalColor = texture(uTexture, clamp(vTextureCoord + offset, uInputClamp.xy, uInputClamp.zw));
|
|
2688
2688
|
}
|
|
2689
|
-
`;var
|
|
2689
|
+
`;var Fv=`in vec2 aPosition;
|
|
2690
2690
|
out vec2 vTextureCoord;
|
|
2691
2691
|
out vec2 vFilterUv;
|
|
2692
2692
|
|
|
@@ -2724,7 +2724,7 @@ void main(void)
|
|
|
2724
2724
|
vTextureCoord = filterTextureCoord();
|
|
2725
2725
|
vFilterUv = getFilterCoord();
|
|
2726
2726
|
}
|
|
2727
|
-
`;var
|
|
2727
|
+
`;var rp=`
|
|
2728
2728
|
struct GlobalFilterUniforms {
|
|
2729
2729
|
uInputSize:vec4<f32>,
|
|
2730
2730
|
uInputPixel:vec4<f32>,
|
|
@@ -2811,7 +2811,7 @@ fn mainFragment(
|
|
|
2811
2811
|
var offset = gfu.uInputSize.zw * (filterUniforms.uRotation * (map.xy - 0.5)) * filterUniforms.uScale;
|
|
2812
2812
|
|
|
2813
2813
|
return textureSample(uTexture, uSampler, clamp(uv + offset, gfu.uInputClamp.xy, gfu.uInputClamp.zw));
|
|
2814
|
-
}`;var
|
|
2814
|
+
}`;var Gv=class extends ae{constructor(...t){let e=t[0];e instanceof we&&(t[1]&&I(V,"DisplacementFilter now uses options object instead of params. {sprite, scale}"),e={sprite:e,scale:t[1]});let{sprite:s,scale:i,...n}=e,o=i??20;typeof o=="number"&&(o=new nt(o,o));let a=new dt({uFilterMatrix:{value:new F,type:"mat3x3<f32>"},uScale:{value:o,type:"vec2<f32>"},uRotation:{value:new Float32Array([0,0,0,0]),type:"mat2x2<f32>"}}),u=Rt.from({vertex:Fv,fragment:Dv,name:"displacement-filter"}),l=Mt.from({vertex:{source:rp,entryPoint:"mainVertex"},fragment:{source:rp,entryPoint:"mainFragment"}}),c=s.texture.source;super({...n,gpuProgram:l,glProgram:u,resources:{filterUniforms:a,uMapTexture:c,uMapSampler:c.style}}),this._sprite=e.sprite,this._sprite.renderable=!1}apply(t,e,s,i){let n=this.resources.filterUniforms.uniforms;t.calculateSpriteMatrix(n.uFilterMatrix,this._sprite);let o=this._sprite.worldTransform,a=Math.sqrt(o.a*o.a+o.b*o.b),u=Math.sqrt(o.c*o.c+o.d*o.d);a!==0&&u!==0&&(n.uRotation[0]=o.a/a,n.uRotation[1]=o.b/a,n.uRotation[2]=o.c/u,n.uRotation[3]=o.d/u),this.resources.uMapTexture=this._sprite.texture.source,t.applyFilter(this,e,s,i)}get scale(){return this.resources.filterUniforms.uniforms.uScale}};Oe();Ye();te();Sr();Nn();var Uv=`
|
|
2815
2815
|
in vec2 vTextureCoord;
|
|
2816
2816
|
in vec4 vColor;
|
|
2817
2817
|
|
|
@@ -2846,7 +2846,7 @@ void main()
|
|
|
2846
2846
|
|
|
2847
2847
|
finalColor = color;
|
|
2848
2848
|
}
|
|
2849
|
-
`;var
|
|
2849
|
+
`;var sp=`
|
|
2850
2850
|
|
|
2851
2851
|
struct GlobalFilterUniforms {
|
|
2852
2852
|
uInputSize:vec4<f32>,
|
|
@@ -2945,7 +2945,7 @@ fn mainFragment(
|
|
|
2945
2945
|
sample.b *= sample.a;
|
|
2946
2946
|
|
|
2947
2947
|
return sample;
|
|
2948
|
-
}`;var
|
|
2948
|
+
}`;var hA=class dA extends ae{constructor(t={}){t={...dA.defaultOptions,...t};let e=Mt.from({vertex:{source:sp,entryPoint:"mainVertex"},fragment:{source:sp,entryPoint:"mainFragment"}}),s=Rt.from({vertex:ls,fragment:Uv,name:"noise-filter"}),{noise:i,seed:n,...o}=t;super({...o,gpuProgram:e,glProgram:s,resources:{noiseUniforms:new dt({uNoise:{value:1,type:"f32"},uSeed:{value:1,type:"f32"}})}}),this.noise=i,this.seed=n??Math.random()}get noise(){return this.resources.noiseUniforms.uniforms.uNoise}set noise(t){this.resources.noiseUniforms.uniforms.uNoise=t}get seed(){return this.resources.noiseUniforms.uniforms.uSeed}set seed(t){this.resources.noiseUniforms.uniforms.uSeed=t}};hA.defaultOptions={noise:.5};var yM=hA;var vM=`fn getLuminosity(c: vec3<f32>) -> f32 {
|
|
2949
2949
|
return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
|
|
2950
2950
|
}
|
|
2951
2951
|
|
|
@@ -3016,7 +3016,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3016
3016
|
}
|
|
3017
3017
|
|
|
3018
3018
|
return result;
|
|
3019
|
-
}`;_e();Vs();is();var dA=class fA{constructor(t){this._tick=()=>{this._destroyed||(this.timeout=setTimeout(this._processQueue,0))},this._processQueue=()=>{if(this._destroyed)return;let{queue:e}=this,s=0;for(;e.length&&s<fA.uploadsPerFrame;){let i=e.shift();this.uploadQueueItem(i),s++}e.length?Gt.system.addOnce(this._tick,this,Se.UTILITY):this._resolve()},this.renderer=t,this.queue=[],this.resolves=[]}getQueue(){return[...this.queue]}add(t){let e=Array.isArray(t)?t:[t];for(let s of e)s instanceof lt?this._addContainer(s):this.resolveQueueItem(s,this.queue);return this}_addContainer(t){this.resolveQueueItem(t,this.queue);for(let e of t.children)this._addContainer(e)}upload(t){return t&&this.add(t),new Promise(e=>{this.queue.length?(this.resolves.push(e),this.dedupeQueue(),Gt.system.addOnce(this._tick,this,Se.UTILITY)):e()})}dedupeQueue(){let t=Object.create(null),e=0;for(let s=0;s<this.queue.length;s++){let i=this.queue[s];t[i.uid]||(t[i.uid]=!0,this.queue[e++]=i)}this.queue.length=e}destroy(){this._destroyed=!0,clearTimeout(this.timeout)}_resolve(){let{resolves:t}=this,e=t.slice(0);t.length=0;for(let s of e)s()}};dA.uploadsPerFrame=4;var Gv=dA;Wt();ht();_e();bl();li();Ym();Qs();je();ht();xt();br();cs();Hr();Qs();xt();var pA=class mA extends Ne{constructor(...t){let e=t[0]??{};e instanceof Float32Array&&(I(V,"use new MeshGeometry({ positions, uvs, indices }) instead"),e={positions:e,uvs:t[1],indices:t[2]}),e={...mA.defaultOptions,...e};let s=e.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=e.uvs;i||(e.positions?i=new Float32Array(s.length):i=new Float32Array([0,0,1,0,1,1,0,1]));let n=e.indices||new Uint32Array([0,1,2,0,2,3]),o=e.shrinkBuffersToFit,a=new zt({data:s,label:"attribute-mesh-positions",shrinkToFit:o,usage:ct.VERTEX|ct.COPY_DST}),u=new zt({data:i,label:"attribute-mesh-uvs",shrinkToFit:o,usage:ct.VERTEX|ct.COPY_DST}),l=new zt({data:n,label:"index-mesh-buffer",shrinkToFit:o,usage:ct.INDEX|ct.COPY_DST});super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:8,offset:0},aUV:{buffer:u,format:"float32x2",stride:8,offset:0}},indexBuffer:l,topology:e.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(t){this.attributes.aPosition.buffer.data=t}get uvs(){return this.attributes.aUV.buffer.data}set uvs(t){this.attributes.aUV.buffer.data=t}get indices(){return this.indexBuffer.data}set indices(t){this.indexBuffer.data=t}};pA.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};var Xe=pA;C();C();ot();us();te();Qn();Xi();var Ps=class{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(t){this._topology=t}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(t){this.texture!==t&&(this.texture=t,this._textureMatrixUpdateId=-1)}get uvs(){let e=this.geometry.getBuffer("aUV"),s=e.data,i=s,n=this.texture.textureMatrix;return n.isSimple||(i=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==e._updateID)&&((!i||i.length<s.length)&&(i=this._transformedUvs=new Float32Array(s.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=e._updateID,n.multiplyUvs(s,i))),i}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};var sc=class{destroy(){}},ba=class{constructor(t,e){this.localUniforms=new dt({uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new oe({0:this.localUniforms}),this.renderer=t,this._adaptor=e,this._adaptor.init()}validateRenderable(t){let e=this._getMeshData(t),s=e.batched,i=t.batched;if(e.batched=i,s!==i)return!0;if(i){let n=t._geometry;if(n.indices.length!==e.indexSize||n.positions.length!==e.vertexSize)return e.indexSize=n.indices.length,e.vertexSize=n.positions.length,!0;let o=this._getBatchableMesh(t);return o.texture.uid!==t._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,t._texture)}return!1}addRenderable(t,e){let s=this.renderer.renderPipes.batch,i=this._getMeshData(t);if(t.didViewUpdate&&(i.indexSize=t._geometry.indices?.length,i.vertexSize=t._geometry.positions?.length),i.batched){let n=this._getBatchableMesh(t);n.setTexture(t._texture),n.geometry=t._geometry,s.addToBatch(n,e)}else s.break(e),e.add(t)}updateRenderable(t){if(t.batched){let e=this._getBatchableMesh(t);e.setTexture(t._texture),e.geometry=t._geometry,e._batcher.updateElement(e)}}execute(t){if(!t.isRenderable)return;t.state.blendMode=Wr(t.groupBlendMode,t.texture._source);let e=this.localUniforms;e.uniforms.uTransformMatrix=t.groupTransform,e.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,e.update(),Mr(t.groupColorAlpha,e.uniforms.uColor,0),this._adaptor.execute(this,t)}_getMeshData(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new sc),t._gpuData[this.renderer.uid].meshData||this._initMeshData(t)}_initMeshData(t){return t._gpuData[this.renderer.uid].meshData={batched:t.batched,indexSize:0,vertexSize:0},t._gpuData[this.renderer.uid].meshData}_getBatchableMesh(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new sc),t._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(t)}_initBatchableMesh(t){let e=new Ps;return e.renderable=t,e.setTexture(t._texture),e.transform=t.groupTransform,e.roundPixels=this.renderer._roundPixels|t._roundPixels,t._gpuData[this.renderer.uid].batchableMesh=e,e}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}};ba.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"mesh"};O.add(ba);var or=class extends Jt{constructor(...t){let e=t[0];e instanceof Ne&&(I(V,"Mesh: use new Mesh({ geometry, shader }) instead"),e={geometry:e,shader:t[1]},t[3]&&(I(V,"Mesh: drawMode argument has been removed, use geometry.topology instead"),e.geometry.topology=t[3]));let{geometry:s,shader:i,texture:n,roundPixels:o,state:a,...u}=e;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=!1,this.shader=i??null,this.texture=n??i?.texture??D.WHITE,this.state=a??Ut.for2d(),this._geometry=s,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??!1}get material(){return I(V,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(t){this._shader!==t&&(this._shader=t,this.onViewUpdate())}get shader(){return this._shader}set geometry(t){this._geometry!==t&&(this._geometry?.off("update",this.onViewUpdate,this),t.on("update",this.onViewUpdate,this),this._geometry=t,this.onViewUpdate())}get geometry(){return this._geometry}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=t),this._texture=t,this.onViewUpdate())}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?!1:this._geometry instanceof Xe?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":!1}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds}containsPoint(t){let{x:e,y:s}=t;if(!this.bounds.containsPoint(e,s))return!1;let i=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(ah(e,s,i[l],i[l+1],i[c],i[c+1],i[h],i[h+1]))return!0}}else{let o=i.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(ah(e,s,i[u],i[u+1],i[l],i[l+1],i[c],i[c+1]))return!0}}return!1}destroy(t){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null}};Ys();ht();Vs();is();Ys();var ic=class r extends we{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});let{animationSpeed:s=1,autoPlay:i=!1,autoUpdate:n=!0,loop:o=!0,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=!1,...d}=e,[f]=c;super({...d,texture:f instanceof D?f:f.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=!1,this.animationSpeed=s,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,i&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Gt.shared.add(this.update,this,Se.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;let e=t.deltaTime,s=this.animationSpeed*e,i=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=s/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=s;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()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i||this.animationSpeed<0&&this.currentFrame>i)&&this.onLoop(),this._updateTexture())}_updateTexture(){let t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t=!1){if(typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._textures.forEach(i=>{this.texture!==i&&i.destroy(s)})}this._textures=[],this._durations=null,this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){let e=[];for(let s=0;s<t.length;++s)e.push(D.from(t[s]));return new r(e)}static fromImages(t){let e=[];for(let s=0;s<t.length;++s)e.push(D.from(t[s]));return new r(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof D)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].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}.`);let e=this.currentFrame;this._currentTime=t,e!==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?(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Gt.shared.add(this.update,this),this._isConnectedToTicker=!0))}};Tr();Gs();ht();xt();ot();Gs();var nc=class{constructor({matrix:t,observer:e}={}){this.dirty=!0,this._matrix=t??new F,this.observer=e,this.position=new Et(this,0,0),this.scale=new Et(this,1,1),this.pivot=new Et(this,0,0),this.skew=new Et(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1}get matrix(){let t=this._matrix;return this.dirty&&(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.dirty=!1),t}_onUpdate(t){this.dirty=!0,t===this.skew&&this.updateSkew(),this.observer?._onUpdate(this)}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.dirty=!0}toString(){return`[pixi.js/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}) ]`}setFromMatrix(t){t.decompose(this),this.dirty=!0}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this.skew))}};br();C();C();ot();Ue();Lr();Os();ks();var sp=new F,Bs=new F,Kr=[new nt,new nt,new nt,new nt],ya=class{constructor(t){this._renderer=t}validateRenderable(t){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){let e=this._renderer,s=e.canvasContext,i=s.activeContext;i.save(),s.setBlendMode(t.groupBlendMode);let n=e.globalUniforms.globalUniformData?.worldColor??4294967295,o=t.groupColorAlpha,a=(n>>>24&255)/255,u=(o>>>24&255)/255,l=e.filter?.alphaMultiplier??1,c=a*u*l;if(c<=0){i.restore();return}i.globalAlpha=c;let h=n&16777215,d=o&16777215,f=Te(Ie(d,h)),p=t.texture,g=Z.getTintedPattern(p,f),_=t.width,b=t.height,y=t.groupTransform,v=p.source._resolution??p.source.resolution??1;Bs.copyFrom(t._tileTransform.matrix),t.applyAnchorToTexture||Bs.translate(-t.anchor.x*_,-t.anchor.y*b);let T=Bs.tx,S=Bs.ty;Bs.scale(1/v,1/v),Bs.tx=T,Bs.ty=S,sp.identity(),sp.prepend(Bs),sp.prepend(y);let E=e._roundPixels|t._roundPixels;s.setContextTransform(sp,E===1),i.fillStyle=g;let w=t.anchor.x*-_,M=t.anchor.y*-b;Kr[0].set(w,M),Kr[1].set(w+_,M),Kr[2].set(w+_,M+b),Kr[3].set(w,M+b);for(let P=0;P<4;P++)Bs.applyInverse(Kr[P],Kr[P]);i.beginPath(),i.moveTo(Kr[0].x,Kr[0].y);for(let P=1;P<4;P++)i.lineTo(Kr[P].x,Kr[P].y);i.closePath(),i.fill(),i.restore()}destroy(){this._renderer=null}};ya.extension={type:[m.CanvasPipes],name:"tilingSprite"};C();Qn();je();Pe();ye();Xi();ot();fs();Wi();ps();lr();te();ht();var Uv={name:"tiling-bit",vertex:{header:`
|
|
3019
|
+
}`;_e();zs();is();var fA=class pA{constructor(t){this._tick=()=>{this._destroyed||(this.timeout=setTimeout(this._processQueue,0))},this._processQueue=()=>{if(this._destroyed)return;let{queue:e}=this,s=0;for(;e.length&&s<pA.uploadsPerFrame;){let i=e.shift();this.uploadQueueItem(i),s++}e.length?Gt.system.addOnce(this._tick,this,Se.UTILITY):this._resolve()},this.renderer=t,this.queue=[],this.resolves=[]}getQueue(){return[...this.queue]}add(t){let e=Array.isArray(t)?t:[t];for(let s of e)s instanceof lt?this._addContainer(s):this.resolveQueueItem(s,this.queue);return this}_addContainer(t){this.resolveQueueItem(t,this.queue);for(let e of t.children)this._addContainer(e)}upload(t){return t&&this.add(t),new Promise(e=>{this.queue.length?(this.resolves.push(e),this.dedupeQueue(),Gt.system.addOnce(this._tick,this,Se.UTILITY)):e()})}dedupeQueue(){let t=Object.create(null),e=0;for(let s=0;s<this.queue.length;s++){let i=this.queue[s];t[i.uid]||(t[i.uid]=!0,this.queue[e++]=i)}this.queue.length=e}destroy(){this._destroyed=!0,clearTimeout(this.timeout)}_resolve(){let{resolves:t}=this,e=t.slice(0);t.length=0;for(let s of e)s()}};fA.uploadsPerFrame=4;var Iv=fA;Wt();ht();_e();yl();ci();jm();Js();je();ht();xt();br();cs();Hr();Js();xt();var mA=class gA extends Ne{constructor(...t){let e=t[0]??{};e instanceof Float32Array&&(I(V,"use new MeshGeometry({ positions, uvs, indices }) instead"),e={positions:e,uvs:t[1],indices:t[2]}),e={...gA.defaultOptions,...e};let s=e.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=e.uvs;i||(e.positions?i=new Float32Array(s.length):i=new Float32Array([0,0,1,0,1,1,0,1]));let n=e.indices||new Uint32Array([0,1,2,0,2,3]),o=e.shrinkBuffersToFit,a=new zt({data:s,label:"attribute-mesh-positions",shrinkToFit:o,usage:ct.VERTEX|ct.COPY_DST}),u=new zt({data:i,label:"attribute-mesh-uvs",shrinkToFit:o,usage:ct.VERTEX|ct.COPY_DST}),l=new zt({data:n,label:"index-mesh-buffer",shrinkToFit:o,usage:ct.INDEX|ct.COPY_DST});super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:8,offset:0},aUV:{buffer:u,format:"float32x2",stride:8,offset:0}},indexBuffer:l,topology:e.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(t){this.attributes.aPosition.buffer.data=t}get uvs(){return this.attributes.aUV.buffer.data}set uvs(t){this.attributes.aUV.buffer.data=t}get indices(){return this.indexBuffer.data}set indices(t){this.indexBuffer.data=t}};mA.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};var Xe=mA;C();C();ot();us();te();to();Yi();var Bs=class{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(t){this._topology=t}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(t){this.texture!==t&&(this.texture=t,this._textureMatrixUpdateId=-1)}get uvs(){let e=this.geometry.getBuffer("aUV"),s=e.data,i=s,n=this.texture.textureMatrix;return n.isSimple||(i=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==e._updateID)&&((!i||i.length<s.length)&&(i=this._transformedUvs=new Float32Array(s.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=e._updateID,n.multiplyUvs(s,i))),i}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};var sc=class{destroy(){}},ya=class{constructor(t,e){this.localUniforms=new dt({uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new oe({0:this.localUniforms}),this.renderer=t,this._adaptor=e,this._adaptor.init()}validateRenderable(t){let e=this._getMeshData(t),s=e.batched,i=t.batched;if(e.batched=i,s!==i)return!0;if(i){let n=t._geometry;if(n.indices.length!==e.indexSize||n.positions.length!==e.vertexSize)return e.indexSize=n.indices.length,e.vertexSize=n.positions.length,!0;let o=this._getBatchableMesh(t);return o.texture.uid!==t._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,t._texture)}return!1}addRenderable(t,e){let s=this.renderer.renderPipes.batch,i=this._getMeshData(t);if(t.didViewUpdate&&(i.indexSize=t._geometry.indices?.length,i.vertexSize=t._geometry.positions?.length),i.batched){let n=this._getBatchableMesh(t);n.setTexture(t._texture),n.geometry=t._geometry,s.addToBatch(n,e)}else s.break(e),e.add(t)}updateRenderable(t){if(t.batched){let e=this._getBatchableMesh(t);e.setTexture(t._texture),e.geometry=t._geometry,e._batcher.updateElement(e)}}execute(t){if(!t.isRenderable)return;t.state.blendMode=Wr(t.groupBlendMode,t.texture._source);let e=this.localUniforms;e.uniforms.uTransformMatrix=t.groupTransform,e.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,e.update(),Mr(t.groupColorAlpha,e.uniforms.uColor,0),this._adaptor.execute(this,t)}_getMeshData(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new sc),t._gpuData[this.renderer.uid].meshData||this._initMeshData(t)}_initMeshData(t){return t._gpuData[this.renderer.uid].meshData={batched:t.batched,indexSize:0,vertexSize:0},t._gpuData[this.renderer.uid].meshData}_getBatchableMesh(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new sc),t._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(t)}_initBatchableMesh(t){let e=new Bs;return e.renderable=t,e.setTexture(t._texture),e.transform=t.groupTransform,e.roundPixels=this.renderer._roundPixels|t._roundPixels,t._gpuData[this.renderer.uid].batchableMesh=e,e}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}};ya.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"mesh"};O.add(ya);var or=class extends Jt{constructor(...t){let e=t[0];e instanceof Ne&&(I(V,"Mesh: use new Mesh({ geometry, shader }) instead"),e={geometry:e,shader:t[1]},t[3]&&(I(V,"Mesh: drawMode argument has been removed, use geometry.topology instead"),e.geometry.topology=t[3]));let{geometry:s,shader:i,texture:n,roundPixels:o,state:a,...u}=e;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=!1,this.shader=i??null,this.texture=n??i?.texture??D.WHITE,this.state=a??Ut.for2d(),this._geometry=s,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??!1}get material(){return I(V,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(t){this._shader!==t&&(this._shader=t,this.onViewUpdate())}get shader(){return this._shader}set geometry(t){this._geometry!==t&&(this._geometry?.off("update",this.onViewUpdate,this),t.on("update",this.onViewUpdate,this),this._geometry=t,this.onViewUpdate())}get geometry(){return this._geometry}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=t),this._texture=t,this.onViewUpdate())}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?!1:this._geometry instanceof Xe?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":!1}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds}containsPoint(t){let{x:e,y:s}=t;if(!this.bounds.containsPoint(e,s))return!1;let i=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(ah(e,s,i[l],i[l+1],i[c],i[c+1],i[h],i[h+1]))return!0}}else{let o=i.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(ah(e,s,i[u],i[u+1],i[l],i[l+1],i[c],i[c+1]))return!0}}return!1}destroy(t){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null}};js();ht();zs();is();js();var ic=class r extends we{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});let{animationSpeed:s=1,autoPlay:i=!1,autoUpdate:n=!0,loop:o=!0,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=!1,...d}=e,[f]=c;super({...d,texture:f instanceof D?f:f.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=!1,this.animationSpeed=s,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,i&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Gt.shared.add(this.update,this,Se.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;let e=t.deltaTime,s=this.animationSpeed*e,i=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=s/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=s;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()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i||this.animationSpeed<0&&this.currentFrame>i)&&this.onLoop(),this._updateTexture())}_updateTexture(){let t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t=!1){if(typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._textures.forEach(i=>{this.texture!==i&&i.destroy(s)})}this._textures=[],this._durations=null,this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){let e=[];for(let s=0;s<t.length;++s)e.push(D.from(t[s]));return new r(e)}static fromImages(t){let e=[];for(let s=0;s<t.length;++s)e.push(D.from(t[s]));return new r(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof D)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].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}.`);let e=this.currentFrame;this._currentTime=t,e!==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?(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Gt.shared.add(this.update,this),this._isConnectedToTicker=!0))}};Tr();Us();ht();xt();ot();Us();var nc=class{constructor({matrix:t,observer:e}={}){this.dirty=!0,this._matrix=t??new F,this.observer=e,this.position=new Et(this,0,0),this.scale=new Et(this,1,1),this.pivot=new Et(this,0,0),this.skew=new Et(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1}get matrix(){let t=this._matrix;return this.dirty&&(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.dirty=!1),t}_onUpdate(t){this.dirty=!0,t===this.skew&&this.updateSkew(),this.observer?._onUpdate(this)}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.dirty=!0}toString(){return`[pixi.js/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}) ]`}setFromMatrix(t){t.decompose(this),this.dirty=!0}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this.skew))}};br();C();C();ot();Ue();Lr();Ls();Os();var ip=new F,Rs=new F,Kr=[new nt,new nt,new nt,new nt],va=class{constructor(t){this._renderer=t}validateRenderable(t){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){let e=this._renderer,s=e.canvasContext,i=s.activeContext;i.save(),s.setBlendMode(t.groupBlendMode);let n=e.globalUniforms.globalUniformData?.worldColor??4294967295,o=t.groupColorAlpha,a=(n>>>24&255)/255,u=(o>>>24&255)/255,l=e.filter?.alphaMultiplier??1,c=a*u*l;if(c<=0){i.restore();return}i.globalAlpha=c;let h=n&16777215,d=o&16777215,f=Te(Ie(d,h)),p=t.texture,g=Z.getTintedPattern(p,f),_=t.width,b=t.height,y=t.groupTransform,v=p.source._resolution??p.source.resolution??1;Rs.copyFrom(t._tileTransform.matrix),t.applyAnchorToTexture||Rs.translate(-t.anchor.x*_,-t.anchor.y*b);let T=Rs.tx,S=Rs.ty;Rs.scale(1/v,1/v),Rs.tx=T,Rs.ty=S,ip.identity(),ip.prepend(Rs),ip.prepend(y);let E=e._roundPixels|t._roundPixels;s.setContextTransform(ip,E===1),i.fillStyle=g;let w=t.anchor.x*-_,M=t.anchor.y*-b;Kr[0].set(w,M),Kr[1].set(w+_,M),Kr[2].set(w+_,M+b),Kr[3].set(w,M+b);for(let P=0;P<4;P++)Rs.applyInverse(Kr[P],Kr[P]);i.beginPath(),i.moveTo(Kr[0].x,Kr[0].y);for(let P=1;P<4;P++)i.lineTo(Kr[P].x,Kr[P].y);i.closePath(),i.fill(),i.restore()}destroy(){this._renderer=null}};va.extension={type:[m.CanvasPipes],name:"tilingSprite"};C();to();je();Pe();ye();Yi();ot();fs();zi();ps();lr();te();ht();var kv={name:"tiling-bit",vertex:{header:`
|
|
3020
3020
|
struct TilingUniforms {
|
|
3021
3021
|
uMapCoord:mat3x3<f32>,
|
|
3022
3022
|
uClampFrame:vec4<f32>,
|
|
@@ -3059,7 +3059,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3059
3059
|
}
|
|
3060
3060
|
|
|
3061
3061
|
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
|
|
3062
|
-
`}},
|
|
3062
|
+
`}},Ov={name:"tiling-bit",vertex:{header:`
|
|
3063
3063
|
uniform mat3 uTextureTransform;
|
|
3064
3064
|
uniform vec4 uSizeAnchor;
|
|
3065
3065
|
|
|
@@ -3081,7 +3081,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3081
3081
|
|
|
3082
3082
|
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
3083
3083
|
|
|
3084
|
-
`}};var kv,Ov,oc=class extends Vt{constructor(){kv??(kv=Cr({name:"tiling-sprite-shader",bits:[ti,Uv,wr]})),Ov??(Ov=Ar({name:"tiling-sprite-shader",bits:[Hi,Iv,Pr]}));let t=new dt({uMapCoord:{value:new F,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new F,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:Ov,gpuProgram:kv,resources:{localUniforms:new dt({uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:D.EMPTY.source,uSampler:D.EMPTY.source.style}})}updateUniforms(t,e,s,i,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(s.a*u/t,s.b*u/e,s.c*l/t,s.d*l/e,s.tx/t,s.ty/e),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=i,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style)}};var ac=class extends Xe{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}};function Lv(r,t){let e=r.anchor.x,s=r.anchor.y;t[0]=-e*r.width,t[1]=-s*r.height,t[2]=(1-e)*r.width,t[3]=-s*r.height,t[4]=(1-e)*r.width,t[5]=(1-s)*r.height,t[6]=-e*r.width,t[7]=(1-s)*r.height}ot();function Nv(r,t,e,s){let i=0,n=r.length/(t||2),o=s.a,a=s.b,u=s.c,l=s.d,c=s.tx,h=s.ty;for(e*=t;i<n;){let d=r[e],f=r[e+1];r[e]=o*d+u*f+c,r[e+1]=a*d+l*f+h,e+=t,i++}}function Hv(r,t){let e=r.texture,s=e.frame.width,i=e.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),t[0]=t[6]=-n,t[2]=t[4]=1-n,t[1]=t[3]=-o,t[5]=t[7]=1-o;let a=r._tileTransform.matrix,u=F.shared;u.set(a.a*s/r.width,a.b*s/r.height,a.c*i/r.width,a.d*i/r.height,a.tx/r.width,a.ty/r.height),u.invert(),Nv(t,2,0,u)}var ip=new ac,np=class{constructor(){this.canBatch=!0,this.geometry=new Xe({indices:ip.indices.slice(),positions:ip.positions.slice(),uvs:ip.uvs.slice()})}destroy(){this.geometry.destroy(),this.shader?.destroy()}},va=class{constructor(t){this._state=Ut.default2d,this._renderer=t,this._managedTilingSprites=new vt({renderer:t,type:"renderable",name:"tilingSprite"})}validateRenderable(t){let e=this._getTilingSpriteData(t),s=e.canBatch;this._updateCanBatch(t);let i=e.canBatch;if(i&&i===s){let{batchableMesh:n}=e;return!n._batcher.checkAndUpdateTexture(n,t.texture)}return s!==i}addRenderable(t,e){let s=this._renderer.renderPipes.batch;this._updateCanBatch(t);let i=this._getTilingSpriteData(t),{geometry:n,canBatch:o}=i;if(o){i.batchableMesh||(i.batchableMesh=new Ps);let a=i.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),a.geometry=n,a.renderable=t,a.transform=t.groupTransform,a.setTexture(t._texture)),a.roundPixels=this._renderer._roundPixels|t._roundPixels,s.addToBatch(a,e)}else s.break(e),i.shader||(i.shader=new oc),this.updateRenderable(t),e.add(t)}execute(t){let e=this._renderer,{shader:s}=this._getTilingSpriteData(t);s.groups[0]=e.globalUniforms.bindGroup;let i=s.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,Mr(t.groupColorAlpha,i.uColor,0),this._state.blendMode=Wr(t.groupBlendMode,t.texture._source),e.encoder.draw({geometry:ip,shader:s,state:this._state})}updateRenderable(t){let e=this._getTilingSpriteData(t),{canBatch:s}=e;if(s){let{batchableMesh:i}=e;t.didViewUpdate&&this._updateBatchableMesh(t),i._batcher.updateElement(i)}else if(t.didViewUpdate){let{shader:i}=e;i.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture)}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){let e=new np;return e.renderable=t,t._gpuData[this._renderer.uid]=e,this._managedTilingSprites.add(t),e}_updateBatchableMesh(t){let e=this._getTilingSpriteData(t),{geometry:s}=e,i=t.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),Hv(t,s.uvs),Lv(t,s.positions)}destroy(){this._managedTilingSprites.destroy(),this._renderer=null}_updateCanBatch(t){let e=this._getTilingSpriteData(t),s=t.texture,i=!0;return this._renderer.type===Tt.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=s.textureMatrix.isSimple&&(i||s.source.isPowerOfTwo),e.canBatch}};va.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"tilingSprite"};O.add(ya);O.add(va);var gA=class op extends Jt{constructor(...t){let e=t[0]||{};e instanceof D&&(e={texture:e}),t.length>1&&(I(V,"use new TilingSprite({ texture, width:100, height:100 }) instead"),e.width=t[1],e.height=t[2]),e={...op.defaultOptions,...e};let{texture:s,anchor:i,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=e??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=!0,this.allowChildren=!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),this.applyAnchorToTexture=c,this.texture=s,this._width=u??s.width,this._height=l??s.height,this._tileTransform=new nc({observer:{_onUpdate:()=>this.onViewUpdate()}}),i&&(this.anchor=i),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??!1}static from(t,e={}){return typeof t=="string"?new op({texture:at.get(t),...e}):new op({texture:t,...e})}get uvRespectAnchor(){return I(V,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(t){I(V,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=t}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(t){this._texture.textureMatrix.clampMargin=t}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get tilePosition(){return this._tileTransform.position}set tilePosition(t){this._tileTransform.position.copyFrom(t)}get tileScale(){return this._tileTransform.scale}set tileScale(t){typeof t=="number"?this._tileTransform.scale.set(t):this._tileTransform.scale.copyFrom(t)}set tileRotation(t){this._tileTransform.rotation=t}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())}get texture(){return this._texture}set width(t){this._width=t,this.onViewUpdate()}get width(){return this._width}set height(t){this._height=t,this.onViewUpdate()}get height(){return this._height}setSize(t,e){typeof t=="object"&&(e=t.height??t.width,t=t.width),this._width=t,this._height=e??t,this.onViewUpdate()}getSize(t){return t||(t={}),t.width=this._width,t.height=this._height,t}updateBounds(){let t=this._bounds,e=this._anchor,s=this._width,i=this._height;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}containsPoint(t){let e=this._width,s=this._height,i=-e*this._anchor._x,n=0;return t.x>=i&&t.x<=i+e&&(n=-s*this._anchor._y,t.y>=n&&t.y<=n+s)}destroy(t=!1){if(super.destroy(t),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null}};gA.defaultOptions={texture:D.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:!1};var Wv=gA;Wt();kr();Gs();xt();br();var Rs=class extends Jt{constructor(t,e){let{text:s,resolution:i,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=t;super({...c}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=s??"",this.style=n,this.resolution=i??null,this.allowChildren=!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),o&&(this.anchor=o),this.roundPixels=l??!1,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this.bounds.width),e!==void 0&&this._setHeight(e,this.bounds.height)}containsPoint(t){let e=this.bounds.width,s=this.bounds.height,i=-e*this.anchor.x,n=0;return t.x>=i&&t.x<=i+e&&(n=-s*this.anchor.y,t.y>=n&&t.y<=n+s)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}};function fn(r,t){let e=r[0]??{};return(typeof e=="string"||r[1])&&(I(V,`use new ${t}({ text: "hi!", style }) instead`),e={text:e,style:r[1]}),e}It();jt();Ks();mt();En();jt();var pn=null,Ms=null;function yM(r,t){pn||(pn=N.get().createCanvas(256,128),Ms=pn.getContext("2d",{willReadFrequently:!0}),Ms.globalCompositeOperation="copy",Ms.globalAlpha=1),(pn.width<r||pn.height<t)&&(pn.width=Ir(r),pn.height=Ir(t))}function xA(r,t,e){for(let s=0,i=4*e*t;s<t;++s,i+=4)if(r[i+3]!==0)return!1;return!0}function _A(r,t,e,s,i){let n=4*t;for(let o=s,a=s*n+4*e;o<=i;++o,a+=n)if(r[a+3]!==0)return!1;return!0}function Vv(...r){let t=r[0];t.canvas||(t={canvas:r[0],resolution:r[1]});let{canvas:e}=t,s=Math.min(t.resolution??1,1),i=t.width??e.width,n=t.height??e.height,o=t.output;if(yM(i,n),!Ms)throw new TypeError("Failed to get canvas 2D context");Ms.drawImage(e,0,0,i,n,0,0,i*s,n*s);let u=Ms.getImageData(0,0,i,n).data,l=0,c=0,h=i-1,d=n-1;for(;c<n&&xA(u,i,c);)++c;if(c===n)return J.EMPTY;for(;xA(u,i,d);)--d;for(;_A(u,i,l,c,d);)++l;for(;_A(u,i,h,c,d);)--h;return++h,++d,Ms.globalCompositeOperation="source-over",Ms.strokeRect(l,c,h-l,d-c),Ms.globalCompositeOperation="copy",o??(o=new J),o.set(l/s,c/s,(h-l)/s,(d-c)/s),o}bs();Al();Ef();var bA=new J;function Ta(r){let t=0;for(let e=0;e<r.length;e++)r.charCodeAt(e)===32&&t++;return t}var zv=class{getCanvasAndContext(t){let{text:e,style:s,resolution:i=1}=t,n=s._getFinalPadding(),o=At.measureText(e||" ",s),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*i),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*i),l=be.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(s,n,i,l,o);let c=s.trim?Vv({canvas:l.canvas,width:a,height:u,resolution:1,output:bA}):bA.set(0,0,a,u);return{canvasAndContext:l,frame:c}}returnCanvasAndContext(t){be.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,s,i,n){if(n.runsByLine&&n.runsByLine.length>0){this._renderTaggedTextToCanvas(n,t,e,s,i);return}let{canvas:o,context:a}=i,u=ys(t),l=n.lines,c=n.lineHeight,h=n.lineWidths,d=n.maxLineWidth,f=n.fontProperties,p=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let S=t._stroke;a.lineWidth=S.width,a.miterLimit=S.miterLimit,a.lineJoin=S.join,a.lineCap=S.cap}a.font=u;let g,_,b=t.dropShadow?2:1,v=(t._stroke?.width??0)/2,T=(c-f.fontSize)/2;c-f.fontSize<0&&(T=0);for(let S=0;S<b;++S){let E=t.dropShadow&&S===0,w=E?Math.ceil(Math.max(1,p)+e*2):0,M=w*s;if(E)this._setupDropShadow(a,t,s,M);else{let P=t._gradientBounds,R=t._gradientOffset;if(P){let A={width:P.width,height:P.height,lineHeight:P.height,lines:n.lines};this._setFillAndStrokeStyles(a,t,A,e,v,R?.x??0,R?.y??0)}else R?this._setFillAndStrokeStyles(a,t,n,e,v,R.x,R.y):this._setFillAndStrokeStyles(a,t,n,e,v);a.shadowColor="rgba(0,0,0,0)"}for(let P=0;P<l.length;P++){g=v,_=v+P*c+f.ascent+T,g+=this._getAlignmentOffset(h[P],d,t.align);let R=0;if(t.align==="justify"&&t.wordWrap&&P<l.length-1){let A=Ta(l[P]);A>0&&(R=(d-h[P])/A)}t._stroke?.width&&this._drawLetterSpacing(l[P],t,i,g+e,_+e-w,!0,R),t._fill!==void 0&&this._drawLetterSpacing(l[P],t,i,g+e,_+e-w,!1,R)}}}_renderTaggedTextToCanvas(t,e,s,i,n){let{canvas:o,context:a}=n,{runsByLine:u,lineWidths:l,maxLineWidth:c,lineAscents:h,lineHeights:d,hasDropShadow:f}=t,p=o.height;a.resetTransform(),a.scale(i,i),a.textBaseline=e.textBaseline;let g=f?2:1,_=e._stroke?.width??0;for(let v of u)for(let T of v){let S=T.style._stroke?.width??0;S>_&&(_=S)}let b=_/2,y=[];for(let v=0;v<u.length;v++){let T=u[v],S=[];for(let E of T){let w=ys(E.style);a.font=w,S.push({width:At._measureText(E.text,E.style.letterSpacing,a),font:w})}y.push(S)}for(let v=0;v<g;++v){let T=f&&v===0,S=T?Math.ceil(Math.max(1,p)+s*2):0,E=S*i;T||(a.shadowColor="rgba(0,0,0,0)");let w=b;for(let M=0;M<u.length;M++){let P=u[M],R=l[M],A=h[M],G=d[M],H=y[M],W=b;W+=this._getAlignmentOffset(R,c,e.align);let $=0;if(e.align==="justify"&&e.wordWrap&&M<u.length-1){let z=0;for(let L of P)z+=Ta(L.text);z>0&&($=(c-R)/z)}let B=w+A,U=W+s;for(let z=0;z<P.length;z++){let L=P[z],{width:K,font:gt}=H[z];if(a.font=gt,a.textBaseline=L.style.textBaseline,L.style._stroke?.width){let Y=L.style._stroke;if(a.lineWidth=Y.width,a.miterLimit=Y.miterLimit,a.lineJoin=Y.join,a.lineCap=Y.cap,T)if(L.style.dropShadow)this._setupDropShadow(a,L.style,i,E);else{let Q=Ta(L.text);U+=K+Q*$;continue}else{let Q=At.measureFont(gt),j=L.style.lineHeight||Q.fontSize,Pt={width:K,height:j,lineHeight:j,lines:[L.text]};a.strokeStyle=vs(Y,a,Pt,s*2,U-s,w)}this._drawLetterSpacing(L.text,L.style,n,U,B+s-S,!0,$)}let ft=Ta(L.text);U+=K+ft*$}U=W+s;for(let z=0;z<P.length;z++){let L=P[z],{width:K,font:gt}=H[z];if(a.font=gt,a.textBaseline=L.style.textBaseline,L.style._fill!==void 0){if(T)if(L.style.dropShadow)this._setupDropShadow(a,L.style,i,E);else{let Y=Ta(L.text);U+=K+Y*$;continue}else{let Y=At.measureFont(gt),Q=L.style.lineHeight||Y.fontSize,j={width:K,height:Q,lineHeight:Q,lines:[L.text]};a.fillStyle=vs(L.style._fill,a,j,s*2,U-s,w)}this._drawLetterSpacing(L.text,L.style,n,U,B+s-S,!1,$)}let ft=Ta(L.text);U+=K+ft*$}w+=G}}}_setFillAndStrokeStyles(t,e,s,i,n,o=0,a=0){if(t.fillStyle=e._fill?vs(e._fill,t,s,i*2,o,a):null,e._stroke?.width){let u=n+i*2;t.strokeStyle=vs(e._stroke,t,s,u,o,a)}}_setupDropShadow(t,e,s,i){t.fillStyle="black",t.strokeStyle="black";let n=e.dropShadow,o=n.color,a=n.alpha;t.shadowColor=X.shared.setValue(o).setAlpha(a).toRgbaString();let u=n.blur*s,l=n.distance*s;t.shadowBlur=u,t.shadowOffsetX=Math.cos(n.angle)*l,t.shadowOffsetY=Math.sin(n.angle)*l+i}_getAlignmentOffset(t,e,s){return s==="right"?e-t:s==="center"?(e-t)/2:0}_drawLetterSpacing(t,e,s,i,n,o=!1,a=0){let{context:u}=s,l=e.letterSpacing,c=!1;if(At.experimentalLetterSpacingSupported&&(At.experimentalLetterSpacing?(u.letterSpacing=`${l}px`,u.textLetterSpacing=`${l}px`,c=!0):(u.letterSpacing="0px",u.textLetterSpacing="0px")),(l===0||c)&&a===0){o?u.strokeText(t,i,n):u.fillText(t,i,n);return}if(a!==0&&(l===0||c)){let g=t.split(" "),_=i,b=u.measureText(" ").width;for(let y=0;y<g.length;y++)o?u.strokeText(g[y],_,n):u.fillText(g[y],_,n),_+=u.measureText(g[y]).width+b+a;return}let h=i,d=At.graphemeSegmenter(t),f=u.measureText(t).width,p=0;for(let g=0;g<d.length;++g){let _=d[g];o?u.strokeText(_,h,n):u.fillText(_,h,n);let b="";for(let y=g+1;y<d.length;++y)b+=d[y];p=u.measureText(b).width,h+=f-p+l,_===" "&&(h+=a),f=p}}},Je=new zv;bs();fr();C();C();ye();Jc();function Sa(r,t){let{texture:e,bounds:s}=r,i=t._style._getFinalPadding();ou(s,t._anchor,e);let n=t._anchor._x*i*2,o=t._anchor._y*i*2;s.minX-=i-n,s.minY-=i-o,s.maxX-=i-n,s.maxY-=i-o}Xn();var uc=class extends Br{};var Ea=class{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new vt({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(let t in this._managedTexts.items){let e=this._managedTexts.items[t];e?._autoResolution&&e.onViewUpdate()}}validateRenderable(t){let e=this._getGpuText(t),s=t.styleKey;return e.currentKey!==s?!0:t._didTextUpdate}addRenderable(t,e){let s=this._getGpuText(t);if(t._didTextUpdate){let i=t._autoResolution?this._renderer.resolution:t.resolution;(s.currentKey!==t.styleKey||t._resolution!==i)&&this._updateGpuText(t),t._didTextUpdate=!1,Sa(s,t)}this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){let e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){let e=new uc;return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,this._managedTexts.add(t),e}onTextUnload(t){let e=t._gpuData[this._renderer.uid];if(!e)return;let{canvasText:s}=this._renderer;s.getReferenceCount(e.currentKey)>0?s.decreaseReferenceCount(e.currentKey):e.texture&&s.returnTexture(e.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}};Ea.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"text"};C();_r();kr();xt();fr();mu();var mn=class{constructor(t,e){this._activeTextures={},this._renderer=t,this._retainCanvasContext=e}getTexture(t,e,s,i){typeof t=="string"&&(I("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:s,resolution:e}),t.style instanceof Ot||(t.style=new Ot(t.style)),t.textureStyle instanceof Qt||(t.textureStyle=new Qt(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());let{text:n,style:o,textureStyle:a,autoGenerateMipmaps:u}=t,l=t.resolution??this._renderer.resolution,{frame:c,canvasAndContext:h}=Je.getCanvasAndContext({text:n,style:o,resolution:l}),d=Pi(h.canvas,c.width,c.height,l,u);if(a&&(d.source.style=a),o.trim&&(c.pad(o.padding),d.frame.copyFrom(c),d.frame.scale(1/l),d.updateUvs()),o.filters){let f=this._applyFilters(d,o.filters);return this.returnTexture(d),Je.returnCanvasAndContext(h),f}return this._renderer.texture.initSource(d._source),this._retainCanvasContext||Je.returnCanvasAndContext(h),d}returnTexture(t){let e=t.source,s=e.resource;if(this._retainCanvasContext&&s?.getContext){let i=s.getContext("2d");i&&Je.returnCanvasAndContext({canvas:s,context:i})}e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",yt.returnTexture(t,!0)}renderTextToCanvas(){I("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;let e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;let s=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[e]={texture:s,usageCount:1},s}decreaseReferenceCount(t){let e=this._activeTextures[t];e&&(e.usageCount--,e.usageCount===0&&(this.returnTexture(e.texture),this._activeTextures[t]=null))}getReferenceCount(t){return this._activeTextures[t]?.usageCount??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){let s=this._renderer.renderTarget.renderTarget,i=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(s,!1),i}destroy(){this._renderer=null;for(let t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}};var Ca=class extends mn{constructor(t){super(t,!0)}};Ca.extension={type:[m.CanvasSystem],name:"canvasText"};C();var Aa=class extends mn{constructor(t){super(t,!1)}};Aa.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"canvasText"};O.add(Ca);O.add(Aa);O.add(Ea);var Zr=class extends Rs{constructor(...t){let e=fn(t,"Text");super(e,Ot),this.renderPipeId="text",e.textureStyle&&(this.textureStyle=e.textureStyle instanceof Qt?e.textureStyle:new Qt(e.textureStyle)),this.autoGenerateMipmaps=e.autoGenerateMipmaps??st.defaultOptions.autoGenerateMipmaps}updateBounds(){let t=this._bounds,e=this._anchor,s=0,i=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=Je.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Je.returnCanvasAndContext(o),s=n.width,i=n.height}else{let n=At.measureText(this._text,this._style);s=n.width,i=n.height}t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}};var lc=class extends Gv{resolveQueueItem(t,e){return t instanceof lt?this.resolveContainerQueueItem(t,e):t instanceof st||t instanceof D?e.push(t.source):t instanceof Kt&&e.push(t),null}resolveContainerQueueItem(t,e){t instanceof we||t instanceof Wv||t instanceof or?e.push(t.texture.source):t instanceof Zr?e.push(t):t instanceof xs?e.push(t.context):t instanceof ic&&t.textures.forEach(s=>{s.source?e.push(s.source):e.push(s.texture.source)})}resolveGraphicsContextQueueItem(t){this.renderer.graphicsContext.getGpuContext(t);let{instructions:e}=t;for(let s of e)if(s.action==="texture"){let{image:i}=s.data;return i.source}else if(s.action==="fill"){let{texture:i}=s.data.style;return i.source}return null}};C();Wt();li();pt();fr();ia();C();C();Tr();ye();bl();bs();ia();wl();var ap=class extends xs{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}},gn=class{constructor(t){this._renderer=t,this._managedBitmapTexts=new vt({renderer:t,type:"renderable",priority:-2,name:"bitmapText"})}validateRenderable(t){let e=this._getGpuBitmapText(t);return this._renderer.renderPipes.graphics.validateRenderable(e)}addRenderable(t,e){let s=this._getGpuBitmapText(t);yA(t,s),t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,s)),this._renderer.renderPipes.graphics.addRenderable(s,e),s.context.customShader&&this._updateDistanceField(t)}updateRenderable(t){let e=this._getGpuBitmapText(t);yA(t,e),this._renderer.renderPipes.graphics.updateRenderable(e),e.context.customShader&&this._updateDistanceField(t)}_updateContext(t,e){let{context:s}=e,i=Yr.getFont(t.text,t._style);if(s.clear(),i.distanceField.type!=="none"){let b=this.getSdfShader();b&&(s.customShader||(s.customShader=b))}let n=At.graphemeSegmenter(t.text),o=t._style,a=i.baseLineOffset,u=hn(n,o,i,!0),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),s.translate(-t._anchor._x*h-l,-t._anchor._y*d-l).scale(c,c);let f=i.applyFillAsTint?o._fill.color:16777215,p=i.fontMetrics.fontSize,g=i.lineHeight;o.lineHeight&&(p=o.fontSize/c,g=o.lineHeight/c);let _=(g-p)/2;_-i.baseLineOffset<0&&(_=0);for(let b=0;b<u.lines.length;b++){let y=u.lines[b];for(let v=0;v<y.charPositions.length;v++){let T=y.chars[v],S=i.chars[T];if(S?.texture){let E=S.texture;s.texture(E,f,Math.round(y.charPositions[v]+S.xOffset),Math.round(a+S.yOffset+_),E.orig.width,E.orig.height)}}a+=g}}_getGpuBitmapText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){let e=new ap;return t._gpuData[this._renderer.uid]=e,this._updateContext(t,e),this._managedBitmapTexts.add(t),e}_updateDistanceField(t){let e=this._getGpuBitmapText(t).context,s=t._style.fontFamily,i=at.get(`${s}-bitmap`),{a:n,b:o,c:a,d:u}=t.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=i.baseRenderedFontSize/t._style.fontSize,f=h*i.distanceField.range*(1/d);e.customShader.resources.localUniforms.uniforms.uDistance=f}destroy(){this._managedBitmapTexts.destroy(),this._renderer=null,this._managedBitmapTexts=null}};function yA(r,t){t.groupTransform=r.groupTransform,t.groupColorAlpha=r.groupColorAlpha,t.groupColor=r.groupColor,t.groupBlendMode=r.groupBlendMode,t.globalDisplayStatus=r.globalDisplayStatus,t.groupTransform=r.groupTransform,t.localDisplayStatus=r.localDisplayStatus,t.groupAlpha=r.groupAlpha,t._roundPixels=r._roundPixels}var wa=class extends gn{getSdfShader(){return null}};wa.extension={type:[m.CanvasPipes],name:"bitmapText"};C();ot();fs();Nn();Hn();ps();Iu();lr();te();var Xv={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
3084
|
+
`}};var Lv,Nv,oc=class extends Vt{constructor(){Lv??(Lv=Cr({name:"tiling-sprite-shader",bits:[ei,kv,wr]})),Nv??(Nv=Ar({name:"tiling-sprite-shader",bits:[Vi,Ov,Pr]}));let t=new dt({uMapCoord:{value:new F,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new F,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:Nv,gpuProgram:Lv,resources:{localUniforms:new dt({uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:D.EMPTY.source,uSampler:D.EMPTY.source.style}})}updateUniforms(t,e,s,i,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(s.a*u/t,s.b*u/e,s.c*l/t,s.d*l/e,s.tx/t,s.ty/e),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=i,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style)}};var ac=class extends Xe{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}};function Hv(r,t){let e=r.anchor.x,s=r.anchor.y;t[0]=-e*r.width,t[1]=-s*r.height,t[2]=(1-e)*r.width,t[3]=-s*r.height,t[4]=(1-e)*r.width,t[5]=(1-s)*r.height,t[6]=-e*r.width,t[7]=(1-s)*r.height}ot();function Wv(r,t,e,s){let i=0,n=r.length/(t||2),o=s.a,a=s.b,u=s.c,l=s.d,c=s.tx,h=s.ty;for(e*=t;i<n;){let d=r[e],f=r[e+1];r[e]=o*d+u*f+c,r[e+1]=a*d+l*f+h,e+=t,i++}}function Vv(r,t){let e=r.texture,s=e.frame.width,i=e.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),t[0]=t[6]=-n,t[2]=t[4]=1-n,t[1]=t[3]=-o,t[5]=t[7]=1-o;let a=r._tileTransform.matrix,u=F.shared;u.set(a.a*s/r.width,a.b*s/r.height,a.c*i/r.width,a.d*i/r.height,a.tx/r.width,a.ty/r.height),u.invert(),Wv(t,2,0,u)}var np=new ac,op=class{constructor(){this.canBatch=!0,this.geometry=new Xe({indices:np.indices.slice(),positions:np.positions.slice(),uvs:np.uvs.slice()})}destroy(){this.geometry.destroy(),this.shader?.destroy()}},Ta=class{constructor(t){this._state=Ut.default2d,this._renderer=t,this._managedTilingSprites=new vt({renderer:t,type:"renderable",name:"tilingSprite"})}validateRenderable(t){let e=this._getTilingSpriteData(t),s=e.canBatch;this._updateCanBatch(t);let i=e.canBatch;if(i&&i===s){let{batchableMesh:n}=e;return!n._batcher.checkAndUpdateTexture(n,t.texture)}return s!==i}addRenderable(t,e){let s=this._renderer.renderPipes.batch;this._updateCanBatch(t);let i=this._getTilingSpriteData(t),{geometry:n,canBatch:o}=i;if(o){i.batchableMesh||(i.batchableMesh=new Bs);let a=i.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),a.geometry=n,a.renderable=t,a.transform=t.groupTransform,a.setTexture(t._texture)),a.roundPixels=this._renderer._roundPixels|t._roundPixels,s.addToBatch(a,e)}else s.break(e),i.shader||(i.shader=new oc),this.updateRenderable(t),e.add(t)}execute(t){let e=this._renderer,{shader:s}=this._getTilingSpriteData(t);s.groups[0]=e.globalUniforms.bindGroup;let i=s.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,Mr(t.groupColorAlpha,i.uColor,0),this._state.blendMode=Wr(t.groupBlendMode,t.texture._source),e.encoder.draw({geometry:np,shader:s,state:this._state})}updateRenderable(t){let e=this._getTilingSpriteData(t),{canBatch:s}=e;if(s){let{batchableMesh:i}=e;t.didViewUpdate&&this._updateBatchableMesh(t),i._batcher.updateElement(i)}else if(t.didViewUpdate){let{shader:i}=e;i.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture)}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){let e=new op;return e.renderable=t,t._gpuData[this._renderer.uid]=e,this._managedTilingSprites.add(t),e}_updateBatchableMesh(t){let e=this._getTilingSpriteData(t),{geometry:s}=e,i=t.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),Vv(t,s.uvs),Hv(t,s.positions)}destroy(){this._managedTilingSprites.destroy(),this._renderer=null}_updateCanBatch(t){let e=this._getTilingSpriteData(t),s=t.texture,i=!0;return this._renderer.type===Tt.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=s.textureMatrix.isSimple&&(i||s.source.isPowerOfTwo),e.canBatch}};Ta.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"tilingSprite"};O.add(va);O.add(Ta);var xA=class ap extends Jt{constructor(...t){let e=t[0]||{};e instanceof D&&(e={texture:e}),t.length>1&&(I(V,"use new TilingSprite({ texture, width:100, height:100 }) instead"),e.width=t[1],e.height=t[2]),e={...ap.defaultOptions,...e};let{texture:s,anchor:i,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=e??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=!0,this.allowChildren=!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),this.applyAnchorToTexture=c,this.texture=s,this._width=u??s.width,this._height=l??s.height,this._tileTransform=new nc({observer:{_onUpdate:()=>this.onViewUpdate()}}),i&&(this.anchor=i),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??!1}static from(t,e={}){return typeof t=="string"?new ap({texture:at.get(t),...e}):new ap({texture:t,...e})}get uvRespectAnchor(){return I(V,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(t){I(V,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=t}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(t){this._texture.textureMatrix.clampMargin=t}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get tilePosition(){return this._tileTransform.position}set tilePosition(t){this._tileTransform.position.copyFrom(t)}get tileScale(){return this._tileTransform.scale}set tileScale(t){typeof t=="number"?this._tileTransform.scale.set(t):this._tileTransform.scale.copyFrom(t)}set tileRotation(t){this._tileTransform.rotation=t}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())}get texture(){return this._texture}set width(t){this._width=t,this.onViewUpdate()}get width(){return this._width}set height(t){this._height=t,this.onViewUpdate()}get height(){return this._height}setSize(t,e){typeof t=="object"&&(e=t.height??t.width,t=t.width),this._width=t,this._height=e??t,this.onViewUpdate()}getSize(t){return t||(t={}),t.width=this._width,t.height=this._height,t}updateBounds(){let t=this._bounds,e=this._anchor,s=this._width,i=this._height;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}containsPoint(t){let e=this._width,s=this._height,i=-e*this._anchor._x,n=0;return t.x>=i&&t.x<=i+e&&(n=-s*this._anchor._y,t.y>=n&&t.y<=n+s)}destroy(t=!1){if(super.destroy(t),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null}};xA.defaultOptions={texture:D.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:!1};var zv=xA;Wt();kr();Us();xt();br();var Ms=class extends Jt{constructor(t,e){let{text:s,resolution:i,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=t;super({...c}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=s??"",this.style=n,this.resolution=i??null,this.allowChildren=!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),o&&(this.anchor=o),this.roundPixels=l??!1,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this.bounds.width),e!==void 0&&this._setHeight(e,this.bounds.height)}containsPoint(t){let e=this.bounds.width,s=this.bounds.height,i=-e*this.anchor.x,n=0;return t.x>=i&&t.x<=i+e&&(n=-s*this.anchor.y,t.y>=n&&t.y<=n+s)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}};function mn(r,t){let e=r[0]??{};return(typeof e=="string"||r[1])&&(I(V,`use new ${t}({ text: "hi!", style }) instead`),e={text:e,style:r[1]}),e}It();jt();Zs();mt();An();jt();var gn=null,Ds=null;function TM(r,t){gn||(gn=N.get().createCanvas(256,128),Ds=gn.getContext("2d",{willReadFrequently:!0}),Ds.globalCompositeOperation="copy",Ds.globalAlpha=1),(gn.width<r||gn.height<t)&&(gn.width=Ir(r),gn.height=Ir(t))}function _A(r,t,e){for(let s=0,i=4*e*t;s<t;++s,i+=4)if(r[i+3]!==0)return!1;return!0}function bA(r,t,e,s,i){let n=4*t;for(let o=s,a=s*n+4*e;o<=i;++o,a+=n)if(r[a+3]!==0)return!1;return!0}function Xv(...r){let t=r[0];t.canvas||(t={canvas:r[0],resolution:r[1]});let{canvas:e}=t,s=Math.min(t.resolution??1,1),i=t.width??e.width,n=t.height??e.height,o=t.output;if(TM(i,n),!Ds)throw new TypeError("Failed to get canvas 2D context");Ds.drawImage(e,0,0,i,n,0,0,i*s,n*s);let u=Ds.getImageData(0,0,i,n).data,l=0,c=0,h=i-1,d=n-1;for(;c<n&&_A(u,i,c);)++c;if(c===n)return J.EMPTY;for(;_A(u,i,d);)--d;for(;bA(u,i,l,c,d);)++l;for(;bA(u,i,h,c,d);)--h;return++h,++d,Ds.globalCompositeOperation="source-over",Ds.strokeRect(l,c,h-l,d-c),Ds.globalCompositeOperation="copy",o??(o=new J),o.set(l/s,c/s,(h-l)/s,(d-c)/s),o}bs();wl();Ef();var yA=new J;function Sa(r){let t=0;for(let e=0;e<r.length;e++)r.charCodeAt(e)===32&&t++;return t}var $v=class{getCanvasAndContext(t){let{text:e,style:s,resolution:i=1}=t,n=s._getFinalPadding(),o=At.measureText(e||" ",s),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*i),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*i),l=be.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(s,n,i,l,o);let c=s.trim?Xv({canvas:l.canvas,width:a,height:u,resolution:1,output:yA}):yA.set(0,0,a,u);return{canvasAndContext:l,frame:c}}returnCanvasAndContext(t){be.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,s,i,n){if(n.runsByLine&&n.runsByLine.length>0){this._renderTaggedTextToCanvas(n,t,e,s,i);return}let{canvas:o,context:a}=i,u=ys(t),l=n.lines,c=n.lineHeight,h=n.lineWidths,d=n.maxLineWidth,f=n.fontProperties,p=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let S=t._stroke;a.lineWidth=S.width,a.miterLimit=S.miterLimit,a.lineJoin=S.join,a.lineCap=S.cap}a.font=u;let g,_,b=t.dropShadow?2:1,v=(t._stroke?.width??0)/2,T=(c-f.fontSize)/2;c-f.fontSize<0&&(T=0);for(let S=0;S<b;++S){let E=t.dropShadow&&S===0,w=E?Math.ceil(Math.max(1,p)+e*2):0,M=w*s;if(E)this._setupDropShadow(a,t,s,M);else{let P=t._gradientBounds,R=t._gradientOffset;if(P){let A={width:P.width,height:P.height,lineHeight:P.height,lines:n.lines};this._setFillAndStrokeStyles(a,t,A,e,v,R?.x??0,R?.y??0)}else R?this._setFillAndStrokeStyles(a,t,n,e,v,R.x,R.y):this._setFillAndStrokeStyles(a,t,n,e,v);a.shadowColor="rgba(0,0,0,0)"}for(let P=0;P<l.length;P++){g=v,_=v+P*c+f.ascent+T,g+=this._getAlignmentOffset(h[P],d,t.align);let R=0;if(t.align==="justify"&&t.wordWrap&&P<l.length-1){let A=Sa(l[P]);A>0&&(R=(d-h[P])/A)}t._stroke?.width&&this._drawLetterSpacing(l[P],t,i,g+e,_+e-w,!0,R),t._fill!==void 0&&this._drawLetterSpacing(l[P],t,i,g+e,_+e-w,!1,R)}}}_renderTaggedTextToCanvas(t,e,s,i,n){let{canvas:o,context:a}=n,{runsByLine:u,lineWidths:l,maxLineWidth:c,lineAscents:h,lineHeights:d,hasDropShadow:f}=t,p=o.height;a.resetTransform(),a.scale(i,i),a.textBaseline=e.textBaseline;let g=f?2:1,_=e._stroke?.width??0;for(let v of u)for(let T of v){let S=T.style._stroke?.width??0;S>_&&(_=S)}let b=_/2,y=[];for(let v=0;v<u.length;v++){let T=u[v],S=[];for(let E of T){let w=ys(E.style);a.font=w,S.push({width:At._measureText(E.text,E.style.letterSpacing,a),font:w})}y.push(S)}for(let v=0;v<g;++v){let T=f&&v===0,S=T?Math.ceil(Math.max(1,p)+s*2):0,E=S*i;T||(a.shadowColor="rgba(0,0,0,0)");let w=b;for(let M=0;M<u.length;M++){let P=u[M],R=l[M],A=h[M],G=d[M],H=y[M],W=b;W+=this._getAlignmentOffset(R,c,e.align);let $=0;if(e.align==="justify"&&e.wordWrap&&M<u.length-1){let z=0;for(let L of P)z+=Sa(L.text);z>0&&($=(c-R)/z)}let B=w+A,U=W+s;for(let z=0;z<P.length;z++){let L=P[z],{width:K,font:gt}=H[z];if(a.font=gt,a.textBaseline=L.style.textBaseline,L.style._stroke?.width){let Y=L.style._stroke;if(a.lineWidth=Y.width,a.miterLimit=Y.miterLimit,a.lineJoin=Y.join,a.lineCap=Y.cap,T)if(L.style.dropShadow)this._setupDropShadow(a,L.style,i,E);else{let Q=Sa(L.text);U+=K+Q*$;continue}else{let Q=At.measureFont(gt),j=L.style.lineHeight||Q.fontSize,Bt={width:K,height:j,lineHeight:j,lines:[L.text]};a.strokeStyle=vs(Y,a,Bt,s*2,U-s,w)}this._drawLetterSpacing(L.text,L.style,n,U,B+s-S,!0,$)}let ft=Sa(L.text);U+=K+ft*$}U=W+s;for(let z=0;z<P.length;z++){let L=P[z],{width:K,font:gt}=H[z];if(a.font=gt,a.textBaseline=L.style.textBaseline,L.style._fill!==void 0){if(T)if(L.style.dropShadow)this._setupDropShadow(a,L.style,i,E);else{let Y=Sa(L.text);U+=K+Y*$;continue}else{let Y=At.measureFont(gt),Q=L.style.lineHeight||Y.fontSize,j={width:K,height:Q,lineHeight:Q,lines:[L.text]};a.fillStyle=vs(L.style._fill,a,j,s*2,U-s,w)}this._drawLetterSpacing(L.text,L.style,n,U,B+s-S,!1,$)}let ft=Sa(L.text);U+=K+ft*$}w+=G}}}_setFillAndStrokeStyles(t,e,s,i,n,o=0,a=0){if(t.fillStyle=e._fill?vs(e._fill,t,s,i*2,o,a):null,e._stroke?.width){let u=n+i*2;t.strokeStyle=vs(e._stroke,t,s,u,o,a)}}_setupDropShadow(t,e,s,i){t.fillStyle="black",t.strokeStyle="black";let n=e.dropShadow,o=n.color,a=n.alpha;t.shadowColor=X.shared.setValue(o).setAlpha(a).toRgbaString();let u=n.blur*s,l=n.distance*s;t.shadowBlur=u,t.shadowOffsetX=Math.cos(n.angle)*l,t.shadowOffsetY=Math.sin(n.angle)*l+i}_getAlignmentOffset(t,e,s){return s==="right"?e-t:s==="center"?(e-t)/2:0}_drawLetterSpacing(t,e,s,i,n,o=!1,a=0){let{context:u}=s,l=e.letterSpacing,c=!1;if(At.experimentalLetterSpacingSupported&&(At.experimentalLetterSpacing?(u.letterSpacing=`${l}px`,u.textLetterSpacing=`${l}px`,c=!0):(u.letterSpacing="0px",u.textLetterSpacing="0px")),(l===0||c)&&a===0){o?u.strokeText(t,i,n):u.fillText(t,i,n);return}if(a!==0&&(l===0||c)){let g=t.split(" "),_=i,b=u.measureText(" ").width;for(let y=0;y<g.length;y++)o?u.strokeText(g[y],_,n):u.fillText(g[y],_,n),_+=u.measureText(g[y]).width+b+a;return}let h=i,d=At.graphemeSegmenter(t),f=u.measureText(t).width,p=0;for(let g=0;g<d.length;++g){let _=d[g];o?u.strokeText(_,h,n):u.fillText(_,h,n);let b="";for(let y=g+1;y<d.length;++y)b+=d[y];p=u.measureText(b).width,h+=f-p+l,_===" "&&(h+=a),f=p}}},Je=new $v;bs();fr();C();C();ye();Jc();function Ea(r,t){let{texture:e,bounds:s}=r,i=t._style._getFinalPadding();au(s,t._anchor,e);let n=t._anchor._x*i*2,o=t._anchor._y*i*2;s.minX-=i-n,s.minY-=i-o,s.maxX-=i-n,s.maxY-=i-o}Yn();var uc=class extends Br{};var Ca=class{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new vt({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(let t in this._managedTexts.items){let e=this._managedTexts.items[t];e?._autoResolution&&e.onViewUpdate()}}validateRenderable(t){let e=this._getGpuText(t),s=t.styleKey;return e.currentKey!==s?!0:t._didTextUpdate}addRenderable(t,e){let s=this._getGpuText(t);if(t._didTextUpdate){let i=t._autoResolution?this._renderer.resolution:t.resolution;(s.currentKey!==t.styleKey||t._resolution!==i)&&this._updateGpuText(t),t._didTextUpdate=!1,Ea(s,t)}this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){let e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){let e=new uc;return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,this._managedTexts.add(t),e}onTextUnload(t){let e=t._gpuData[this._renderer.uid];if(!e)return;let{canvasText:s}=this._renderer;s.getReferenceCount(e.currentKey)>0?s.decreaseReferenceCount(e.currentKey):e.texture&&s.returnTexture(e.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}};Ca.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"text"};C();_r();kr();xt();fr();gu();var xn=class{constructor(t,e){this._activeTextures={},this._renderer=t,this._retainCanvasContext=e}getTexture(t,e,s,i){typeof t=="string"&&(I("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:s,resolution:e}),t.style instanceof Ot||(t.style=new Ot(t.style)),t.textureStyle instanceof Qt||(t.textureStyle=new Qt(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());let{text:n,style:o,textureStyle:a,autoGenerateMipmaps:u}=t,l=t.resolution??this._renderer.resolution,{frame:c,canvasAndContext:h}=Je.getCanvasAndContext({text:n,style:o,resolution:l}),d=Ri(h.canvas,c.width,c.height,l,u);if(a&&(d.source.style=a),o.trim&&(c.pad(o.padding),d.frame.copyFrom(c),d.frame.scale(1/l),d.updateUvs()),o.filters){let f=this._applyFilters(d,o.filters);return this.returnTexture(d),Je.returnCanvasAndContext(h),f}return this._renderer.texture.initSource(d._source),this._retainCanvasContext||Je.returnCanvasAndContext(h),d}returnTexture(t){let e=t.source,s=e.resource;if(this._retainCanvasContext&&s?.getContext){let i=s.getContext("2d");i&&Je.returnCanvasAndContext({canvas:s,context:i})}e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",yt.returnTexture(t,!0)}renderTextToCanvas(){I("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;let e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;let s=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[e]={texture:s,usageCount:1},s}decreaseReferenceCount(t){let e=this._activeTextures[t];e&&(e.usageCount--,e.usageCount===0&&(this.returnTexture(e.texture),this._activeTextures[t]=null))}getReferenceCount(t){return this._activeTextures[t]?.usageCount??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){let s=this._renderer.renderTarget.renderTarget,i=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(s,!1),i}destroy(){this._renderer=null;for(let t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}};var Aa=class extends xn{constructor(t){super(t,!0)}};Aa.extension={type:[m.CanvasSystem],name:"canvasText"};C();var wa=class extends xn{constructor(t){super(t,!1)}};wa.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"canvasText"};O.add(Aa);O.add(wa);O.add(Ca);var Zr=class extends Ms{constructor(...t){let e=mn(t,"Text");super(e,Ot),this.renderPipeId="text",e.textureStyle&&(this.textureStyle=e.textureStyle instanceof Qt?e.textureStyle:new Qt(e.textureStyle)),this.autoGenerateMipmaps=e.autoGenerateMipmaps??st.defaultOptions.autoGenerateMipmaps}updateBounds(){let t=this._bounds,e=this._anchor,s=0,i=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=Je.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Je.returnCanvasAndContext(o),s=n.width,i=n.height}else{let n=At.measureText(this._text,this._style);s=n.width,i=n.height}t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}};var lc=class extends Iv{resolveQueueItem(t,e){return t instanceof lt?this.resolveContainerQueueItem(t,e):t instanceof st||t instanceof D?e.push(t.source):t instanceof Kt&&e.push(t),null}resolveContainerQueueItem(t,e){t instanceof we||t instanceof zv||t instanceof or?e.push(t.texture.source):t instanceof Zr?e.push(t):t instanceof xs?e.push(t.context):t instanceof ic&&t.textures.forEach(s=>{s.source?e.push(s.source):e.push(s.texture.source)})}resolveGraphicsContextQueueItem(t){this.renderer.graphicsContext.getGpuContext(t);let{instructions:e}=t;for(let s of e)if(s.action==="texture"){let{image:i}=s.data;return i.source}else if(s.action==="fill"){let{texture:i}=s.data.style;return i.source}return null}};C();Wt();ci();pt();fr();oa();C();C();Tr();ye();yl();bs();oa();Pl();var up=class extends xs{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}},_n=class{constructor(t){this._renderer=t,this._managedBitmapTexts=new vt({renderer:t,type:"renderable",priority:-2,name:"bitmapText"})}validateRenderable(t){let e=this._getGpuBitmapText(t);return this._renderer.renderPipes.graphics.validateRenderable(e)}addRenderable(t,e){let s=this._getGpuBitmapText(t);vA(t,s),t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,s)),this._renderer.renderPipes.graphics.addRenderable(s,e),s.context.customShader&&this._updateDistanceField(t)}updateRenderable(t){let e=this._getGpuBitmapText(t);vA(t,e),this._renderer.renderPipes.graphics.updateRenderable(e),e.context.customShader&&this._updateDistanceField(t)}_updateContext(t,e){let{context:s}=e,i=Yr.getFont(t.text,t._style);if(s.clear(),i.distanceField.type!=="none"){let b=this.getSdfShader();b&&(s.customShader||(s.customShader=b))}let n=At.graphemeSegmenter(t.text),o=t._style,a=i.baseLineOffset,u=fn(n,o,i,!0),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),s.translate(-t._anchor._x*h-l,-t._anchor._y*d-l).scale(c,c);let f=i.applyFillAsTint?o._fill.color:16777215,p=i.fontMetrics.fontSize,g=i.lineHeight;o.lineHeight&&(p=o.fontSize/c,g=o.lineHeight/c);let _=(g-p)/2;_-i.baseLineOffset<0&&(_=0);for(let b=0;b<u.lines.length;b++){let y=u.lines[b];for(let v=0;v<y.charPositions.length;v++){let T=y.chars[v],S=i.chars[T];if(S?.texture){let E=S.texture;s.texture(E,f,Math.round(y.charPositions[v]+S.xOffset),Math.round(a+S.yOffset+_),E.orig.width,E.orig.height)}}a+=g}}_getGpuBitmapText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){let e=new up;return t._gpuData[this._renderer.uid]=e,this._updateContext(t,e),this._managedBitmapTexts.add(t),e}_updateDistanceField(t){let e=this._getGpuBitmapText(t).context,s=t._style.fontFamily,i=at.get(`${s}-bitmap`),{a:n,b:o,c:a,d:u}=t.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=i.baseRenderedFontSize/t._style.fontSize,f=h*i.distanceField.range*(1/d);e.customShader.resources.localUniforms.uniforms.uDistance=f}destroy(){this._managedBitmapTexts.destroy(),this._renderer=null,this._managedBitmapTexts=null}};function vA(r,t){t.groupTransform=r.groupTransform,t.groupColorAlpha=r.groupColorAlpha,t.groupColor=r.groupColor,t.groupBlendMode=r.groupBlendMode,t.globalDisplayStatus=r.globalDisplayStatus,t.groupTransform=r.groupTransform,t.localDisplayStatus=r.localDisplayStatus,t.groupAlpha=r.groupAlpha,t._roundPixels=r._roundPixels}var Pa=class extends _n{getSdfShader(){return null}};Pa.extension={type:[m.CanvasPipes],name:"bitmapText"};C();ot();fs();Wn();Vn();ps();ku();lr();te();var Yv={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
3085
3085
|
struct LocalUniforms {
|
|
3086
3086
|
uColor:vec4<f32>,
|
|
3087
3087
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -3108,7 +3108,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3108
3108
|
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
3109
3109
|
`,main:`
|
|
3110
3110
|
outColor = vec4<f32>(calculateMSDFAlpha(outColor, vColor, localUniforms.uDistance));
|
|
3111
|
-
`}}
|
|
3111
|
+
`}},jv={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
3112
3112
|
uniform mat3 uTransformMatrix;
|
|
3113
3113
|
uniform vec4 uColor;
|
|
3114
3114
|
uniform float uRound;
|
|
@@ -3124,7 +3124,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3124
3124
|
uniform float uDistance;
|
|
3125
3125
|
`,main:`
|
|
3126
3126
|
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
|
|
3127
|
-
`}};var
|
|
3127
|
+
`}};var qv={name:"msdf-bit",fragment:{header:`
|
|
3128
3128
|
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
|
|
3129
3129
|
|
|
3130
3130
|
// MSDF
|
|
@@ -3151,7 +3151,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3151
3151
|
return coverage;
|
|
3152
3152
|
|
|
3153
3153
|
}
|
|
3154
|
-
`}},
|
|
3154
|
+
`}},Kv={name:"msdf-bit",fragment:{header:`
|
|
3155
3155
|
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
|
|
3156
3156
|
|
|
3157
3157
|
// MSDF
|
|
@@ -3178,18 +3178,18 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3178
3178
|
|
|
3179
3179
|
return coverage;
|
|
3180
3180
|
}
|
|
3181
|
-
`}};var
|
|
3181
|
+
`}};var Zv,Qv,cc=class extends Vt{constructor(t){let e=new dt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new F,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});Zv??(Zv=Cr({name:"sdf-shader",bits:[Li,Hi(t),Yv,qv,wr]})),Qv??(Qv=Ar({name:"sdf-shader",bits:[Ni,Wi(t),jv,Kv,Pr]})),super({glProgram:Qv,gpuProgram:Zv,resources:{localUniforms:e,batchSamplers:$i(t)}})}};var Ba=class extends _n{getSdfShader(){return new cc(this._renderer.limits.maxBatchableTextures)}};Ba.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"bitmapText"};O.add(Pa);O.add(Ba);var bn=class extends Ms{constructor(...t){var e;let s=mn(t,"BitmapText");s.style??(s.style=s.style||{}),(e=s.style).fill??(e.fill=16777215),super(s,Ot),this.renderPipeId="bitmapText"}_onTouch(t){this._gcLastUsed=t;for(let e in this._gpuData)this._gpuData[e]?._onTouch(t)}updateBounds(){let t=this._bounds,e=this._anchor,s=Yr.measureText(this.text,this._style),i=s.scale,n=s.offsetY*i,o=s.width*i,a=s.height*i,u=this._style._stroke;u&&(o+=u.width,a+=u.width),t.minX=-e._x*o,t.maxX=t.minX+o,t.minY=-e._y*(a+n),t.maxY=t.minY+a}set resolution(t){t!==null&&k("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.")}get resolution(){return this._resolution}};Wt();kr();pt();fr();It();fr();function t1(r){let t=r._stroke,e=r._fill,n=[`div { ${[`color: ${X.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa()}`,`font-size: ${r.fontSize}px`,`font-family: ${r.fontFamily}`,`font-weight: ${r.fontWeight}`,`font-style: ${r.fontStyle}`,`font-variant: ${r.fontVariant}`,`letter-spacing: ${r.letterSpacing}px`,`text-align: ${r.align}`,`padding: ${r.padding}px`,`white-space: ${r.whiteSpace==="pre"&&r.wordWrap?"pre-wrap":r.whiteSpace}`,...r.lineHeight?[`line-height: ${r.lineHeight}px`]:[],...r.wordWrap?[`word-break: ${r.breakWords?"break-word":"normal"}`,`max-width: ${r.wordWrapWidth}px`]:[],...t?[EA(t)]:[],...r.dropShadow?[Jv(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return SM(r.tagStyles,n),n.join(" ")}function Jv(r){let t={...r},e=X.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa(),s=Math.round(Math.cos(t.angle)*t.distance),i=Math.round(Math.sin(t.angle)*t.distance),n=`${s}px ${i}px`;return t.blur>0?`text-shadow: ${n} ${t.blur}px ${e}`:`text-shadow: ${n} ${e}`}function EA(r){let t=X.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();return[`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${t}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${t}`,"paint-order: stroke"].join(";")}var TA={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},SA={fill:r=>`color: ${X.shared.setValue(r).toHexa()}`,breakWords:r=>`word-break: ${r?"break-all":"normal"}`,stroke:EA,dropShadow:r=>r===!0?Jv(Ot.defaultDropShadow):r&&typeof r=="object"?Jv({...Ot.defaultDropShadow,...r}):""};function SM(r,t){for(let e in r){let s=r[e],i=[];for(let n in s)SA[n]?i.push(SA[n](s[n])):TA[n]&&i.push(TA[n].replace("{{VALUE}}",s[n]));t.push(`${e} { ${i.join(";")} }`)}}var hc=class r extends Ot{constructor(t={}){super(t),this._cssOverrides=[],this.cssOverrides=t.cssOverrides??[],this.tagStyles=t.tagStyles??{}}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??{},this.update())}set cssOverrides(t){this._cssOverrides=t instanceof Array?t:[t],this.update()}get cssOverrides(){return this._cssOverrides}update(){this._cssStyle=null,super.update()}clone(){return new r({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{...this.tagStyles}})}get cssStyle(){return this._cssStyle||(this._cssStyle=t1(this)),this._cssStyle}addOverride(...t){let e=t.filter(s=>!this.cssOverrides.includes(s));e.length>0&&(this.cssOverrides.push(...e),this.update())}removeOverride(...t){let e=t.filter(s=>this.cssOverrides.includes(s));e.length>0&&(this.cssOverrides=this.cssOverrides.filter(s=>!e.includes(s)),this.update())}set fill(t){typeof t!="string"&&typeof t!="number"&&k("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=t}set stroke(t){t&&typeof t!="string"&&typeof t!="number"&&k("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=t}};mt();var CA="http://www.w3.org/2000/svg",AA="http://www.w3.org/1999/xhtml",yn=class{constructor(){this.svgRoot=document.createElementNS(CA,"svg"),this.foreignObject=document.createElementNS(CA,"foreignObject"),this.domElement=document.createElementNS(AA,"div"),this.styleElement=document.createElementNS(AA,"style");let{foreignObject:t,svgRoot:e,styleElement:s,domElement:i}=this;t.setAttribute("width","10000"),t.setAttribute("height","10000"),t.style.overflow="hidden",e.appendChild(t),t.appendChild(s),t.appendChild(i),this.image=N.get().createImage()}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null}};var wA;function dc(r,t,e,s){s||(s=wA||(wA=new yn));let{domElement:i,styleElement:n,svgRoot:o}=s;i.innerHTML=`<style>${t.cssStyle};</style><div style='padding:0'>${r}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),e&&(n.textContent=e),document.body.appendChild(o);let a=i.scrollWidth,u=i.scrollHeight;if(o.remove(),t.dropShadow){let{distance:c,angle:h,blur:d}=t.dropShadow,f=Math.abs(Math.round(Math.cos(h)*c)),p=Math.abs(Math.round(Math.sin(h)*c));a+=f+d,u+=p+d}let l=t.padding*2;return{width:a-l,height:u-l}}C();C();ht();ye();Yn();var fc=class extends Br{constructor(){super(...arguments),this.generatingTexture=!1,this.currentKey="--"}destroy(){this.texturePromise=null,this.generatingTexture=!1,this.currentKey="--",super.destroy()}};var Ra=class{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new vt({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"htmlText"})}resolutionChange(){for(let t in this._managedTexts.items){let e=this._managedTexts.items[t];e?._autoResolution&&e.onViewUpdate()}}validateRenderable(t){let e=this._getGpuText(t),s=t.styleKey;return e.currentKey!==s}addRenderable(t,e){let s=this._getGpuText(t);if(t._didTextUpdate){let i=t._autoResolution?this._renderer.resolution:t.resolution;(s.currentKey!==t.styleKey||t.resolution!==i)&&this._updateGpuText(t).catch(n=>{console.error(n)}),t._didTextUpdate=!1,Ea(s,t)}this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuText(t);e._batcher.updateElement(e)}async _updateGpuText(t){t._didTextUpdate=!1;let e=this._getGpuText(t);if(e.generatingTexture)return;let s=e.texturePromise;e.texturePromise=null,e.generatingTexture=!0,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;let i=this._renderer.htmlText.getTexturePromise(t);s&&(i=i.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(e.currentKey),this._renderer.htmlText.returnTexturePromise(s)})),e.texturePromise=i,e.currentKey=t.styleKey,e.texture=await i;let n=t.renderGroup||t.parentRenderGroup;n&&(n.structureDidChange=!0),e.generatingTexture=!1,Ea(e,t)}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){let e=new fc;return e.renderable=t,e.transform=t.groupTransform,e.texture=D.EMPTY,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,t._gpuData[this._renderer.uid]=e,this._managedTexts.add(t),e}onTextUnload(t){let e=t._gpuData[this._renderer.uid];if(!e)return;let{htmlText:s}=this._renderer;s.getReferenceCount(e.currentKey)===null?s.returnTexturePromise(e.texturePromise):s.decreaseReferenceCount(e.currentKey)}destroy(){this._managedTexts.destroy(),this._renderer=null}};Ra.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"htmlText"};C();Zs();_r();Pe();Xd();pt();xr();gu();function e1(r,t){let e=t.fontFamily,s=[],i={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){i[u]||(s.push(u),i[u]=!0)}if(Array.isArray(e))for(let u=0;u<e.length;u++)a(e[u]);else a(e);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l)});for(let u in t.tagStyles){let l=t.tagStyles[u].fontFamily;a(l)}return s}Tr();mt();async function r1(r){let e=await(await N.get().fetch(r)).blob(),s=new FileReader;return await new Promise((n,o)=>{s.onloadend=()=>n(s.result),s.onerror=o,s.readAsDataURL(e)})}async function s1(r,t){let e=await r1(t);return`@font-face {
|
|
3182
3182
|
font-family: "${r.fontFamily}";
|
|
3183
3183
|
font-weight: ${r.fontWeight};
|
|
3184
3184
|
font-style: ${r.fontStyle};
|
|
3185
3185
|
src: url('${e}');
|
|
3186
|
-
}`}var
|
|
3187
|
-
`)))}return
|
|
3188
|
-
`)}function
|
|
3189
|
-
`)}
|
|
3186
|
+
}`}var lp=new Map;async function i1(r){let t=r.filter(e=>at.has(`${e}-and-url`)).map(e=>{if(!lp.has(e)){let{entries:s}=at.get(`${e}-and-url`),i=[];s.forEach(n=>{let o=n.url,u=n.faces.map(l=>({weight:l.weight,style:l.style}));i.push(...u.map(l=>s1({fontWeight:l.weight,fontStyle:l.style,fontFamily:e},o)))}),lp.set(e,Promise.all(i).then(n=>n.join(`
|
|
3187
|
+
`)))}return lp.get(e)});return(await Promise.all(t)).join(`
|
|
3188
|
+
`)}function n1(r,t,e,s,i){let{domElement:n,styleElement:o,svgRoot:a}=i;n.innerHTML=`<style>${t.cssStyle}</style><div style='padding:0;'>${r}</div>`,n.setAttribute("style",`transform: scale(${e});transform-origin: top left; display: inline-block`),o.textContent=s;let{width:u,height:l}=i.image;return a.setAttribute("width",u.toString()),a.setAttribute("height",l.toString()),new XMLSerializer().serializeToString(a)}Zs();function o1(r,t){let e=be.getOptimalCanvasAndContext(r.width,r.height,t),{context:s}=e;return s.clearRect(0,0,r.width,r.height),s.drawImage(r,0,0),e}function a1(r,t,e){return new Promise(async s=>{e&&await new Promise(i=>setTimeout(i,100)),r.onload=()=>{s()},r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(t)}`,r.crossOrigin="anonymous"})}var Ma=class{constructor(t){this._activeTextures={},this._renderer=t,this._createCanvas=t.type===Tt.WEBGPU}getTexture(t){return this.getTexturePromise(t)}getManagedTexture(t){let e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].promise;let s=this._buildTexturePromise(t).then(i=>(this._activeTextures[e].texture=i,i));return this._activeTextures[e]={texture:null,promise:s,usageCount:1},s}getReferenceCount(t){return this._activeTextures[t]?.usageCount??null}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}decreaseReferenceCount(t){let e=this._activeTextures[t];e&&(e.usageCount--,e.usageCount===0&&(e.texture?this._cleanUp(e.texture):e.promise.then(s=>{e.texture=s,this._cleanUp(e.texture)}).catch(()=>{k("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[t]=null))}getTexturePromise(t){return this._buildTexturePromise(t)}async _buildTexturePromise(t){let{text:e,style:s,resolution:i,textureStyle:n,autoGenerateMipmaps:o}=t,a=Ct.get(yn),u=e1(e,s),l=await i1(u),c=dc(e,s,l,a),h=Math.ceil(Math.ceil(Math.max(1,c.width)+s.padding*2)*i),d=Math.ceil(Math.ceil(Math.max(1,c.height)+s.padding*2)*i),f=a.image,p=2;f.width=(h|0)+p,f.height=(d|0)+p;let g=n1(e,s,i,l,a);await a1(f,g,ul()&&u.length>0);let _=f,b;this._createCanvas&&(b=o1(f,i));let y=Ri(b?b.canvas:_,f.width-p,f.height-p,i,o);return n&&(y.source.style=n),this._createCanvas&&(this._renderer.texture.initSource(y.source),be.returnCanvasAndContext(b)),Ct.return(a),y}returnTexturePromise(t){t.then(e=>{this._cleanUp(e)}).catch(()=>{k("HTMLTextSystem: Failed to clean texture")})}_cleanUp(t){yt.returnTexture(t,!0),t.source.resource=null,t.source.uploadMethodId="unknown"}destroy(){this._renderer=null;for(let t in this._activeTextures)this._activeTextures[t]&&this.returnTexturePromise(this._activeTextures[t].promise);this._activeTextures=null}};Ma.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"htmlText"};O.add(Ma);O.add(Ra);var pc=class extends Ms{constructor(...t){let e=mn(t,"HtmlText");super(e,hc),this.renderPipeId="htmlText",e.textureStyle&&(this.textureStyle=e.textureStyle instanceof Qt?e.textureStyle:new Qt(e.textureStyle)),this.autoGenerateMipmaps=e.autoGenerateMipmaps??st.defaultOptions.autoGenerateMipmaps}updateBounds(){let t=this._bounds,e=this._anchor,s=dc(this.text,this._style),{width:i,height:n}=s;t.minX=-e._x*i,t.maxX=t.minX+i,t.minY=-e._y*n,t.maxY=t.minY+n}get text(){return this._text}set text(t){let e=this._sanitiseText(t.toString());super.text=e}_sanitiseText(t){return this._removeInvalidHtmlTags(t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," "))}_removeInvalidHtmlTags(t){let e=/<[^>]*?(?=<|$)/g;return t.replace(e,"")}};var mc=class extends lc{uploadQueueItem(t){t instanceof st?this.uploadTextureSource(t):t instanceof Zr?this.uploadText(t):t instanceof pc?this.uploadHTMLText(t):t instanceof bn?this.uploadBitmapText(t):t instanceof Kt&&this.uploadGraphicsContext(t)}uploadTextureSource(t){this.renderer.texture.initSource(t)}uploadText(t){this.renderer.renderPipes.text.initGpuText(t)}uploadBitmapText(t){this.renderer.renderPipes.bitmapText.initGpuText(t)}uploadHTMLText(t){this.renderer.renderPipes.htmlText.initGpuText(t)}uploadGraphicsContext(t){this.renderer.graphicsContext.getGpuContext(t);let{instructions:e}=t;for(let s of e)if(s.action==="texture"){let{image:i}=s.data;this.uploadTextureSource(i.source)}else if(s.action==="fill"){let{texture:i}=s.data.style;this.uploadTextureSource(i.source)}return null}};var cp=class extends mc{destroy(){super.destroy(),clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null}};cp.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"prepare"};function EM(r){let t=[],e=0;for(let s=0;s<r;s++)t[e]={texture:{sampleType:"float",viewDimension:"2d",multisampled:!1},binding:e,visibility:GPUShaderStage.FRAGMENT},e++,t[e]={sampler:{type:"filtering"},binding:e,visibility:GPUShaderStage.FRAGMENT},e++;return t}function CM(r){let t={},e=0;for(let s=0;s<r;s++)t[`textureSource${s+1}`]=e++,t[`textureSampler${s+1}`]=e++;return t}function AM(r){let t=r.split(/([\n{}])/g).map(i=>i.trim()).filter(i=>i.length),e="";return t.map(i=>{let n=e+i;return i==="{"?e+=" ":i==="}"&&(e=e.substr(0,e.length-4),n=e+i),n}).join(`
|
|
3189
|
+
`)}uu();lu();var u1=class{constructor(t){this.priority=0,this.pipe="scissorMask",this.mask=t,this.mask.renderable=!1,this.mask.measurable=!1}addBounds(t,e){Ci(this.mask,t,e)}addLocalBounds(t,e){Ai(this.mask,t,e)}containsPoint(t,e){let s=this.mask;return e(s,t)}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}destroy(){this.reset()}};function wM(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
|
|
3190
3190
|
out vec4 finalColor;
|
|
3191
3191
|
${r}
|
|
3192
|
-
`,r}var AM={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 wM(r){return AM[r]}xt();var wA={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},PM=new Proxy(wA,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${wA[t]}' instead`),r[t]}});xt();var cp=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(cp||{}),BM=new Proxy(cp,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${cp[t]}' instead`),r[t]}}),hp=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(hp||{}),RM=new Proxy(hp,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${hp[t]}' instead`),r[t]}});le();Tr();Yt();pt();Wt();var Ma=class r extends st{constructor(t){let{faces:e,...s}=t;r._validateFaces(e);let i=e.right,n=i.resolution,o=i.format,a=i.alphaMode,u=["resolution","format","alphaMode","dimensions","viewDimension"].filter(l=>s[l]!==void 0);u.length&&k(`[CubeTextureSource] Ignoring option(s) [${u.join(", ")}]; these are derived from face sources.`),super({...s,resource:e,width:i.width,height:i.height,dimensions:"2d",viewDimension:"cube",arrayLayerCount:6,resolution:n,format:o,alphaMode:a}),this.uploadMethodId="cube",this.faces=e;for(let l of Object.keys(e)){let c=e[l];c.on("update",this._onFaceUpdate,this),c.on("resize",this._onFaceResize,this),c.on("unload",this._onFaceUpdate,this)}}destroy(){let t=this.faces;if(t)for(let e of Object.keys(t)){let s=t[e];s.off("update",this._onFaceUpdate,this),s.off("resize",this._onFaceResize,this),s.off("unload",this._onFaceUpdate,this)}super.destroy()}_onFaceUpdate(){this.emit("update",this)}_onFaceResize(t){r._validateFaces(this.faces),this.resize(t.width,t.height,t.resolution)}static _validateFaces(t){if(!t.right||!t.left||!t.top||!t.bottom||!t.front||!t.back)throw new Error("[CubeTextureSource] Requires { left, right, top, bottom, front, back } faces.");let e=t.right,s=e.pixelWidth,i=e.pixelHeight,n=e.format,o=e.alphaMode,a=e.resolution;for(let u of Object.keys(t)){let l=t[u];if(l.pixelWidth!==s||l.pixelHeight!==i)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different size. All faces must match.`);if(l.format!==n)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different format. All faces must match.`);if(l.alphaMode!==o)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different alphaMode. All faces must match.`);if(l.resolution!==a)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different resolution. All faces must match.`)}}};ht();var a1=["left","right","top","bottom","front","back"];function MM(r,t){let e=t?{...t}:{};delete e.label;let s=Object.keys(e).sort(),i=s.length?`|${s.map(o=>`${o}=${String(e[o])}`).join("&")}`:"";return`cube:${a1.map(o=>r[o]).join(",")}${i}`}var u1=class r extends St{constructor(t){super(),this.uid=et("cubeTexture"),this.destroyed=!1;let{label:e,source:s}=t;this.label=e,this.source=s,this.source.label=this.label??this.source.label}static from(t,e=!1){if(t instanceof Ma)return new r({source:t});let{faces:s,...i}=t,n=null,o=a1.every(c=>typeof s[c]=="string");if(!e&&o&&(n=MM(s,i),at.has(n)))return at.get(n);let a=c=>c.isTexture?c:D.from(c),u={};for(let c of a1)u[c]=a(s[c]).source;let l=new r({source:new Ma({...i,faces:u}),label:i.label});return n&&(at.set(n,l),l.once("destroy",()=>{at.has(n)&&at.remove(n)})),l}destroy(t=!1){this.destroyed||(this.destroyed=!0,t&&this.source.destroy(),this.emit("destroy",this),this.removeAllListeners())}};Vd();Dd();Pe();Wt();var l1=Object.create(null),c1=Object.create(null);function DM(r){var t;if(r.type===Tt.WEBGPU)return c1[t=r.uid]||(c1[t]=r.gpu.device.createTexture({label:"ExternalSource placeholder",size:{width:1,height:1},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST})),c1[r.uid];if(!l1[r.uid]){let e=r.gl,s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),l1[r.uid]=s}return l1[r.uid]}var h1=class extends st{constructor({resource:t,renderer:e,label:s,width:i,height:n}){t||(t=DM(e)),i||(i=i??t?.width??1),n||(n=n??t?.height??1),super({resource:t,width:i,height:n,label:s,autoGarbageCollect:!1}),this._renderer=e,this._initGpuData(t)}static test(t){return globalThis.GPUTexture&&t instanceof GPUTexture||globalThis.WebGLTexture&&t instanceof WebGLTexture}_validateTexture(t){let e=this._renderer,s=!!e.gpu,i=globalThis.GPUTexture&&t instanceof GPUTexture,n=globalThis.WebGLTexture&&t instanceof WebGLTexture;if(s&&n)throw new Error("Cannot use WebGLTexture with a WebGPU renderer");if(!s&&i)throw new Error("Cannot use GPUTexture with a WebGL renderer");if(!s){let o=e.gl;if(o&&!o.isTexture(t))throw new Error("WebGLTexture does not belong to this renderer's WebGL context")}}_initGpuData(t){let e=this._renderer;this._validateTexture(t),e.gpu?this._gpuData[e.uid]=new Eo(t):this._gpuData[e.uid]=new Zi(t)}updateGPUTexture(t,e,s){let i=this._renderer,n=this._gpuData[i.uid];if(this.resource=t,i.gpu){this._validateTexture(t);let o=n;if(o.gpuTexture!==t){o.gpuTexture=t,o.textureView=null;let l=i.texture;l?._bindGroupHash&&(l._bindGroupHash[this.uid]=null)}let a=e??t.width,u=s??t.height;this.resize(a,u)}else{this._validateTexture(t);let o=n;o.texture=t,e!==void 0&&s!==void 0&&this.resize(e,s)}this.emit("update",this)}destroy(){let t=this._renderer;delete this._gpuData[t.uid],super.destroy()}};Ns();var d1=class{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,e,s){let i=e.width,n=e.height;if(s){let o=t.width/2/i,a=t.height/2/n,u=t.x/i+o,l=t.y/n+a;s=q.add(s,q.NW),this.x0=u+o*q.uX(s),this.y0=l+a*q.uY(s),s=q.add(s,2),this.x1=u+o*q.uX(s),this.y1=l+a*q.uY(s),s=q.add(s,2),this.x2=u+o*q.uX(s),this.y2=l+a*q.uY(s),s=q.add(s,2),this.x3=u+o*q.uX(s),this.y3=l+a*q.uY(s)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;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.js/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}]`}};function FM(r){let t=r.toString(),e=t.indexOf("{"),s=t.lastIndexOf("}");if(e===-1||s===-1)throw new Error("getFunctionBody: No body found in function definition");return t.slice(e+1,s).trim()}xt();function GM(r,t){return I("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(!0,t)}br();var f1=class extends Jt{constructor(t){typeof t=="function"&&(t={render:t});let{render:e,...s}=t;super({label:"RenderContainer",...s}),this.renderPipeId="customRender",this.batched=!1,e&&(this.render=e),this.containsPoint=t.containsPoint??(()=>!1),this.addBounds=t.addBounds??(()=>!1)}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds)}render(t){}};xt();function UM(r,t,e){I("8.7.0","Please use container.collectRenderables instead.");let s=e.renderPipes?e:e.batch.renderer;return r.collectRenderables(t,s,null)}function IM(r,t){let e=t._scale,s=t._pivot,i=t._position,n=e._x,o=e._y,a=s._x,u=s._y;r.a=t._cx*n,r.b=t._sx*n,r.c=t._cy*o,r.d=t._sy*o,r.tx=i._x-(a*r.a+u*r.c),r.ty=i._y-(a*r.b+u*r.d)}function kM(r,t,e){let s=r.a,i=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=t.a,c=t.b,h=t.c,d=t.d;e.a=s*l+i*h,e.b=s*c+i*d,e.c=n*l+o*h,e.d=n*c+o*d,e.tx=a*l+u*h+t.tx,e.ty=a*c+u*d+t.ty}It();zr();var gc=class{constructor(){this._gradients=[],this._nextId=0}addStyle(t){if(!(t.fill instanceof Nt))return null;let e=`pixi-grad-${this._nextId++}`;return this._gradients.push({id:e,gradient:t.fill,textureSpace:t.textureSpace??"local"}),`url(#${e})`}build(){if(this._gradients.length===0)return"";let t=["<defs>"];for(let{id:e,gradient:s,textureSpace:i}of this._gradients){let n=i==="global"?"userSpaceOnUse":"objectBoundingBox",o=OM(s.colorStops);if(s.type==="radial"){let a=s.outerCenter?.x??.5,u=s.outerCenter?.y??.5,l=s.outerRadius??.5,c=s.center?.x??a,h=s.center?.y??u;t.push(`<radialGradient id="${e}" gradientUnits="${n}" cx="${a}" cy="${u}" r="${l}" fx="${c}" fy="${h}">`,o,"</radialGradient>")}else{let a=s.start?.x??0,u=s.start?.y??0,l=s.end?.x??1,c=s.end?.y??0;t.push(`<linearGradient id="${e}" gradientUnits="${n}" x1="${a}" y1="${u}" x2="${l}" y2="${c}">`,o,"</linearGradient>")}}return t.push("</defs>"),t.join("")}};function OM(r){return r.map(t=>{let e=X.shared.setValue(t.color).toHex();return`<stop offset="${t.offset}" stop-color="${e}"/>`}).join("")}var bn=Math.PI*2,LM=new Set(["regularPoly","roundPoly","roundShape","filletRect","chamferRect","arcTo"]);function Ds(r,t=2,e=!1){if(r.instructions.some(n=>LM.has(n.action)))return VM(r,t,e);let s=[],i=!1;for(let n=0;n<r.instructions.length;n++){let o=r.instructions[n],a=o.data;switch(o.action){case"moveTo":s.push(`M${ge(a[0],a[1],null,t)}`),i=!0;break;case"lineTo":s.push(`L${ge(a[0],a[1],null,t)}`),i=!0;break;case"quadraticCurveTo":s.push(`Q${ge(a[0],a[1],null,t)} ${ge(a[2],a[3],null,t)}`),i=!0;break;case"bezierCurveTo":s.push(`C${ge(a[0],a[1],null,t)} ${ge(a[2],a[3],null,t)} ${ge(a[4],a[5],null,t)}`),i=!0;break;case"arcToSvg":s.push(`A${tt(a[0],t)} ${tt(a[1],t)} ${tt(a[2],t)} ${a[3]} ${a[4]} ${ge(a[5],a[6],null,t)}`),i=!0;break;case"closePath":s.push("Z"),i=!1;break;case"arc":s.push(HM(a[0],a[1],a[2],a[3],a[4],!!a[5],i,t,e)),i=!NM(a[3],a[4],!!a[5]);break;case"rect":s.push(p1(a[0],a[1],a[2],a[3],a[4],t)),i=!1;break;case"circle":s.push(xc(a[0],a[1],a[2],a[2],a[3],t,e)),i=!1;break;case"ellipse":s.push(xc(a[0],a[1],a[2],a[3],a[4],t,e)),i=!1;break;case"roundRect":s.push(PA(a[0],a[1],a[2],a[3],a[4]??0,a[5],t,e)),i=!1;break;case"poly":s.push(BA(a[0],a[1]??!0,a[2],t)),i=!(a[1]??!0);break;case"addPath":s.push(WM(a[0],a[1],t,e)),i=!0;break}}return s.join("")}function NM(r,t,e){let s=t-r;return e?s>0&&(s-=bn):s<0&&(s+=bn),Math.abs(s)>=bn-1e-6}function tt(r,t){return parseFloat(r.toFixed(t)).toString()}function ge(r,t,e,s){if(e&&!e.isIdentity()){let i=e.a*r+e.c*t+e.tx,n=e.b*r+e.d*t+e.ty;return`${tt(i,s)} ${tt(n,s)}`}return`${tt(r,s)} ${tt(t,s)}`}function HM(r,t,e,s,i,n,o,a,u=!1){let l=i-s;if(n?l>0&&(l-=bn):l<0&&(l+=bn),Math.abs(l)>=bn-1e-6)return xc(r,t,e,e,null,a,u);if(u){let y=[];for(let v=0;v<=32;v++){let T=s+v/32*l,S=r+e*Math.cos(T),E=t+e*Math.sin(T),w=v===0?o?"L":"M":"L";y.push(`${w}${tt(S,a)} ${tt(E,a)}`)}return y.join("")}let c=r+e*Math.cos(s),h=t+e*Math.sin(s),d=r+e*Math.cos(i),f=t+e*Math.sin(i),p=Math.abs(l)>Math.PI?1:0,g=n?0:1;return`${o?"L":"M"}${tt(c,a)} ${tt(h,a)}A${tt(e,a)} ${tt(e,a)} 0 ${p} ${g} ${tt(d,a)} ${tt(f,a)}`}function xc(r,t,e,s,i,n,o=!1){let a=i&&!i.isIdentity()?i:null;if(!a&&!o)return`M${tt(r-e,n)} ${tt(t,n)}A${tt(e,n)} ${tt(s,n)} 0 1 1 ${tt(r+e,n)} ${tt(t,n)}A${tt(e,n)} ${tt(s,n)} 0 1 1 ${tt(r-e,n)} ${tt(t,n)}Z`;let u=64,l=[];for(let c=0;c<u;c++){let h=c/u*bn,d=r+e*Math.cos(h),f=t+s*Math.sin(h);l.push(`${c===0?"M":"L"}${ge(d,f,a,n)}`)}return l.push("Z"),l.join("")}function p1(r,t,e,s,i,n){return`M${ge(r,t,i,n)}L${ge(r+e,t,i,n)}L${ge(r+e,t+s,i,n)}L${ge(r,t+s,i,n)}Z`}function PA(r,t,e,s,i,n,o,a=!1){let u=n&&!n.isIdentity()?n:null;if(i<=0)return p1(r,t,e,s,u,o);if(i=Math.min(i,Math.min(e,s)/2),u||a){let l=[],h=[[r+e-i,t+i,-Math.PI/2],[r+e-i,t+s-i,0],[r+i,t+s-i,Math.PI/2],[r+i,t+i,Math.PI]],d=!0;for(let f=0;f<h.length;f++){let[p,g,_]=h[f];for(let b=0;b<=8;b++){let y=_+b/8*(Math.PI/2),v=p+i*Math.cos(y),T=g+i*Math.sin(y);l.push(`${d?"M":"L"}${ge(v,T,u,o)}`),d=!1}}return l.push("Z"),l.join("")}return`M${tt(r+i,o)} ${tt(t,o)}L${tt(r+e-i,o)} ${tt(t,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+e,o)} ${tt(t+i,o)}L${tt(r+e,o)} ${tt(t+s-i,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+e-i,o)} ${tt(t+s,o)}L${tt(r+i,o)} ${tt(t+s,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r,o)} ${tt(t+s-i,o)}L${tt(r,o)} ${tt(t+i,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+i,o)} ${tt(t,o)}Z`}function BA(r,t,e,s){if(r.length===0)return"";let i=[];if(typeof r[0]=="number"){let o=r;i.push(`M${ge(o[0],o[1],e,s)}`);for(let a=2;a<o.length;a+=2)i.push(`L${ge(o[a],o[a+1],e,s)}`)}else{let o=r;i.push(`M${ge(o[0].x,o[0].y,e,s)}`);for(let a=1;a<o.length;a++)i.push(`L${ge(o[a].x,o[a].y,e,s)}`)}return t&&i.push("Z"),i.join("")}function WM(r,t,e,s){return!t||t.isIdentity()?Ds(r,e,s):Ds(r.clone(!0).transform(t),e,s)}function VM(r,t,e){let s=r.shapePath.shapePrimitives,i=[];for(let n of s){let o=n.shape,a=n.transform;switch(o.type){case"polygon":{let u=o;i.push(BA(u.points,u.closePath,a,t));break}case"circle":{let u=o;i.push(xc(u.x,u.y,u.radius,u.radius,a,t,e));break}case"ellipse":{let u=o;i.push(xc(u.x,u.y,u.halfWidth,u.halfHeight,a,t,e));break}case"rectangle":{let u=o;i.push(p1(u.x,u.y,u.width,u.height,a,t));break}case"roundedRectangle":{let u=o;i.push(PA(u.x,u.y,u.width,u.height,u.radius,a,t,e));break}}}return i.join("")}It();function m1(r,t){let e=t.addStyle(r),s=[];return e?s.push(`fill="${e}"`):s.push(`fill="${X.shared.setValue(r.color).toHex()}"`),r.alpha<1&&s.push(`fill-opacity="${r.alpha}"`),s.join(" ")}function g1(r,t){let e=t.addStyle(r),s=[];return s.push('fill="none"'),e?s.push(`stroke="${e}"`):s.push(`stroke="${X.shared.setValue(r.color).toHex()}"`),s.push(`stroke-width="${r.width}"`),r.cap!=="butt"&&s.push(`stroke-linecap="${r.cap}"`),r.join!=="miter"?s.push(`stroke-linejoin="${r.join}"`):r.miterLimit!==10&&s.push(`stroke-miterlimit="${r.miterLimit}"`),r.alpha<1&&s.push(`stroke-opacity="${r.alpha}"`),s.join(" ")}li();function zM(r,t=2){let e=r instanceof Kt?r:r.context,s=new gc,i=[],n=e.instructions,o=0;for(;o<n.length;){let p=n[o];switch(p.action){case"fill":{let g=p,_=!!g.data.hole,b=_?Ds(g.data.path,t)+Ds(g.data.hole,t,!0):Ds(g.data.path,t),y=m1(g.data.style,s),v=_?' fill-rule="evenodd"':"";i.push(`<path d="${b}" ${y}${v}/>`);break}case"stroke":{let g=p,_=Ds(g.data.path,t);g.data.hole&&(_+=Ds(g.data.hole,t,!0));let b=g1(g.data.style,s);i.push(`<path d="${_}" ${b}/>`);break}case"texture":break}o++}let a=e.bounds,u=parseFloat(a.minX.toFixed(t)),l=parseFloat(a.minY.toFixed(t)),c=parseFloat((a.maxX-a.minX).toFixed(t)),h=parseFloat((a.maxY-a.minY).toFixed(t)),d=s.build(),f=i.join("");return`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${h}" viewBox="${u} ${l} ${c} ${h}">${d}${f}</svg>`}Kd();Zd();Yo();Wo();function XM(r){r instanceof He&&(r={path:r,textureMatrix:null,out:null});let t=[],e=[],s=[],i=r.path.shapePath,n=r.textureMatrix;i.shapePrimitives.forEach(({shape:u,transform:l})=>{let c=s.length,h=t.length/2,d=[],f=Fr[u.type];f.build(u,d),l&&Ho(d,l),f.triangulate(d,t,2,h,s,c);let p=e.length/2;n?(l&&n.append(l.clone().invert()),cl(t,2,h,e,p,2,t.length/2-h,n)):hl(e,p,2,t.length/2-h)});let o=r.out;return o?(o.positions=new Float32Array(t),o.uvs=new Float32Array(e),o.indices=new Uint32Array(s),o):new Xe({positions:new Float32Array(t),uvs:new Float32Array(e),indices:new Uint32Array(s)})}pt();_e();var RA=class MA extends lt{constructor(t={}){t={...MA.defaultOptions,...t},super(),this.renderLayerChildren=[],this.sortableChildren=t.sortableChildren,this.sortFunction=t.sortFunction}attach(...t){for(let e=0;e<t.length;e++){let s=t[e];if(s.parentRenderLayer){if(s.parentRenderLayer===this)continue;s.parentRenderLayer.detach(s)}this.renderLayerChildren.push(s),s.parentRenderLayer=this;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0)}return t[0]}detach(...t){for(let e=0;e<t.length;e++){let s=t[e],i=this.renderLayerChildren.indexOf(s);i!==-1&&this.renderLayerChildren.splice(i,1),s.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)}return t[0]}detachAll(){let t=this.renderLayerChildren;for(let e=0;e<t.length;e++)t[e].parentRenderLayer=null;this.renderLayerChildren.length=0}collectRenderables(t,e,s){let i=this.renderLayerChildren,n=i.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)i[o].parent||k("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",i[o]),i[o].collectRenderables(t,e,this)}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction)}_getGlobalBoundsRecursive(t,e,s){if(!t)return;let i=this.renderLayerChildren;for(let n=0;n<i.length;n++)i[n]._getGlobalBoundsRecursive(!0,e,this)}getFastGlobalBounds(t,e){return super.getFastGlobalBounds(t,e)}addChild(...t){throw new Error("RenderLayer.addChild() is not available. Please use RenderLayer.attach()")}removeChild(...t){throw new Error("RenderLayer.removeChild() is not available. Please use RenderLayer.detach()")}removeChildren(t,e){throw new Error("RenderLayer.removeChildren() is not available. Please use RenderLayer.detach()")}removeChildAt(t){throw new Error("RenderLayer.removeChildAt() is not available")}getChildAt(t){throw new Error("RenderLayer.getChildAt() is not available")}setChildIndex(t,e){throw new Error("RenderLayer.setChildIndex() is not available")}getChildIndex(t){throw new Error("RenderLayer.getChildIndex() is not available")}addChildAt(t,e){throw new Error("RenderLayer.addChildAt() is not available")}swapChildren(t,e){throw new Error("RenderLayer.swapChildren() is not available")}reparentChild(...t){throw new Error("RenderLayer.reparentChild() is not available with the render layer")}reparentChildAt(t,e){throw new Error("RenderLayer.reparentChildAt() is not available with the render layer")}};RA.defaultOptions={sortableChildren:!1,sortFunction:(r,t)=>r.zIndex-t.zIndex};var $M=RA;ht();Ls();xt();var DA=class FA extends Xe{constructor(...t){super({});let e=t[0]??{};typeof e=="number"&&(I(V,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e)}build(t){t={...FA.defaultOptions,...t},this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height;let e=this.verticesX*this.verticesY,s=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<e;h++){let d=h%this.verticesX,f=h/this.verticesX|0;s.push(d*u,f*l),i.push(d/o,f/a)}let c=o*a;for(let h=0;h<c;h++){let d=h%o,f=h/o|0,p=f*this.verticesX+d,g=f*this.verticesX+d+1,_=(f+1)*this.verticesX+d,b=(f+1)*this.verticesX+d+1;n.push(p,g,_,g,b,_)}this.buffers[0].data=new Float32Array(s),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};DA.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};var yn=DA;function x1(r,t,e,s){let i=e.buffers[0],n=i.data,{verticesX:o,verticesY:a}=e,u=r/(o-1),l=t/(a-1),c=0,h=s[0],d=s[1],f=s[2],p=s[3],g=s[4],_=s[5],b=s[6],y=s[7],v=s[8];for(let T=0;T<n.length;T+=2){let S=c%o*u,E=(c/o|0)*l,w=h*S+d*E+f,M=p*S+g*E+_,P=b*S+y*E+v;n[T]=w/P,n[T+1]=M/P,c++}i.update()}function UA(r,t){let e=t[0],s=t[1],i=t[2],n=t[3],o=t[4],a=t[5],u=t[6],l=t[7],c=t[8];return r[0]=o*c-a*l,r[1]=i*l-s*c,r[2]=s*a-i*o,r[3]=a*u-n*c,r[4]=e*c-i*u,r[5]=i*n-e*a,r[6]=n*l-o*u,r[7]=s*u-e*l,r[8]=e*o-s*n,r}function IA(r,t,e){let s=t[0],i=t[1],n=t[2],o=t[3],a=t[4],u=t[5],l=t[6],c=t[7],h=t[8],d=e[0],f=e[1],p=e[2],g=e[3],_=e[4],b=e[5],y=e[6],v=e[7],T=e[8];return r[0]=d*s+f*o+p*l,r[1]=d*i+f*a+p*c,r[2]=d*n+f*u+p*h,r[3]=g*s+_*o+b*l,r[4]=g*i+_*a+b*c,r[5]=g*n+_*u+b*h,r[6]=y*s+v*o+T*l,r[7]=y*i+v*a+T*c,r[8]=y*n+v*u+T*h,r}function YM(r,t,e){let s=e[0],i=e[1],n=e[2];return r[0]=t[0]*s+t[1]*i+t[2]*n,r[1]=t[3]*s+t[4]*i+t[5]*n,r[2]=t[6]*s+t[7]*i+t[8]*n,r}var jM=[0,0,0,0,0,0,0,0,0],qM=[0,0,0],dp=[0,0,0];function GA(r,t,e,s,i,n,o,a,u){let l=jM;l[0]=t,l[1]=s,l[2]=n,l[3]=e,l[4]=i,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=UA(r,l);dp[0]=a,dp[1]=u,dp[2]=1;let h=YM(qM,c,dp),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],IA(r,d,l)}var KM=[0,0,0,0,0,0,0,0,0],ZM=[0,0,0,0,0,0,0,0,0];function _1(r,t,e,s,i,n,o,a,u,l,c,h,d,f,p,g,_){let b=GA(KM,t,e,n,o,l,c,f,p),y=GA(ZM,s,i,a,u,h,d,g,_);return IA(r,UA(b,b),y)}var _c=class extends yn{constructor(t){super(t),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:e,height:s}=t;this.corners=[0,0,e,0,e,s,0,s]}setCorners(t,e,s,i,n,o,a,u){let l=this.corners;l[0]=t,l[1]=e,l[2]=s,l[3]=i,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection()}updateProjection(){let{width:t,height:e}=this,s=this.corners,i=_1(this._projectionMatrix,0,0,s[0],s[1],t,0,s[2],s[3],t,e,s[4],s[5],0,e,s[6],s[7]);x1(t,e,this,i)}};var kA=class OA extends or{constructor(t){t={...OA.defaultOptions,...t};let{texture:e,verticesX:s,verticesY:i,...n}=t,o=new _c(xe({width:e.width,height:e.height,verticesX:s,verticesY:i}));super(xe({...n,geometry:o})),this._texture=e,this.geometry.setCorners(t.x0,t.y0,t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}textureUpdated(){let t=this.geometry;if(!t)return;let{width:e,height:s}=this.texture;(t.width!==e||t.height!==s)&&(t.width=e,t.height=s,t.updateProjection())}set texture(t){this._texture!==t&&(super.texture=t,this.textureUpdated())}get texture(){return this._texture}setCorners(t,e,s,i,n,o,a,u){this.geometry.setCorners(t,e,s,i,n,o,a,u)}};kA.defaultOptions={texture:D.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};var QM=kA;Ls();var b1=class extends or{constructor(t){let{texture:e,verticesX:s,verticesY:i,...n}=t,o=new yn(xe({width:e.width,height:e.height,verticesX:s,verticesY:i}));super(xe({...n,geometry:o,texture:e})),this.texture=e,this.autoResize=!0}textureUpdated(){let t=this.geometry,{width:e,height:s}=this.texture;this.autoResize&&(t.width!==e||t.height!==s)&&(t.width=e,t.height=s,t.build({}))}set texture(t){this._texture?.off("update",this.textureUpdated,this),super.texture=t,t.on("update",this.textureUpdated,this),this.textureUpdated()}get texture(){return this._texture}destroy(t){this.texture.off("update",this.textureUpdated,this),super.destroy(t)}};Ls();var LA=class NA extends Xe{constructor(t){let{width:e,points:s,textureScale:i}={...NA.defaultOptions,...t};super({positions:new Float32Array(s.length*4),uvs:new Float32Array(s.length*4),indices:new Uint32Array((s.length-1)*6)}),this.points=s,this._width=e,this.textureScale=i,this._build()}get width(){return this._width}_build(){let t=this.points;if(!t)return;let e=this.getBuffer("aPosition"),s=this.getBuffer("aUV"),i=this.getIndex();if(t.length<1)return;e.data.length/4!==t.length&&(e.data=new Float32Array(t.length*4),s.data=new Float32Array(t.length*4),i.data=new Uint16Array((t.length-1)*6));let n=s.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=t[0],l=this._width*this.textureScale,c=t.length;for(let d=0;d<c;d++){let f=d*4;if(this.textureScale>0){let p=u.x-t[d].x,g=u.y-t[d].y,_=Math.sqrt(p*p+g*g);u=t[d],a+=_/l}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+3}s.update(),i.update(),this.updateVertices()}updateVertices(){let t=this.points;if(t.length<1)return;let e=t[0],s,i=0,n=0,o=this.buffers[0].data,a=t.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=t[l],h=l*4;l<t.length-1?s=t[l+1]:s=c,n=-(s.x-e.x),i=s.y-e.y;let d=(1-l/(a-1))*10;d>1&&(d=1);let f=Math.sqrt(i*i+n*n);f<1e-6?(i=0,n=0):(i/=f,n/=f,i*=u,n*=u),o[h]=c.x+i,o[h+1]=c.y+n,o[h+2]=c.x-i,o[h+3]=c.y-n,e=c}this.buffers[0].update()}update(){this.textureScale>0?this._build():this.updateVertices()}};LA.defaultOptions={width:200,points:[],textureScale:0};var y1=LA;var HA=class WA extends or{constructor(t){let{width:e,texture:s,points:i,textureScale:n,...o}={...WA.defaultOptions,...t},a=new y1(xe({width:e??s.height,points:i,textureScale:n}));n>0&&(s.source.style.addressMode="repeat"),super(xe({...o,texture:s,geometry:a})),this.autoUpdate=!0,this.onRender=this._render}_render(){let t=this.geometry;(this.autoUpdate||t._width!==this.texture.height)&&(t._width=this.texture.height,t.update())}};HA.defaultOptions={textureScale:0};var JM=HA;Ls();var v1=class extends or{constructor(t){let{texture:e,vertices:s,uvs:i,indices:n,topology:o,...a}=t,u=new Xe(xe({positions:s,uvs:i,indices:n,topology:o}));super(xe({...a,texture:e,geometry:u})),this.autoUpdate=!0,this.onRender=this._render}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(t){this.geometry.getBuffer("aPosition").data=t}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update()}};function tD(r,t){let{width:e,height:s}=r.frame;return t.scale(1/e,1/s),t}Lr();var bc=class{execute(t,e){let s=t.renderer,i=s.canvasContext.activeContext,n=e.particleChildren,o=e.texture;i.save(),s.canvasContext.setContextTransform(e.worldTransform,e.roundPixels),s.canvasContext.setBlendMode(e.groupBlendMode);let a=e.groupColorAlpha,u=s.filter?.alphaMultiplier??1,l=(a>>>24&255)/255*u;for(let c=0;c<n.length;c++){let h=n[c],d=h.texture||o;if(!d?.source?.resource)continue;let f=h.color,p=(f>>>24&255)/255*l;if(p<=0)continue;let g=f&16777215,_=((g&255)<<16)+(g&65280)+(g>>16&255),b=d.source.resource;_!==16777215&&(b=Z.getTintedCanvas({texture:d},_));let y=d.frame,v=d.source.resolution,T=y.x*v,S=y.y*v,E=y.width*v,w=y.height*v;i.globalAlpha=p;let M=-h.anchorX*y.width,P=-h.anchorY*y.height;h.rotation!==0||h.scaleX!==1||h.scaleY!==1?(i.save(),i.translate(h.x,h.y),i.rotate(h.rotation),i.scale(h.scaleX,h.scaleY),i.drawImage(b,T,S,E,w,M,P,y.width,y.height),i.restore()):i.drawImage(b,T,S,E,w,h.x+M,h.y+P,y.width,y.height)}i.restore()}};C();C();ot();te();Qn();je();ye();Xi();cs();Hr();Qs();Zs();ad();function fp(r,t=null){let e=r*6;if(e>65535?t||(t=new Uint32Array(e)):t||(t=new Uint16Array(e)),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let s=0,i=0;s<e;s+=6,i+=4)t[s+0]=i+0,t[s+1]=i+1,t[s+2]=i+2,t[s+3]=i+0,t[s+4]=i+2,t[s+5]=i+3;return t}Zs();function T1(r){return{dynamicUpdate:VA(r,!0),staticUpdate:VA(r,!1)}}function VA(r,t){let e=[];e.push(`
|
|
3192
|
+
`,r}var PM={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 BM(r){return PM[r]}xt();var PA={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},RM=new Proxy(PA,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${PA[t]}' instead`),r[t]}});xt();var hp=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(hp||{}),MM=new Proxy(hp,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${hp[t]}' instead`),r[t]}}),dp=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(dp||{}),DM=new Proxy(dp,{get(r,t){return I(V,`DRAW_MODES.${t} is deprecated, use '${dp[t]}' instead`),r[t]}});le();Tr();Yt();pt();Wt();var Da=class r extends st{constructor(t){let{faces:e,...s}=t;r._validateFaces(e);let i=e.right,n=i.resolution,o=i.format,a=i.alphaMode,u=["resolution","format","alphaMode","dimensions","viewDimension"].filter(l=>s[l]!==void 0);u.length&&k(`[CubeTextureSource] Ignoring option(s) [${u.join(", ")}]; these are derived from face sources.`),super({...s,resource:e,width:i.width,height:i.height,dimensions:"2d",viewDimension:"cube",arrayLayerCount:6,resolution:n,format:o,alphaMode:a}),this.uploadMethodId="cube",this.faces=e;for(let l of Object.keys(e)){let c=e[l];c.on("update",this._onFaceUpdate,this),c.on("resize",this._onFaceResize,this),c.on("unload",this._onFaceUpdate,this)}}destroy(){let t=this.faces;if(t)for(let e of Object.keys(t)){let s=t[e];s.off("update",this._onFaceUpdate,this),s.off("resize",this._onFaceResize,this),s.off("unload",this._onFaceUpdate,this)}super.destroy()}_onFaceUpdate(){this.emit("update",this)}_onFaceResize(t){r._validateFaces(this.faces),this.resize(t.width,t.height,t.resolution)}static _validateFaces(t){if(!t.right||!t.left||!t.top||!t.bottom||!t.front||!t.back)throw new Error("[CubeTextureSource] Requires { left, right, top, bottom, front, back } faces.");let e=t.right,s=e.pixelWidth,i=e.pixelHeight,n=e.format,o=e.alphaMode,a=e.resolution;for(let u of Object.keys(t)){let l=t[u];if(l.pixelWidth!==s||l.pixelHeight!==i)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different size. All faces must match.`);if(l.format!==n)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different format. All faces must match.`);if(l.alphaMode!==o)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different alphaMode. All faces must match.`);if(l.resolution!==a)throw new Error(`[CubeTextureSource] Face '${String(u)}' has a different resolution. All faces must match.`)}}};ht();var l1=["left","right","top","bottom","front","back"];function FM(r,t){let e=t?{...t}:{};delete e.label;let s=Object.keys(e).sort(),i=s.length?`|${s.map(o=>`${o}=${String(e[o])}`).join("&")}`:"";return`cube:${l1.map(o=>r[o]).join(",")}${i}`}var c1=class r extends St{constructor(t){super(),this.uid=et("cubeTexture"),this.destroyed=!1;let{label:e,source:s}=t;this.label=e,this.source=s,this.source.label=this.label??this.source.label}static from(t,e=!1){if(t instanceof Da)return new r({source:t});let{faces:s,...i}=t,n=null,o=l1.every(c=>typeof s[c]=="string");if(!e&&o&&(n=FM(s,i),at.has(n)))return at.get(n);let a=c=>c.isTexture?c:D.from(c),u={};for(let c of l1)u[c]=a(s[c]).source;let l=new r({source:new Da({...i,faces:u}),label:i.label});return n&&(at.set(n,l),l.once("destroy",()=>{at.has(n)&&at.remove(n)})),l}destroy(t=!1){this.destroyed||(this.destroyed=!0,t&&this.source.destroy(),this.emit("destroy",this),this.removeAllListeners())}};Vd();Dd();Pe();Wt();var h1=Object.create(null),d1=Object.create(null);function GM(r){var t;if(r.type===Tt.WEBGPU)return d1[t=r.uid]||(d1[t]=r.gpu.device.createTexture({label:"ExternalSource placeholder",size:{width:1,height:1},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST})),d1[r.uid];if(!h1[r.uid]){let e=r.gl,s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),h1[r.uid]=s}return h1[r.uid]}var f1=class extends st{constructor({resource:t,renderer:e,label:s,width:i,height:n}){t||(t=GM(e)),i||(i=i??t?.width??1),n||(n=n??t?.height??1),super({resource:t,width:i,height:n,label:s,autoGarbageCollect:!1}),this._renderer=e,this._initGpuData(t)}static test(t){return globalThis.GPUTexture&&t instanceof GPUTexture||globalThis.WebGLTexture&&t instanceof WebGLTexture}_validateTexture(t){let e=this._renderer,s=!!e.gpu,i=globalThis.GPUTexture&&t instanceof GPUTexture,n=globalThis.WebGLTexture&&t instanceof WebGLTexture;if(s&&n)throw new Error("Cannot use WebGLTexture with a WebGPU renderer");if(!s&&i)throw new Error("Cannot use GPUTexture with a WebGL renderer");if(!s){let o=e.gl;if(o&&!o.isTexture(t))throw new Error("WebGLTexture does not belong to this renderer's WebGL context")}}_initGpuData(t){let e=this._renderer;this._validateTexture(t),e.gpu?this._gpuData[e.uid]=new Ao(t):this._gpuData[e.uid]=new Ji(t)}updateGPUTexture(t,e,s){let i=this._renderer,n=this._gpuData[i.uid];if(this.resource=t,i.gpu){this._validateTexture(t);let o=n;if(o.gpuTexture!==t){o.gpuTexture=t,o.textureView=null;let l=i.texture;l?._bindGroupHash&&(l._bindGroupHash[this.uid]=null)}let a=e??t.width,u=s??t.height;this.resize(a,u)}else{this._validateTexture(t);let o=n;o.texture=t,e!==void 0&&s!==void 0&&this.resize(e,s)}this.emit("update",this)}destroy(){let t=this._renderer;delete this._gpuData[t.uid],super.destroy()}};Hs();var p1=class{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,e,s){let i=e.width,n=e.height;if(s){let o=t.width/2/i,a=t.height/2/n,u=t.x/i+o,l=t.y/n+a;s=q.add(s,q.NW),this.x0=u+o*q.uX(s),this.y0=l+a*q.uY(s),s=q.add(s,2),this.x1=u+o*q.uX(s),this.y1=l+a*q.uY(s),s=q.add(s,2),this.x2=u+o*q.uX(s),this.y2=l+a*q.uY(s),s=q.add(s,2),this.x3=u+o*q.uX(s),this.y3=l+a*q.uY(s)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;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.js/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}]`}};function UM(r){let t=r.toString(),e=t.indexOf("{"),s=t.lastIndexOf("}");if(e===-1||s===-1)throw new Error("getFunctionBody: No body found in function definition");return t.slice(e+1,s).trim()}xt();function IM(r,t){return I("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(!0,t)}br();var m1=class extends Jt{constructor(t){typeof t=="function"&&(t={render:t});let{render:e,...s}=t;super({label:"RenderContainer",...s}),this.renderPipeId="customRender",this.batched=!1,e&&(this.render=e),this.containsPoint=t.containsPoint??(()=>!1),this.addBounds=t.addBounds??(()=>!1)}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds)}render(t){}};xt();function kM(r,t,e){I("8.7.0","Please use container.collectRenderables instead.");let s=e.renderPipes?e:e.batch.renderer;return r.collectRenderables(t,s,null)}function OM(r,t){let e=t._scale,s=t._pivot,i=t._position,n=e._x,o=e._y,a=s._x,u=s._y;r.a=t._cx*n,r.b=t._sx*n,r.c=t._cy*o,r.d=t._sy*o,r.tx=i._x-(a*r.a+u*r.c),r.ty=i._y-(a*r.b+u*r.d)}function LM(r,t,e){let s=r.a,i=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=t.a,c=t.b,h=t.c,d=t.d;e.a=s*l+i*h,e.b=s*c+i*d,e.c=n*l+o*h,e.d=n*c+o*d,e.tx=a*l+u*h+t.tx,e.ty=a*c+u*d+t.ty}It();zr();var gc=class{constructor(){this._gradients=[],this._nextId=0}addStyle(t){if(!(t.fill instanceof Nt))return null;let e=`pixi-grad-${this._nextId++}`;return this._gradients.push({id:e,gradient:t.fill,textureSpace:t.textureSpace??"local"}),`url(#${e})`}build(){if(this._gradients.length===0)return"";let t=["<defs>"];for(let{id:e,gradient:s,textureSpace:i}of this._gradients){let n=i==="global"?"userSpaceOnUse":"objectBoundingBox",o=NM(s.colorStops);if(s.type==="radial"){let a=s.outerCenter?.x??.5,u=s.outerCenter?.y??.5,l=s.outerRadius??.5,c=s.center?.x??a,h=s.center?.y??u;t.push(`<radialGradient id="${e}" gradientUnits="${n}" cx="${a}" cy="${u}" r="${l}" fx="${c}" fy="${h}">`,o,"</radialGradient>")}else{let a=s.start?.x??0,u=s.start?.y??0,l=s.end?.x??1,c=s.end?.y??0;t.push(`<linearGradient id="${e}" gradientUnits="${n}" x1="${a}" y1="${u}" x2="${l}" y2="${c}">`,o,"</linearGradient>")}}return t.push("</defs>"),t.join("")}};function NM(r){return r.map(t=>{let e=X.shared.setValue(t.color).toHex();return`<stop offset="${t.offset}" stop-color="${e}"/>`}).join("")}var vn=Math.PI*2,HM=new Set(["regularPoly","roundPoly","roundShape","filletRect","chamferRect","arcTo"]);function Fs(r,t=2,e=!1){if(r.instructions.some(n=>HM.has(n.action)))return XM(r,t,e);let s=[],i=!1;for(let n=0;n<r.instructions.length;n++){let o=r.instructions[n],a=o.data;switch(o.action){case"moveTo":s.push(`M${ge(a[0],a[1],null,t)}`),i=!0;break;case"lineTo":s.push(`L${ge(a[0],a[1],null,t)}`),i=!0;break;case"quadraticCurveTo":s.push(`Q${ge(a[0],a[1],null,t)} ${ge(a[2],a[3],null,t)}`),i=!0;break;case"bezierCurveTo":s.push(`C${ge(a[0],a[1],null,t)} ${ge(a[2],a[3],null,t)} ${ge(a[4],a[5],null,t)}`),i=!0;break;case"arcToSvg":s.push(`A${tt(a[0],t)} ${tt(a[1],t)} ${tt(a[2],t)} ${a[3]} ${a[4]} ${ge(a[5],a[6],null,t)}`),i=!0;break;case"closePath":s.push("Z"),i=!1;break;case"arc":s.push(VM(a[0],a[1],a[2],a[3],a[4],!!a[5],i,t,e)),i=!WM(a[3],a[4],!!a[5]);break;case"rect":s.push(g1(a[0],a[1],a[2],a[3],a[4],t)),i=!1;break;case"circle":s.push(xc(a[0],a[1],a[2],a[2],a[3],t,e)),i=!1;break;case"ellipse":s.push(xc(a[0],a[1],a[2],a[3],a[4],t,e)),i=!1;break;case"roundRect":s.push(BA(a[0],a[1],a[2],a[3],a[4]??0,a[5],t,e)),i=!1;break;case"poly":s.push(RA(a[0],a[1]??!0,a[2],t)),i=!(a[1]??!0);break;case"addPath":s.push(zM(a[0],a[1],t,e)),i=!0;break}}return s.join("")}function WM(r,t,e){let s=t-r;return e?s>0&&(s-=vn):s<0&&(s+=vn),Math.abs(s)>=vn-1e-6}function tt(r,t){return parseFloat(r.toFixed(t)).toString()}function ge(r,t,e,s){if(e&&!e.isIdentity()){let i=e.a*r+e.c*t+e.tx,n=e.b*r+e.d*t+e.ty;return`${tt(i,s)} ${tt(n,s)}`}return`${tt(r,s)} ${tt(t,s)}`}function VM(r,t,e,s,i,n,o,a,u=!1){let l=i-s;if(n?l>0&&(l-=vn):l<0&&(l+=vn),Math.abs(l)>=vn-1e-6)return xc(r,t,e,e,null,a,u);if(u){let y=[];for(let v=0;v<=32;v++){let T=s+v/32*l,S=r+e*Math.cos(T),E=t+e*Math.sin(T),w=v===0?o?"L":"M":"L";y.push(`${w}${tt(S,a)} ${tt(E,a)}`)}return y.join("")}let c=r+e*Math.cos(s),h=t+e*Math.sin(s),d=r+e*Math.cos(i),f=t+e*Math.sin(i),p=Math.abs(l)>Math.PI?1:0,g=n?0:1;return`${o?"L":"M"}${tt(c,a)} ${tt(h,a)}A${tt(e,a)} ${tt(e,a)} 0 ${p} ${g} ${tt(d,a)} ${tt(f,a)}`}function xc(r,t,e,s,i,n,o=!1){let a=i&&!i.isIdentity()?i:null;if(!a&&!o)return`M${tt(r-e,n)} ${tt(t,n)}A${tt(e,n)} ${tt(s,n)} 0 1 1 ${tt(r+e,n)} ${tt(t,n)}A${tt(e,n)} ${tt(s,n)} 0 1 1 ${tt(r-e,n)} ${tt(t,n)}Z`;let u=64,l=[];for(let c=0;c<u;c++){let h=c/u*vn,d=r+e*Math.cos(h),f=t+s*Math.sin(h);l.push(`${c===0?"M":"L"}${ge(d,f,a,n)}`)}return l.push("Z"),l.join("")}function g1(r,t,e,s,i,n){return`M${ge(r,t,i,n)}L${ge(r+e,t,i,n)}L${ge(r+e,t+s,i,n)}L${ge(r,t+s,i,n)}Z`}function BA(r,t,e,s,i,n,o,a=!1){let u=n&&!n.isIdentity()?n:null;if(i<=0)return g1(r,t,e,s,u,o);if(i=Math.min(i,Math.min(e,s)/2),u||a){let l=[],h=[[r+e-i,t+i,-Math.PI/2],[r+e-i,t+s-i,0],[r+i,t+s-i,Math.PI/2],[r+i,t+i,Math.PI]],d=!0;for(let f=0;f<h.length;f++){let[p,g,_]=h[f];for(let b=0;b<=8;b++){let y=_+b/8*(Math.PI/2),v=p+i*Math.cos(y),T=g+i*Math.sin(y);l.push(`${d?"M":"L"}${ge(v,T,u,o)}`),d=!1}}return l.push("Z"),l.join("")}return`M${tt(r+i,o)} ${tt(t,o)}L${tt(r+e-i,o)} ${tt(t,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+e,o)} ${tt(t+i,o)}L${tt(r+e,o)} ${tt(t+s-i,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+e-i,o)} ${tt(t+s,o)}L${tt(r+i,o)} ${tt(t+s,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r,o)} ${tt(t+s-i,o)}L${tt(r,o)} ${tt(t+i,o)}A${tt(i,o)} ${tt(i,o)} 0 0 1 ${tt(r+i,o)} ${tt(t,o)}Z`}function RA(r,t,e,s){if(r.length===0)return"";let i=[];if(typeof r[0]=="number"){let o=r;i.push(`M${ge(o[0],o[1],e,s)}`);for(let a=2;a<o.length;a+=2)i.push(`L${ge(o[a],o[a+1],e,s)}`)}else{let o=r;i.push(`M${ge(o[0].x,o[0].y,e,s)}`);for(let a=1;a<o.length;a++)i.push(`L${ge(o[a].x,o[a].y,e,s)}`)}return t&&i.push("Z"),i.join("")}function zM(r,t,e,s){return!t||t.isIdentity()?Fs(r,e,s):Fs(r.clone(!0).transform(t),e,s)}function XM(r,t,e){let s=r.shapePath.shapePrimitives,i=[];for(let n of s){let o=n.shape,a=n.transform;switch(o.type){case"polygon":{let u=o;i.push(RA(u.points,u.closePath,a,t));break}case"circle":{let u=o;i.push(xc(u.x,u.y,u.radius,u.radius,a,t,e));break}case"ellipse":{let u=o;i.push(xc(u.x,u.y,u.halfWidth,u.halfHeight,a,t,e));break}case"rectangle":{let u=o;i.push(g1(u.x,u.y,u.width,u.height,a,t));break}case"roundedRectangle":{let u=o;i.push(BA(u.x,u.y,u.width,u.height,u.radius,a,t,e));break}}}return i.join("")}It();function x1(r,t){let e=t.addStyle(r),s=[];return e?s.push(`fill="${e}"`):s.push(`fill="${X.shared.setValue(r.color).toHex()}"`),r.alpha<1&&s.push(`fill-opacity="${r.alpha}"`),s.join(" ")}function _1(r,t){let e=t.addStyle(r),s=[];return s.push('fill="none"'),e?s.push(`stroke="${e}"`):s.push(`stroke="${X.shared.setValue(r.color).toHex()}"`),s.push(`stroke-width="${r.width}"`),r.cap!=="butt"&&s.push(`stroke-linecap="${r.cap}"`),r.join!=="miter"?s.push(`stroke-linejoin="${r.join}"`):r.miterLimit!==10&&s.push(`stroke-miterlimit="${r.miterLimit}"`),r.alpha<1&&s.push(`stroke-opacity="${r.alpha}"`),s.join(" ")}ci();function $M(r,t=2){let e=r instanceof Kt?r:r.context,s=new gc,i=[],n=e.instructions,o=0;for(;o<n.length;){let p=n[o];switch(p.action){case"fill":{let g=p,_=!!g.data.hole,b=_?Fs(g.data.path,t)+Fs(g.data.hole,t,!0):Fs(g.data.path,t),y=x1(g.data.style,s),v=_?' fill-rule="evenodd"':"";i.push(`<path d="${b}" ${y}${v}/>`);break}case"stroke":{let g=p,_=Fs(g.data.path,t);g.data.hole&&(_+=Fs(g.data.hole,t,!0));let b=_1(g.data.style,s);i.push(`<path d="${_}" ${b}/>`);break}case"texture":break}o++}let a=e.bounds,u=parseFloat(a.minX.toFixed(t)),l=parseFloat(a.minY.toFixed(t)),c=parseFloat((a.maxX-a.minX).toFixed(t)),h=parseFloat((a.maxY-a.minY).toFixed(t)),d=s.build(),f=i.join("");return`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${h}" viewBox="${u} ${l} ${c} ${h}">${d}${f}</svg>`}Kd();Zd();qo();zo();function YM(r){r instanceof He&&(r={path:r,textureMatrix:null,out:null});let t=[],e=[],s=[],i=r.path.shapePath,n=r.textureMatrix;i.shapePrimitives.forEach(({shape:u,transform:l})=>{let c=s.length,h=t.length/2,d=[],f=Fr[u.type];f.build(u,d),l&&Vo(d,l),f.triangulate(d,t,2,h,s,c);let p=e.length/2;n?(l&&n.append(l.clone().invert()),hl(t,2,h,e,p,2,t.length/2-h,n)):dl(e,p,2,t.length/2-h)});let o=r.out;return o?(o.positions=new Float32Array(t),o.uvs=new Float32Array(e),o.indices=new Uint32Array(s),o):new Xe({positions:new Float32Array(t),uvs:new Float32Array(e),indices:new Uint32Array(s)})}pt();_e();var MA=class DA extends lt{constructor(t={}){t={...DA.defaultOptions,...t},super(),this.renderLayerChildren=[],this.sortableChildren=t.sortableChildren,this.sortFunction=t.sortFunction}attach(...t){for(let e=0;e<t.length;e++){let s=t[e];if(s.parentRenderLayer){if(s.parentRenderLayer===this)continue;s.parentRenderLayer.detach(s)}this.renderLayerChildren.push(s),s.parentRenderLayer=this;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0)}return t[0]}detach(...t){for(let e=0;e<t.length;e++){let s=t[e],i=this.renderLayerChildren.indexOf(s);i!==-1&&this.renderLayerChildren.splice(i,1),s.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)}return t[0]}detachAll(){let t=this.renderLayerChildren;for(let e=0;e<t.length;e++)t[e].parentRenderLayer=null;this.renderLayerChildren.length=0}collectRenderables(t,e,s){let i=this.renderLayerChildren,n=i.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)i[o].parent||k("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",i[o]),i[o].collectRenderables(t,e,this)}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction)}_getGlobalBoundsRecursive(t,e,s){if(!t)return;let i=this.renderLayerChildren;for(let n=0;n<i.length;n++)i[n]._getGlobalBoundsRecursive(!0,e,this)}getFastGlobalBounds(t,e){return super.getFastGlobalBounds(t,e)}addChild(...t){throw new Error("RenderLayer.addChild() is not available. Please use RenderLayer.attach()")}removeChild(...t){throw new Error("RenderLayer.removeChild() is not available. Please use RenderLayer.detach()")}removeChildren(t,e){throw new Error("RenderLayer.removeChildren() is not available. Please use RenderLayer.detach()")}removeChildAt(t){throw new Error("RenderLayer.removeChildAt() is not available")}getChildAt(t){throw new Error("RenderLayer.getChildAt() is not available")}setChildIndex(t,e){throw new Error("RenderLayer.setChildIndex() is not available")}getChildIndex(t){throw new Error("RenderLayer.getChildIndex() is not available")}addChildAt(t,e){throw new Error("RenderLayer.addChildAt() is not available")}swapChildren(t,e){throw new Error("RenderLayer.swapChildren() is not available")}reparentChild(...t){throw new Error("RenderLayer.reparentChild() is not available with the render layer")}reparentChildAt(t,e){throw new Error("RenderLayer.reparentChildAt() is not available with the render layer")}};MA.defaultOptions={sortableChildren:!1,sortFunction:(r,t)=>r.zIndex-t.zIndex};var jM=MA;ht();Ns();xt();var FA=class GA extends Xe{constructor(...t){super({});let e=t[0]??{};typeof e=="number"&&(I(V,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e)}build(t){t={...GA.defaultOptions,...t},this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height;let e=this.verticesX*this.verticesY,s=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<e;h++){let d=h%this.verticesX,f=h/this.verticesX|0;s.push(d*u,f*l),i.push(d/o,f/a)}let c=o*a;for(let h=0;h<c;h++){let d=h%o,f=h/o|0,p=f*this.verticesX+d,g=f*this.verticesX+d+1,_=(f+1)*this.verticesX+d,b=(f+1)*this.verticesX+d+1;n.push(p,g,_,g,b,_)}this.buffers[0].data=new Float32Array(s),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};FA.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};var Tn=FA;function b1(r,t,e,s){let i=e.buffers[0],n=i.data,{verticesX:o,verticesY:a}=e,u=r/(o-1),l=t/(a-1),c=0,h=s[0],d=s[1],f=s[2],p=s[3],g=s[4],_=s[5],b=s[6],y=s[7],v=s[8];for(let T=0;T<n.length;T+=2){let S=c%o*u,E=(c/o|0)*l,w=h*S+d*E+f,M=p*S+g*E+_,P=b*S+y*E+v;n[T]=w/P,n[T+1]=M/P,c++}i.update()}function IA(r,t){let e=t[0],s=t[1],i=t[2],n=t[3],o=t[4],a=t[5],u=t[6],l=t[7],c=t[8];return r[0]=o*c-a*l,r[1]=i*l-s*c,r[2]=s*a-i*o,r[3]=a*u-n*c,r[4]=e*c-i*u,r[5]=i*n-e*a,r[6]=n*l-o*u,r[7]=s*u-e*l,r[8]=e*o-s*n,r}function kA(r,t,e){let s=t[0],i=t[1],n=t[2],o=t[3],a=t[4],u=t[5],l=t[6],c=t[7],h=t[8],d=e[0],f=e[1],p=e[2],g=e[3],_=e[4],b=e[5],y=e[6],v=e[7],T=e[8];return r[0]=d*s+f*o+p*l,r[1]=d*i+f*a+p*c,r[2]=d*n+f*u+p*h,r[3]=g*s+_*o+b*l,r[4]=g*i+_*a+b*c,r[5]=g*n+_*u+b*h,r[6]=y*s+v*o+T*l,r[7]=y*i+v*a+T*c,r[8]=y*n+v*u+T*h,r}function qM(r,t,e){let s=e[0],i=e[1],n=e[2];return r[0]=t[0]*s+t[1]*i+t[2]*n,r[1]=t[3]*s+t[4]*i+t[5]*n,r[2]=t[6]*s+t[7]*i+t[8]*n,r}var KM=[0,0,0,0,0,0,0,0,0],ZM=[0,0,0],fp=[0,0,0];function UA(r,t,e,s,i,n,o,a,u){let l=KM;l[0]=t,l[1]=s,l[2]=n,l[3]=e,l[4]=i,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=IA(r,l);fp[0]=a,fp[1]=u,fp[2]=1;let h=qM(ZM,c,fp),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],kA(r,d,l)}var QM=[0,0,0,0,0,0,0,0,0],JM=[0,0,0,0,0,0,0,0,0];function y1(r,t,e,s,i,n,o,a,u,l,c,h,d,f,p,g,_){let b=UA(QM,t,e,n,o,l,c,f,p),y=UA(JM,s,i,a,u,h,d,g,_);return kA(r,IA(b,b),y)}var _c=class extends Tn{constructor(t){super(t),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:e,height:s}=t;this.corners=[0,0,e,0,e,s,0,s]}setCorners(t,e,s,i,n,o,a,u){let l=this.corners;l[0]=t,l[1]=e,l[2]=s,l[3]=i,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection()}updateProjection(){let{width:t,height:e}=this,s=this.corners,i=y1(this._projectionMatrix,0,0,s[0],s[1],t,0,s[2],s[3],t,e,s[4],s[5],0,e,s[6],s[7]);b1(t,e,this,i)}};var OA=class LA extends or{constructor(t){t={...LA.defaultOptions,...t};let{texture:e,verticesX:s,verticesY:i,...n}=t,o=new _c(xe({width:e.width,height:e.height,verticesX:s,verticesY:i}));super(xe({...n,geometry:o})),this._texture=e,this.geometry.setCorners(t.x0,t.y0,t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}textureUpdated(){let t=this.geometry;if(!t)return;let{width:e,height:s}=this.texture;(t.width!==e||t.height!==s)&&(t.width=e,t.height=s,t.updateProjection())}set texture(t){this._texture!==t&&(super.texture=t,this.textureUpdated())}get texture(){return this._texture}setCorners(t,e,s,i,n,o,a,u){this.geometry.setCorners(t,e,s,i,n,o,a,u)}};OA.defaultOptions={texture:D.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};var tD=OA;Ns();var v1=class extends or{constructor(t){let{texture:e,verticesX:s,verticesY:i,...n}=t,o=new Tn(xe({width:e.width,height:e.height,verticesX:s,verticesY:i}));super(xe({...n,geometry:o,texture:e})),this.texture=e,this.autoResize=!0}textureUpdated(){let t=this.geometry,{width:e,height:s}=this.texture;this.autoResize&&(t.width!==e||t.height!==s)&&(t.width=e,t.height=s,t.build({}))}set texture(t){this._texture?.off("update",this.textureUpdated,this),super.texture=t,t.on("update",this.textureUpdated,this),this.textureUpdated()}get texture(){return this._texture}destroy(t){this.texture.off("update",this.textureUpdated,this),super.destroy(t)}};Ns();var NA=class HA extends Xe{constructor(t){let{width:e,points:s,textureScale:i}={...HA.defaultOptions,...t};super({positions:new Float32Array(s.length*4),uvs:new Float32Array(s.length*4),indices:new Uint32Array((s.length-1)*6)}),this.points=s,this._width=e,this.textureScale=i,this._build()}get width(){return this._width}_build(){let t=this.points;if(!t)return;let e=this.getBuffer("aPosition"),s=this.getBuffer("aUV"),i=this.getIndex();if(t.length<1)return;e.data.length/4!==t.length&&(e.data=new Float32Array(t.length*4),s.data=new Float32Array(t.length*4),i.data=new Uint16Array((t.length-1)*6));let n=s.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=t[0],l=this._width*this.textureScale,c=t.length;for(let d=0;d<c;d++){let f=d*4;if(this.textureScale>0){let p=u.x-t[d].x,g=u.y-t[d].y,_=Math.sqrt(p*p+g*g);u=t[d],a+=_/l}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+3}s.update(),i.update(),this.updateVertices()}updateVertices(){let t=this.points;if(t.length<1)return;let e=t[0],s,i=0,n=0,o=this.buffers[0].data,a=t.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=t[l],h=l*4;l<t.length-1?s=t[l+1]:s=c,n=-(s.x-e.x),i=s.y-e.y;let d=(1-l/(a-1))*10;d>1&&(d=1);let f=Math.sqrt(i*i+n*n);f<1e-6?(i=0,n=0):(i/=f,n/=f,i*=u,n*=u),o[h]=c.x+i,o[h+1]=c.y+n,o[h+2]=c.x-i,o[h+3]=c.y-n,e=c}this.buffers[0].update()}update(){this.textureScale>0?this._build():this.updateVertices()}};NA.defaultOptions={width:200,points:[],textureScale:0};var T1=NA;var WA=class VA extends or{constructor(t){let{width:e,texture:s,points:i,textureScale:n,...o}={...VA.defaultOptions,...t},a=new T1(xe({width:e??s.height,points:i,textureScale:n}));n>0&&(s.source.style.addressMode="repeat"),super(xe({...o,texture:s,geometry:a})),this.autoUpdate=!0,this.onRender=this._render}_render(){let t=this.geometry;(this.autoUpdate||t._width!==this.texture.height)&&(t._width=this.texture.height,t.update())}};WA.defaultOptions={textureScale:0};var eD=WA;Ns();var S1=class extends or{constructor(t){let{texture:e,vertices:s,uvs:i,indices:n,topology:o,...a}=t,u=new Xe(xe({positions:s,uvs:i,indices:n,topology:o}));super(xe({...a,texture:e,geometry:u})),this.autoUpdate=!0,this.onRender=this._render}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(t){this.geometry.getBuffer("aPosition").data=t}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update()}};function rD(r,t){let{width:e,height:s}=r.frame;return t.scale(1/e,1/s),t}Lr();var bc=class{execute(t,e){let s=t.renderer,i=s.canvasContext.activeContext,n=e.particleChildren,o=e.texture;i.save(),s.canvasContext.setContextTransform(e.worldTransform,e.roundPixels),s.canvasContext.setBlendMode(e.groupBlendMode);let a=e.groupColorAlpha,u=s.filter?.alphaMultiplier??1,l=(a>>>24&255)/255*u;for(let c=0;c<n.length;c++){let h=n[c],d=h.texture||o;if(!d?.source?.resource)continue;let f=h.color,p=(f>>>24&255)/255*l;if(p<=0)continue;let g=f&16777215,_=((g&255)<<16)+(g&65280)+(g>>16&255),b=d.source.resource;_!==16777215&&(b=Z.getTintedCanvas({texture:d},_));let y=d.frame,v=d.source.resolution,T=y.x*v,S=y.y*v,E=y.width*v,w=y.height*v;i.globalAlpha=p;let M=-h.anchorX*y.width,P=-h.anchorY*y.height;h.rotation!==0||h.scaleX!==1||h.scaleY!==1?(i.save(),i.translate(h.x,h.y),i.rotate(h.rotation),i.scale(h.scaleX,h.scaleY),i.drawImage(b,T,S,E,w,M,P,y.width,y.height),i.restore()):i.drawImage(b,T,S,E,w,h.x+M,h.y+P,y.width,y.height)}i.restore()}};C();C();ot();te();to();je();ye();Yi();cs();Hr();Js();Qs();ad();function pp(r,t=null){let e=r*6;if(e>65535?t||(t=new Uint32Array(e)):t||(t=new Uint16Array(e)),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let s=0,i=0;s<e;s+=6,i+=4)t[s+0]=i+0,t[s+1]=i+1,t[s+2]=i+2,t[s+3]=i+0,t[s+4]=i+2,t[s+5]=i+3;return t}Qs();function E1(r){return{dynamicUpdate:zA(r,!0),staticUpdate:zA(r,!1)}}function zA(r,t){let e=[];e.push(`
|
|
3193
3193
|
|
|
3194
3194
|
var index = 0;
|
|
3195
3195
|
|
|
@@ -3203,7 +3203,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3203
3203
|
`),e.unshift(`
|
|
3204
3204
|
var stride = ${s};
|
|
3205
3205
|
`);let i=e.join(`
|
|
3206
|
-
`);return new Function("ps","f32v","u32v",i)}var yc=class{constructor(t){this._size=0,this._generateParticleUpdateCache={};let e=this._size=t.size??1e3,s=t.properties,i=0,n=0;for(let c in s){let h=s[c],d=Le(h.format);h.dynamic?n+=d.stride:i+=d.stride}this._dynamicStride=n/4,this._staticStride=i/4,this.staticAttributeBuffer=new Rr(e*4*i),this.dynamicAttributeBuffer=new Rr(e*4*n),this.indexBuffer=
|
|
3206
|
+
`);return new Function("ps","f32v","u32v",i)}var yc=class{constructor(t){this._size=0,this._generateParticleUpdateCache={};let e=this._size=t.size??1e3,s=t.properties,i=0,n=0;for(let c in s){let h=s[c],d=Le(h.format);h.dynamic?n+=d.stride:i+=d.stride}this._dynamicStride=n/4,this._staticStride=i/4,this.staticAttributeBuffer=new Rr(e*4*i),this.dynamicAttributeBuffer=new Rr(e*4*n),this.indexBuffer=pp(e);let o=new Ne,a=0,u=0;this._staticBuffer=new zt({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:ct.VERTEX|ct.COPY_DST}),this._dynamicBuffer=new zt({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:ct.VERTEX|ct.COPY_DST});for(let c in s){let h=s[c],d=Le(h.format);h.dynamic?(o.addAttribute(h.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:a*4,format:h.format}),a+=d.size):(o.addAttribute(h.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:u*4,format:h.format}),u+=d.size)}o.addIndex(this.indexBuffer);let l=this.getParticleUpdate(s);this._dynamicUpload=l.dynamicUpdate,this._staticUpload=l.staticUpdate,this.geometry=o}getParticleUpdate(t){let e=sD(t);return this._generateParticleUpdateCache[e]?this._generateParticleUpdateCache[e]:(this._generateParticleUpdateCache[e]=this.generateParticleUpdate(t),this._generateParticleUpdateCache[e])}generateParticleUpdate(t){return E1(t)}update(t,e){t.length>this._size&&(e=!0,this._size=Math.max(t.length,this._size*1.5|0),this.staticAttributeBuffer=new Rr(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new Rr(this._size*this._dynamicStride*4*4),this.indexBuffer=pp(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));let s=this.dynamicAttributeBuffer;if(this._dynamicUpload(t,s.float32View,s.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,t.length*this._dynamicStride*4,!0),e){let i=this.staticAttributeBuffer;this._staticUpload(t,i.float32View,i.uint32View),this._staticBuffer.setDataWithSize(i.float32View,t.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}};function sD(r){let t=[];for(let e in r){let s=r[e];t.push(e,s.code,s.dynamic?"d":"s")}return t.join("_")}It();ot();Oe();Ye();lr();ht();kr();var C1=`varying vec2 vUV;
|
|
3207
3207
|
varying vec4 vColor;
|
|
3208
3208
|
|
|
3209
3209
|
uniform sampler2D uTexture;
|
|
@@ -3211,7 +3211,7 @@ uniform sampler2D uTexture;
|
|
|
3211
3211
|
void main(void){
|
|
3212
3212
|
vec4 color = texture2D(uTexture, vUV) * vColor;
|
|
3213
3213
|
gl_FragColor = color;
|
|
3214
|
-
}`;var
|
|
3214
|
+
}`;var A1=`attribute vec2 aVertex;
|
|
3215
3215
|
attribute vec2 aUV;
|
|
3216
3216
|
attribute vec4 aColor;
|
|
3217
3217
|
|
|
@@ -3250,7 +3250,7 @@ void main(void){
|
|
|
3250
3250
|
vUV = aUV;
|
|
3251
3251
|
vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
|
|
3252
3252
|
}
|
|
3253
|
-
`;var
|
|
3253
|
+
`;var mp=`
|
|
3254
3254
|
struct ParticleUniforms {
|
|
3255
3255
|
uTranslationMatrix:mat3x3<f32>,
|
|
3256
3256
|
uColor:vec4<f32>,
|
|
@@ -3312,7 +3312,7 @@ fn mainFragment(
|
|
|
3312
3312
|
var sample = textureSample(uTexture, uSampler, uv) * color;
|
|
3313
3313
|
|
|
3314
3314
|
return sample;
|
|
3315
|
-
}`;var vc=class extends Vt{constructor(){let t=Rt.from({vertex:
|
|
3315
|
+
}`;var vc=class extends Vt{constructor(){let t=Rt.from({vertex:A1,fragment:C1}),e=Mt.from({fragment:{source:mp,entryPoint:"mainFragment"},vertex:{source:mp,entryPoint:"mainVertex"}});super({glProgram:t,gpuProgram:e,resources:{uTexture:D.WHITE.source,uSampler:new Qt({}),uniforms:{uTranslationMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new X(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}};var Qr=class{constructor(t,e){this.state=Ut.for2d(),this.localUniforms=new dt({uTranslationMatrix:{value:new F,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=t,this.adaptor=e,this.defaultShader=new vc,this.state=Ut.for2d(),this._managedContainers=new vt({renderer:t,type:"renderable",name:"particleContainer"})}validateRenderable(t){return!1}addRenderable(t,e){this.renderer.renderPipes.batch.break(e),e.add(t)}getBuffers(t){return t._gpuData[this.renderer.uid]||this._initBuffer(t)}_initBuffer(t){return t._gpuData[this.renderer.uid]=new yc({size:t.particleChildren.length,properties:t._properties}),this._managedContainers.add(t),t._gpuData[this.renderer.uid]}updateRenderable(t){}execute(t){let e=t.particleChildren;if(e.length===0)return;let s=this.renderer,i=this.getBuffers(t);t.texture||(t.texture=e[0].texture);let n=this.state;i.update(e,t._childrenDirty),t._childrenDirty=!1,n.blendMode=Wr(t.groupBlendMode,t.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;t.worldTransform.copyTo(a);let u=s.globalUniforms.globalUniformData;a.tx-=u.offset.x,a.ty-=u.offset.y,a.prepend(u.projectionMatrix),o.uResolution=u.resolution,o.uRound=s._roundPixels|t._roundPixels,Mr(t.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,t)}destroy(){this._managedContainers.destroy(),this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}};Qr.extension={type:[m.CanvasPipes],name:"particle"};var Fa=class extends Qr{constructor(t){super(t,new bc)}};Fa.extension={type:[m.CanvasPipes],name:"particle"};var Tc=class{execute(t,e){let s=t.state,i=t.renderer,n=e.shader||t.defaultShader;n.resources.uTexture=e.texture._source,n.resources.uniforms=t.localUniforms;let o=i.gl,a=t.getBuffers(e);i.shader.bind(n),i.state.set(s),i.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,e.particleChildren.length*6,l,0)}};C();var Ga=class extends Qr{constructor(t){super(t,new Tc)}};Ga.extension={type:[m.WebGLPipes],name:"particle"};var Sc=class{execute(t,e){let s=t.renderer,i=e.shader||t.defaultShader;i.groups[0]=s.renderPipes.uniformBatch.getUniformBindGroup(t.localUniforms,!0),i.groups[1]=s.texture.getTextureBindGroup(e.texture);let n=t.state,o=t.getBuffers(e);s.encoder.draw({geometry:o.geometry,shader:e.shader||t.defaultShader,state:n,size:e.particleChildren.length*6})}};C();var Ua=class extends Qr{constructor(t){super(t,new Sc)}};Ua.extension={type:[m.WebGPUPipes],name:"particle"};It();ht();Ls();Hc();var XA=class w1{constructor(t){if(t instanceof D)this.texture=t,wn(this,w1.defaultOptions,{});else{let e={...w1.defaultOptions,...t};wn(this,e,{})}}get alpha(){return this._alpha}set alpha(t){this._alpha=Math.min(Math.max(t,0),1),this._updateColor()}get tint(){return Te(this._tint)}set tint(t){this._tint=X.shared.setValue(t??16777215).toBgrNumber(),this._updateColor()}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24)}};XA.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};var iD=XA;he();br();var gp={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3316
3316
|
const texture = p.texture;
|
|
3317
3317
|
const sx = p.scaleX;
|
|
3318
3318
|
const sy = p.scaleY;
|
|
@@ -3392,9 +3392,9 @@ fn mainFragment(
|
|
|
3392
3392
|
u32v[offset + stride] = c;
|
|
3393
3393
|
u32v[offset + (stride * 2)] = c;
|
|
3394
3394
|
u32v[offset + (stride * 3)] = c;
|
|
3395
|
-
`,dynamic:!1}};C();O.add(Fa);O.add(Ga);O.add(Da);var sD=new _t(0,0,0,0),XA=class A1 extends Jt{constructor(t={}){t={...A1.defaultOptions,...t,dynamicProperties:{...A1.defaultOptions.dynamicProperties,...t?.dynamicProperties}};let{dynamicProperties:e,shader:s,roundPixels:i,texture:n,particles:o,...a}=t;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=!1,this._childrenDirty=!1,this.texture=n||null,this.shader=s,this._properties={};for(let u in mp){let l=mp[u],c=e[u];this._properties[u]={...l,dynamic:c}}this.allowChildren=!0,this.roundPixels=i??!1,this.particleChildren=o??[]}addParticle(...t){for(let e=0;e<t.length;e++)this.particleChildren.push(t[e]);return this.onViewUpdate(),t[0]}removeParticle(...t){let e=!1;for(let s=0;s<t.length;s++){let i=this.particleChildren.indexOf(t[s]);i>-1&&(this.particleChildren.splice(i,1),e=!0)}return e&&this.onViewUpdate(),t[0]}update(){this._childrenDirty=!0}onViewUpdate(){this._childrenDirty=!0,super.onViewUpdate()}get bounds(){return sD}updateBounds(){}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource,i=this.texture??this.particleChildren[0]?.texture;i&&i.destroy(s)}this.texture=null,this.shader?.destroy()}removeParticles(t,e){t??(t=0),e??(e=this.particleChildren.length);let s=this.particleChildren.splice(t,e-t);return this.onViewUpdate(),s}removeParticleAt(t){let e=this.particleChildren.splice(t,1);return this.onViewUpdate(),e[0]}addParticleAt(t,e){return this.particleChildren.splice(e,0,t),this.onViewUpdate(),t}addChild(...t){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...t){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(t,e){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(t){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(t){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(t,e){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(t){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(t,e){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(t,e){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...t){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(t,e){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};XA.defaultOptions={dynamicProperties:{vertex:!1,position:!0,rotation:!1,uvs:!1,color:!1},roundPixels:!1};var iD=XA;C();Lr();Os();ks();var Ua=class{constructor(t){this._renderer=t}validateRenderable(t){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){let e=this._renderer,s=e.canvasContext,i=s.activeContext;i.save();let n=t.groupTransform,o=e._roundPixels|t._roundPixels;s.setContextTransform(n,o===1),s.setBlendMode(t.groupBlendMode);let a=e.globalUniforms.globalUniformData?.worldColor??4294967295,u=t.groupColorAlpha,l=(a>>>24&255)/255,c=(u>>>24&255)/255,h=e.filter?.alphaMultiplier??1,d=l*c*h;if(d<=0){i.restore();return}i.globalAlpha=d;let f=a&16777215,p=u&16777215,g=Te(Ie(p,f)),_=t.texture,b=Z.getCanvasSource(_);if(!b){i.restore();return}let y=s.smoothProperty,v=_.source.style.scaleMode!=="nearest";i[y]!==v&&(i[y]=v);let T=g!==16777215||_.rotate!==0,S=T?Z.getTintedCanvas({texture:_},g):b,{leftWidth:E,topHeight:w,rightWidth:M,bottomHeight:P,width:R,height:A}=t,G=E+M,H=w+P,W=Math.min(G>R?R/G:1,H>A?A/H:1,1),$=E*W,B=M*W,U=w*W,z=P*W,L=Math.max(0,R-$-B),K=Math.max(0,A-U-z),gt=t.anchor,ft=_.source._resolution??_.source.resolution??1,Y=_.frame.x*ft,Q=_.frame.y*ft,j=-gt.x*R,Pt=-gt.y*A,Ht=E*ft,Me=w*ft,De=M*ft,se=P*ft,Fe=_.frame.width*ft,ie=_.frame.height*ft;T&&(Y=0,Q=0,Fe=S.width,ie=S.height),i.drawImage(S,Y,Q,Ht,Me,j,Pt,$,U),i.drawImage(S,Y+Ht,Q,Fe-Ht-De,Me,j+$,Pt,L,U),i.drawImage(S,Y+Fe-De,Q,De,Me,j+R-B,Pt,B,U),i.drawImage(S,Y,Q+Me,Ht,ie-Me-se,j,Pt+U,$,K),i.drawImage(S,Y+Ht,Q+Me,Fe-Ht-De,ie-Me-se,j+$,Pt+U,L,K),i.drawImage(S,Y+Fe-De,Q+Me,De,ie-Me-se,j+R-B,Pt+U,B,K),i.drawImage(S,Y,Q+ie-se,Ht,se,j,Pt+A-z,$,z),i.drawImage(S,Y+Ht,Q+ie-se,Fe-Ht-De,se,j+$,Pt+A-z,L,z),i.drawImage(S,Y+Fe-De,Q+ie-se,De,se,j+R-B,Pt+A-z,B,z),i.restore()}destroy(){this._renderer=null}};Ua.extension={type:[m.CanvasPipes],name:"nineSliceSprite"};var $A=class gp extends yn{constructor(t={}){t={...gp.defaultOptions,...t},super({width:t.width,height:t.height,verticesX:4,verticesY:4}),this._trimX=0,this._trimY=0,this._trimWidth=t.originalWidth??gp.defaultOptions.originalWidth,this._trimHeight=t.originalHeight??gp.defaultOptions.originalHeight,this.update(t)}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,t.trim!==void 0?(this._trimX=t.trim?.x??0,this._trimY=t.trim?.y??0,this._trimWidth=t.trim?.width??this._originalWidth,this._trimHeight=t.trim?.height??this._originalHeight):(this._trimWidth=this._originalWidth,this._trimHeight=this._originalHeight),this.updateUvs(),this.updatePositions()}updatePositions(){let t=this.positions,{width:e,height:s,_leftWidth:i,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=i+n,h=e>c?1:e/c,d=o+a,f=s>d?1:s/d,p=Math.min(h,f),g=u*e,_=l*s;t[0]=t[8]=t[16]=t[24]=-g,t[2]=t[10]=t[18]=t[26]=i*p-g,t[4]=t[12]=t[20]=t[28]=e-n*p-g,t[6]=t[14]=t[22]=t[30]=e-g,t[1]=t[3]=t[5]=t[7]=-_,t[9]=t[11]=t[13]=t[15]=o*p-_,t[17]=t[19]=t[21]=t[23]=s-a*p-_,t[25]=t[27]=t[29]=t[31]=s-_,this.getBuffer("aPosition").update()}updateUvs(){let t=this.uvs,e=this._originalWidth,s=this._originalHeight,i=this._trimX/e,n=this._trimY/s,o=(this._trimX+this._trimWidth)/e,a=(this._trimY+this._trimHeight)/s;t[0]=t[8]=t[16]=t[24]=i,t[1]=t[3]=t[5]=t[7]=n,t[6]=t[14]=t[22]=t[30]=o,t[25]=t[27]=t[29]=t[31]=a;let u=1/e,l=1/s;t[2]=t[10]=t[18]=t[26]=i+u*this._leftWidth,t[9]=t[11]=t[13]=t[15]=n+l*this._topHeight,t[4]=t[12]=t[20]=t[28]=o-u*this._rightWidth,t[17]=t[19]=t[21]=t[23]=a-l*this._bottomHeight,this.getBuffer("aUV").update()}};$A.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};var Jr=$A;Gs();ht();xt();br();C();C();ye();var xp=class extends Ps{constructor(){super(),this.geometry=new Jr}destroy(){this.geometry.destroy()}},Ia=class{constructor(t){this._renderer=t,this._managedSprites=new vt({renderer:t,type:"renderable",name:"nineSliceSprite"})}addRenderable(t,e){let s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){let e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture)}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=t._gpuData[this._renderer.uid]=new xp,s=e;return s.renderable=t,s.transform=t.groupTransform,s.texture=t._texture,s.roundPixels=this._renderer._roundPixels|t._roundPixels,this._managedSprites.add(t),t.didViewUpdate||this._updateBatchableSprite(t,s),e}destroy(){this._managedSprites.destroy(),this._renderer=null}};Ia.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"nineSliceSprite"};O.add(Ua);O.add(Ia);var YA=class jA extends Jt{constructor(t){t instanceof D&&(t={texture:t});let{width:e,height:s,anchor:i,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=t;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=!0,this._leftWidth=n??l?.defaultBorders?.left??Jr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Jr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Jr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Jr.defaultOptions.bottomHeight,this._width=e??l.width??Jr.defaultOptions.width,this._height=s??l.height??Jr.defaultOptions.height,this.allowChildren=!1,this.texture=l??jA.defaultOptions.texture,this.roundPixels=c??!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return this._width}set width(t){this._width=t,this.onViewUpdate()}get height(){return this._height}set height(t){this._height=t,this.onViewUpdate()}setSize(t,e){typeof t=="object"&&(e=t.height??t.width,t=t.width),this._width=t,this._height=e??t,this.onViewUpdate()}getSize(t){return t||(t={}),t.width=this._width,t.height=this._height,t}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this.onViewUpdate()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this.onViewUpdate()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this.onViewUpdate()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this.onViewUpdate()}get texture(){return this._texture}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}get trim(){return this._texture.trim??null}destroy(t){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null}updateBounds(){let t=this._bounds,e=this._anchor,s=this._width,i=this._height;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}};YA.defaultOptions={texture:D.EMPTY};var qA=YA,w1=class extends qA{constructor(...t){let e=t[0];e instanceof D&&(I(V,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),e={texture:e,leftWidth:t[1],topHeight:t[2],rightWidth:t[3],bottomHeight:t[4]}),I(V,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(e)}};_e();bs();ia();wl();function P1(r){let{text:t,style:e,chars:s}=r,i=e,n=Yr.getFont(t,i),o=At.graphemeSegmenter(t),a=hn(o,i,n,!0),u=a.scale,l=[],c=[],h=[],d=e.lineHeight?e.lineHeight:n.lineHeight*u,f=0;for(let p of a.lines){if(p.chars.length===0)continue;let g=new lt({label:"line"});g.y=f,h.push(g);let _=new lt({label:"word"}),b=0;for(let y=0;y<p.chars.length;y++){let v=p.chars[y];if(!v||!n.chars[v])continue;let S=v===" ",E=y===p.chars.length-1,w;s.length>0?(w=s.shift(),w.text=v,w.style=i,w.label=`char-${v}`,w.x=p.charPositions[y]*u-p.charPositions[b]*u):w=new xn({text:v,style:i,label:`char-${v}`,x:p.charPositions[y]*u-p.charPositions[b]*u}),S||(l.push(w),_.addChild(w)),(S||E)&&_.children.length>0&&(_.x=p.charPositions[b]*u,c.push(_),g.addChild(_),_=new lt({label:"word"}),b=y+1)}f+=d}return{chars:l,lines:h,words:c}}_e();fr();var vn=class extends lt{constructor(t){let{text:e,style:s,autoSplit:i,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=t;super(u),this._dirty=!1,this._canReuseChars=!1,this.chars=[],this.words=[],this.lines=[],this._originalText=e,this._autoSplit=i,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=s}split(){let t=this.splitFn();this.chars=t.chars,this.words=t.words,this.lines=t.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=!1,this._canReuseChars=!0}get text(){return this._originalText}set text(t){this._originalText=t,this.lines.forEach(e=>e.destroy({children:!0})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=!1,this.onTextUpdate()}_setOrigin(t,e,s){let i;typeof t=="number"?i={x:t,y:t}:i={x:t.x,y:t.y},e.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*i.x,u=o.minY+o.height*i.y;n.origin.set(a,u)}),this[s]=t}get lineAnchor(){return this._lineAnchor}set lineAnchor(t){this._setOrigin(t,this.lines,"_lineAnchor")}get wordAnchor(){return this._wordAnchor}set wordAnchor(t){this._setOrigin(t,this.words,"_wordAnchor")}get charAnchor(){return this._charAnchor}set charAnchor(t){this._setOrigin(t,this.chars,"_charAnchor")}get style(){return this._style}set style(t){t||(t={}),this._style=new Ot(t),this.styleChanged()}styleChanged(){this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=!0,this.onTextUpdate()}onTextUpdate(){this._dirty=!0,this._autoSplit&&this.split()}destroy(t){super.destroy(t),this.chars=[],this.words=[],this.lines=[],(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._originalText=""}};pt();fr();var KA=class _p extends vn{constructor(t){var e;let s={..._p.defaultOptions,...t};s.style??(s.style={}),(e=s.style).fill??(e.fill=16777215),super(s)}static from(t,e){let s={..._p.defaultOptions,...e,text:t.text,style:new Ot(t.style)};t.style.tagStyles&&(k("[SplitBitmapText] Tag styles are not supported for SplitBitmapText. They will be ignored."),t.style._tagStyles=void 0);let i=new _p({...s}),n=t.anchor;return(n.x!==0||n.y!==0)&&i.pivot.set(i.width*n.x,i.height*n.y),i}splitFn(){return P1({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};KA.defaultOptions={autoSplit:!0,lineAnchor:0,wordAnchor:0,charAnchor:0};var nD=KA;fr();ot();_e();zr();bs();function ZA(r,t,e){switch(r){case"center":return(e-t)/2;case"right":return e-t;default:return 0}}function B1(r){return r==="\r"||r===`
|
|
3395
|
+
`,dynamic:!1}};C();O.add(Ga);O.add(Ua);O.add(Fa);var nD=new _t(0,0,0,0),$A=class P1 extends Jt{constructor(t={}){t={...P1.defaultOptions,...t,dynamicProperties:{...P1.defaultOptions.dynamicProperties,...t?.dynamicProperties}};let{dynamicProperties:e,shader:s,roundPixels:i,texture:n,particles:o,...a}=t;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=!1,this._childrenDirty=!1,this.texture=n||null,this.shader=s,this._properties={};for(let u in gp){let l=gp[u],c=e[u];this._properties[u]={...l,dynamic:c}}this.allowChildren=!0,this.roundPixels=i??!1,this.particleChildren=o??[]}addParticle(...t){for(let e=0;e<t.length;e++)this.particleChildren.push(t[e]);return this.onViewUpdate(),t[0]}removeParticle(...t){let e=!1;for(let s=0;s<t.length;s++){let i=this.particleChildren.indexOf(t[s]);i>-1&&(this.particleChildren.splice(i,1),e=!0)}return e&&this.onViewUpdate(),t[0]}update(){this._childrenDirty=!0}onViewUpdate(){this._childrenDirty=!0,super.onViewUpdate()}get bounds(){return nD}updateBounds(){}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource,i=this.texture??this.particleChildren[0]?.texture;i&&i.destroy(s)}this.texture=null,this.shader?.destroy()}removeParticles(t,e){t??(t=0),e??(e=this.particleChildren.length);let s=this.particleChildren.splice(t,e-t);return this.onViewUpdate(),s}removeParticleAt(t){let e=this.particleChildren.splice(t,1);return this.onViewUpdate(),e[0]}addParticleAt(t,e){return this.particleChildren.splice(e,0,t),this.onViewUpdate(),t}addChild(...t){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...t){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(t,e){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(t){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(t){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(t,e){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(t){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(t,e){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(t,e){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...t){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(t,e){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};$A.defaultOptions={dynamicProperties:{vertex:!1,position:!0,rotation:!1,uvs:!1,color:!1},roundPixels:!1};var oD=$A;C();Lr();Ls();Os();var Ia=class{constructor(t){this._renderer=t}validateRenderable(t){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){let e=this._renderer,s=e.canvasContext,i=s.activeContext;i.save();let n=t.groupTransform,o=e._roundPixels|t._roundPixels;s.setContextTransform(n,o===1),s.setBlendMode(t.groupBlendMode);let a=e.globalUniforms.globalUniformData?.worldColor??4294967295,u=t.groupColorAlpha,l=(a>>>24&255)/255,c=(u>>>24&255)/255,h=e.filter?.alphaMultiplier??1,d=l*c*h;if(d<=0){i.restore();return}i.globalAlpha=d;let f=a&16777215,p=u&16777215,g=Te(Ie(p,f)),_=t.texture,b=Z.getCanvasSource(_);if(!b){i.restore();return}let y=s.smoothProperty,v=_.source.style.scaleMode!=="nearest";i[y]!==v&&(i[y]=v);let T=g!==16777215||_.rotate!==0,S=T?Z.getTintedCanvas({texture:_},g):b,{leftWidth:E,topHeight:w,rightWidth:M,bottomHeight:P,width:R,height:A}=t,G=E+M,H=w+P,W=Math.min(G>R?R/G:1,H>A?A/H:1,1),$=E*W,B=M*W,U=w*W,z=P*W,L=Math.max(0,R-$-B),K=Math.max(0,A-U-z),gt=t.anchor,ft=_.source._resolution??_.source.resolution??1,Y=_.frame.x*ft,Q=_.frame.y*ft,j=-gt.x*R,Bt=-gt.y*A,Ht=E*ft,Me=w*ft,De=M*ft,se=P*ft,Fe=_.frame.width*ft,ie=_.frame.height*ft;T&&(Y=0,Q=0,Fe=S.width,ie=S.height),i.drawImage(S,Y,Q,Ht,Me,j,Bt,$,U),i.drawImage(S,Y+Ht,Q,Fe-Ht-De,Me,j+$,Bt,L,U),i.drawImage(S,Y+Fe-De,Q,De,Me,j+R-B,Bt,B,U),i.drawImage(S,Y,Q+Me,Ht,ie-Me-se,j,Bt+U,$,K),i.drawImage(S,Y+Ht,Q+Me,Fe-Ht-De,ie-Me-se,j+$,Bt+U,L,K),i.drawImage(S,Y+Fe-De,Q+Me,De,ie-Me-se,j+R-B,Bt+U,B,K),i.drawImage(S,Y,Q+ie-se,Ht,se,j,Bt+A-z,$,z),i.drawImage(S,Y+Ht,Q+ie-se,Fe-Ht-De,se,j+$,Bt+A-z,L,z),i.drawImage(S,Y+Fe-De,Q+ie-se,De,se,j+R-B,Bt+A-z,B,z),i.restore()}destroy(){this._renderer=null}};Ia.extension={type:[m.CanvasPipes],name:"nineSliceSprite"};var YA=class xp extends Tn{constructor(t={}){t={...xp.defaultOptions,...t},super({width:t.width,height:t.height,verticesX:4,verticesY:4}),this._trimX=0,this._trimY=0,this._trimWidth=t.originalWidth??xp.defaultOptions.originalWidth,this._trimHeight=t.originalHeight??xp.defaultOptions.originalHeight,this.update(t)}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,t.trim!==void 0?(this._trimX=t.trim?.x??0,this._trimY=t.trim?.y??0,this._trimWidth=t.trim?.width??this._originalWidth,this._trimHeight=t.trim?.height??this._originalHeight):(this._trimWidth=this._originalWidth,this._trimHeight=this._originalHeight),this.updateUvs(),this.updatePositions()}updatePositions(){let t=this.positions,{width:e,height:s,_leftWidth:i,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=i+n,h=e>c?1:e/c,d=o+a,f=s>d?1:s/d,p=Math.min(h,f),g=u*e,_=l*s;t[0]=t[8]=t[16]=t[24]=-g,t[2]=t[10]=t[18]=t[26]=i*p-g,t[4]=t[12]=t[20]=t[28]=e-n*p-g,t[6]=t[14]=t[22]=t[30]=e-g,t[1]=t[3]=t[5]=t[7]=-_,t[9]=t[11]=t[13]=t[15]=o*p-_,t[17]=t[19]=t[21]=t[23]=s-a*p-_,t[25]=t[27]=t[29]=t[31]=s-_,this.getBuffer("aPosition").update()}updateUvs(){let t=this.uvs,e=this._originalWidth,s=this._originalHeight,i=this._trimX/e,n=this._trimY/s,o=(this._trimX+this._trimWidth)/e,a=(this._trimY+this._trimHeight)/s;t[0]=t[8]=t[16]=t[24]=i,t[1]=t[3]=t[5]=t[7]=n,t[6]=t[14]=t[22]=t[30]=o,t[25]=t[27]=t[29]=t[31]=a;let u=1/e,l=1/s;t[2]=t[10]=t[18]=t[26]=i+u*this._leftWidth,t[9]=t[11]=t[13]=t[15]=n+l*this._topHeight,t[4]=t[12]=t[20]=t[28]=o-u*this._rightWidth,t[17]=t[19]=t[21]=t[23]=a-l*this._bottomHeight,this.getBuffer("aUV").update()}};YA.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};var Jr=YA;Us();ht();xt();br();C();C();ye();var _p=class extends Bs{constructor(){super(),this.geometry=new Jr}destroy(){this.geometry.destroy()}},ka=class{constructor(t){this._renderer=t,this._managedSprites=new vt({renderer:t,type:"renderable",name:"nineSliceSprite"})}addRenderable(t,e){let s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){let e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){let e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture)}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){let e=t._gpuData[this._renderer.uid]=new _p,s=e;return s.renderable=t,s.transform=t.groupTransform,s.texture=t._texture,s.roundPixels=this._renderer._roundPixels|t._roundPixels,this._managedSprites.add(t),t.didViewUpdate||this._updateBatchableSprite(t,s),e}destroy(){this._managedSprites.destroy(),this._renderer=null}};ka.extension={type:[m.WebGLPipes,m.WebGPUPipes],name:"nineSliceSprite"};O.add(Ia);O.add(ka);var jA=class qA extends Jt{constructor(t){t instanceof D&&(t={texture:t});let{width:e,height:s,anchor:i,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=t;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=!0,this._leftWidth=n??l?.defaultBorders?.left??Jr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Jr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Jr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Jr.defaultOptions.bottomHeight,this._width=e??l.width??Jr.defaultOptions.width,this._height=s??l.height??Jr.defaultOptions.height,this.allowChildren=!1,this.texture=l??qA.defaultOptions.texture,this.roundPixels=c??!1,this._anchor=new Et({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return this._width}set width(t){this._width=t,this.onViewUpdate()}get height(){return this._height}set height(t){this._height=t,this.onViewUpdate()}setSize(t,e){typeof t=="object"&&(e=t.height??t.width,t=t.width),this._width=t,this._height=e??t,this.onViewUpdate()}getSize(t){return t||(t={}),t.width=this._width,t.height=this._height,t}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this.onViewUpdate()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this.onViewUpdate()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this.onViewUpdate()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this.onViewUpdate()}get texture(){return this._texture}set texture(t){t||(t=D.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}get trim(){return this._texture.trim??null}destroy(t){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null}updateBounds(){let t=this._bounds,e=this._anchor,s=this._width,i=this._height;t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}};jA.defaultOptions={texture:D.EMPTY};var KA=jA,B1=class extends KA{constructor(...t){let e=t[0];e instanceof D&&(I(V,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),e={texture:e,leftWidth:t[1],topHeight:t[2],rightWidth:t[3],bottomHeight:t[4]}),I(V,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(e)}};_e();bs();oa();Pl();function R1(r){let{text:t,style:e,chars:s}=r,i=e,n=Yr.getFont(t,i),o=At.graphemeSegmenter(t),a=fn(o,i,n,!0),u=a.scale,l=[],c=[],h=[],d=e.lineHeight?e.lineHeight:n.lineHeight*u,f=0;for(let p of a.lines){if(p.chars.length===0)continue;let g=new lt({label:"line"});g.y=f,h.push(g);let _=new lt({label:"word"}),b=0;for(let y=0;y<p.chars.length;y++){let v=p.chars[y];if(!v||!n.chars[v])continue;let S=v===" ",E=y===p.chars.length-1,w;s.length>0?(w=s.shift(),w.text=v,w.style=i,w.label=`char-${v}`,w.x=p.charPositions[y]*u-p.charPositions[b]*u):w=new bn({text:v,style:i,label:`char-${v}`,x:p.charPositions[y]*u-p.charPositions[b]*u}),S||(l.push(w),_.addChild(w)),(S||E)&&_.children.length>0&&(_.x=p.charPositions[b]*u,c.push(_),g.addChild(_),_=new lt({label:"word"}),b=y+1)}f+=d}return{chars:l,lines:h,words:c}}_e();fr();var Sn=class extends lt{constructor(t){let{text:e,style:s,autoSplit:i,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=t;super(u),this._dirty=!1,this._canReuseChars=!1,this.chars=[],this.words=[],this.lines=[],this._originalText=e,this._autoSplit=i,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=s}split(){let t=this.splitFn();this.chars=t.chars,this.words=t.words,this.lines=t.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=!1,this._canReuseChars=!0}get text(){return this._originalText}set text(t){this._originalText=t,this.lines.forEach(e=>e.destroy({children:!0})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=!1,this.onTextUpdate()}_setOrigin(t,e,s){let i;typeof t=="number"?i={x:t,y:t}:i={x:t.x,y:t.y},e.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*i.x,u=o.minY+o.height*i.y;n.origin.set(a,u)}),this[s]=t}get lineAnchor(){return this._lineAnchor}set lineAnchor(t){this._setOrigin(t,this.lines,"_lineAnchor")}get wordAnchor(){return this._wordAnchor}set wordAnchor(t){this._setOrigin(t,this.words,"_wordAnchor")}get charAnchor(){return this._charAnchor}set charAnchor(t){this._setOrigin(t,this.chars,"_charAnchor")}get style(){return this._style}set style(t){t||(t={}),this._style=new Ot(t),this.styleChanged()}styleChanged(){this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=!0,this.onTextUpdate()}onTextUpdate(){this._dirty=!0,this._autoSplit&&this.split()}destroy(t){super.destroy(t),this.chars=[],this.words=[],this.lines=[],(typeof t=="boolean"?t:t?.style)&&this._style.destroy(t),this._style=null,this._originalText=""}};pt();fr();var ZA=class bp extends Sn{constructor(t){var e;let s={...bp.defaultOptions,...t};s.style??(s.style={}),(e=s.style).fill??(e.fill=16777215),super(s)}static from(t,e){let s={...bp.defaultOptions,...e,text:t.text,style:new Ot(t.style)};t.style.tagStyles&&(k("[SplitBitmapText] Tag styles are not supported for SplitBitmapText. They will be ignored."),t.style._tagStyles=void 0);let i=new bp({...s}),n=t.anchor;return(n.x!==0||n.y!==0)&&i.pivot.set(i.width*n.x,i.height*n.y),i}splitFn(){return R1({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};ZA.defaultOptions={autoSplit:!0,lineAnchor:0,wordAnchor:0,charAnchor:0};var aD=ZA;fr();ot();_e();zr();bs();function QA(r,t,e){switch(r){case"center":return(e-t)/2;case"right":return e-t;default:return 0}}function M1(r){return r==="\r"||r===`
|
|
3396
3396
|
`||r===`\r
|
|
3397
|
-
`}var oD=/^\s*$/;function aD(r,t){let e=[],s=t.lines[0],i="",n=[],o=0;return r.forEach(a=>{let u=oD.test(a),l=B1(a),c=i.length===0&&u;u&&!l&&c&&(!s||!s.startsWith(a))||(l||(i+=a),n.push(a),i.length>=s.length&&(e.push({line:i,chars:n}),n=[],i="",o++,s=t.lines[o]))}),e}function R1(r){let{text:t,style:e,chars:s}=r,i=e,n=At.measureText(t,i);if(n.runsByLine&&n.runsByLine.length>0)return uD(n,i,s,t);let o=At.graphemeSegmenter(t),a=aD(o,n),u=i.align,l=n.lineWidths.reduce((A,G)=>Math.max(A,G),0),c=i._fill?.fill,h=i._stroke?.fill,d=c instanceof Nt,f=h instanceof Nt,p=d||f,g=d&&c.textureSpace==="local"||f&&h.textureSpace==="local",_=n.width,b=n.height,y=i.clone();y.align="left";let v=0,T=0;if(y.trim){let{frame:A,canvasAndContext:G}=Je.getCanvasAndContext({text:t,style:i,resolution:1});Je.returnCanvasAndContext(G),v=-A.x,T=-A.y,y.trim=!1}let S=[],E=[],w=[],M=0,P=0,R=g?{width:_,height:b}:null;return a.forEach((A,G)=>{let H=new lt({label:`line-${G}`});H.y=M+T,E.push(H);let W=n.lineWidths[G],$=ZA(u,W,l),B=new lt({label:"word"});B.x=$+v;let U=At._context;U.font=y._fontString,At.experimentalLetterSpacingSupported&&(U.letterSpacing="0px",U.textLetterSpacing="0px");let z=A.line,L=U.measureText(z).width;if(A.chars.forEach(K=>{if(B1(K))return;z=z.slice(K.length);let gt=z.length>0?U.measureText(z).width:0,ft=L-gt;if(L=gt,ft!==0)if(K===" ")B.children.length>0&&(w.push(B),H.addChild(B)),$+=ft+i.letterSpacing,B=new lt({label:"word"}),B.x=$+v;else{let Y=y;p&&(Y=y.clone(),Y._gradientOffset={x:-$,y:-M},R&&(Y._gradientBounds=R));let Q;P<s.length?(Q=s[P++],Q.text=K,Q.style=Y,Q.setFromMatrix(F.IDENTITY),Q.x=$-B.x+v):Q=new Zr({text:K,style:Y,x:$-B.x+v}),S.push(Q),B.addChild(Q),$+=ft+i.letterSpacing}}),B.children.length>0&&(w.push(B),H.addChild(B)),u==="justify"&&i.wordWrap&&G<a.length-1){let K=H.children,gt=K.length-1;if(gt>0){let ft=(l-W)/gt;for(let Y=1;Y<K.length;Y++)K[Y].x+=Y*ft}}M+=n.lineHeight}),{chars:S,lines:E,words:w}}function uD(r,t,e,s){let{runsByLine:i}=r,n=t.align,o=r.lineWidths.reduce((p,g)=>Math.max(p,g),0),a=0,u=0;if(t.trim){let{frame:p,canvasAndContext:g}=Je.getCanvasAndContext({text:s,style:t,resolution:1});Je.returnCanvasAndContext(g),a=-p.x,u=-p.y}let l=[],c=[],h=[],d=0,f=0;return i.forEach((p,g)=>{let _=new lt({label:`line-${g}`});_.y=d+u,c.push(_);let b=r.lineWidths[g],y=ZA(n,b,o),v=new lt({label:"word"});v.x=y+a;for(let S of p){let E=S.style,w=E._fill?.fill,M=E._stroke?.fill,P=w instanceof Nt,R=M instanceof Nt,A=P||R,G=P&&w.textureSpace==="local"||R&&M.textureSpace==="local",H=At.graphemeSegmenter(S.text),W=E.clone();W.align="left",W.wordWrap=!1,W.trim&&(W.trim=!1),W.tagStyles=void 0,W._lineHeight=0;let $=At._context;$.font=W._fontString,At.experimentalLetterSpacingSupported&&($.letterSpacing="0px",$.textLetterSpacing="0px");let B=S.text,U=$.measureText(B).width,z=y,L=U,K=At.measureFont(W._fontString),gt=E.lineHeight||K.fontSize,ft=G?{width:L,height:gt}:null;for(let Y of H){B=B.slice(Y.length);let Q=B.length>0?$.measureText(B).width:0,j=U-Q;if(U=Q,!B1(Y)&&j!==0)if(Y===" ")v.children.length>0&&(h.push(v),_.addChild(v)),y+=j+E.letterSpacing,v=new lt({label:"word"}),v.x=y+a;else{let Pt=W;A&&(Pt=W.clone(),G?(Pt._gradientOffset={x:-(y-z),y:0},Pt._gradientBounds=ft):Pt._gradientOffset={x:-(y-z),y:0});let Ht;f<e.length?(Ht=e[f++],Ht.text=Y,Ht.style=Pt,Ht.setFromMatrix(F.IDENTITY),Ht.x=y-v.x+a):Ht=new Zr({text:Y,style:Pt,x:y-v.x+a}),l.push(Ht),v.addChild(Ht),y+=j+E.letterSpacing}}}if(v.children.length>0&&(h.push(v),_.addChild(v)),n==="justify"&&t.wordWrap&&g<i.length-1){let S=_.children,E=S.length-1;if(E>0){let w=(o-b)/E;for(let M=1;M<S.length;M++)S[M].x+=M*w}}let T=r.lineHeights?.[g]??r.lineHeight;d+=T}),{chars:l,lines:c,words:h}}var QA=class bp extends vn{constructor(t){let e={...bp.defaultOptions,...t};super(e)}static from(t,e){let s={...bp.defaultOptions,...e,text:t.text,style:new Ot(t.style)},i=new bp({...s}),n=t.anchor;return(n.x!==0||n.y!==0)&&i.pivot.set(i.width*n.x,i.height*n.y),i}splitFn(){return R1({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};QA.defaultOptions={autoSplit:!0,lineAnchor:0,wordAnchor:0,charAnchor:0};var lD=QA;It();var JA=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function cD(r){let t=[],e=0;for(let s=0;s<JA.length;s++){let i=`_${JA[s]}`;t[e++]=r[i]}return e=tw(r._fill,t,e),e=dD(r._stroke,t,e),e=fD(r.dropShadow,t,e),e=hD(r.filters,t,e),t.join("-")}function hD(r,t,e){if(!r)return e;for(let s of r)t[e++]=s.uid;return e}function tw(r,t,e){return r&&(t[e++]=r.color,t[e++]=r.alpha,t[e++]=r.fill?.styleKey),e}function dD(r,t,e){return r&&(e=tw(r,t,e),t[e++]=r.width,t[e++]=r.alignment,t[e++]=r.cap,t[e++]=r.join,t[e++]=r.miterLimit),e}function fD(r,t,e){return r&&(t[e++]=r.alpha,t[e++]=r.angle,t[e++]=r.blur,t[e++]=r.distance,t[e++]=X.shared.setValue(r.color).toNumber()),e}Pe();async function pD(r,t,e=200){let s=await t.extract.base64(r);t.type!==Tt.CANVAS&&await t.encoder.commandFinished;let i=e;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}Ys();var mD=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],gD=0;function ew(r,t=0,e={color:"#000000"}){r.renderGroup&&(e.color=mD[gD++]);let s="";for(let o=0;o<t;o++)s+=" ";let i=r.label;!i&&r instanceof we&&(i=`sprite:${r.texture.label}`);let n=`%c ${s}|- ${i} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${e.color}; font-weight:bold;`),t++;for(let o=0;o<r.children.length;o++){let a=r.children[o];ew(a,t,{...e})}}function rw(r,t=0,e={index:0,color:"#000000"}){let s="";for(let n=0;n<t;n++)s+=" ";let i=`%c ${s}- ${e.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(i,`color:${e.color}; font-weight:bold;`),t++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];rw(o,t,{...e,index:n})}}vm();Sm();Tr();ir();$s();Bn();Kc();Um();iu();It();Dp();zc();FT();Em();mt();tx();Fm();wm();qc();$c();Za();Mm();Ja();Yc();jc();On();Hg();Wg();Zx();Jx();t_();eg();Vg();Sr();Xa();rg();jg();e_();Ns();ot();wc();En();oh();Gs();Ue();Ym();jm();qm();Km();jt();Zm();$T();dy();yb();ld();Vx();Ru();Ux();$x();fd();Yx();zx();dd();jx();fs();bx();cx();hx();dx();px();mx();Ex();Nn();Hn();wx();Wi();ps();Zh();Lm();md();fy();Nm();s_();$p();s2();Hm();i_();au();uu();o2();a2();h2();u2();l2();c2();ih();Lr();n2();vb();Tb();Sb();Fi();Ab();Bb();Pb();Db();Fb();Gb();Ub();Vb();Ib();Wb();zb();Xb();Yb();Iu();Oe();qb();l0();m0();Kb();Od();wd();t0();u0();ng();hh();r0();i0();o0();Hd();ag();lg();hg();fg();mg();Id();Hb();Lb();p0();d0();y0();x0();el();Vd();W0();T0();E0();A0();zd();P0();D0();G0();I0();O0();N0();M0();sE();V0();G_();U_();j_();I_();k_();O_();L_();N_();Y_();q_();K_();Q_();eb();rb();sb();us();Ye();ib();Td();$_();bg();yg();z_();Sg();Cg();wg();nb();ob();Pd();Dd();ub();cb();db();Rd();pb();mb();xb();a_();gd();cs();Xu();Hr();ud();h_();f_();b_();Qs();Kd();zg();Zs();$g();Zd();qa();y_();tb();_d();ju();v_();vg();lr();Bg();vd();te();Ed();Mg();Ad();Sd();E_();ii();Qn();je();Ui();Vu();zh();Ks();w_();d_();kc();js();Ci();Wt();rh();ht();R_();Oc();_r();kr();bd();$m();kn();F_();Pe();he();di();ja();lh();Is();Hp();Vp();Xp();jp();Kp();Qp();Os();rm();im();om();um();_e();Jh();Nc();ed();Nx();Hc();tm();rd();Ls();td();Dc();ks();kx();Lx();ly();t2();e2();_b();Xi();Mx();Qd();af();Sy();uf();Cy();By();Q0();ll();ty();ry();iy();oy();lE();zr();No();bl();li();pl();r2();Yo();Dy();Fy();Uy();lf();gy();Oy();Xy();Iy();Ny();Vy();Wo();ff();tf();Yy();Y0();Jd();bb();Gx();Xn();Ys();id();_f();w2();ia();S2();wl();C2();bs();Al();Ef();b2();vf();sa();v2();fr();mu();br();Im();Om();Vs();is();fm();th();_m();Xd();Oh();nd();le();g_();ye();Bc();Yt();Jc();ad();od();xt();pt();cm();zs();Us();Lp();xr();S_();lx();O.add(iS,oS);export{on as AbstractBitmapFont,gn as AbstractBitmapTextPipe,Er as AbstractRenderer,vn as AbstractSplitText,Rs as AbstractText,mn as AbstractTextSystem,ym as AccessibilitySystem,mM as AlphaFilter,Mn as AlphaMask,ni as AlphaMaskPipe,ic as AnimatedSprite,UE as Application,qn as ApplicationInitHook,Fl as Assets,Rf as AssetsClass,Hx as BLEND_TO_NPM,OE as BREAKING_SPACES,LE as BREAKING_SPACES_SET,WE as BREAK_AFTER_CHARS,VE as BREAK_AFTER_CHARS_SET,Po as BUFFER_TYPE,Pl as BackgroundLoader,o_ as BackgroundSystem,cd as Batch,Uu as BatchGeometry,Du as BatchTextureArray,ui as BatchableGraphics,fc as BatchableHTMLText,Ps as BatchableMesh,Br as BatchableSprite,uc as BatchableText,Xx as Batcher,ro as BatcherPipe,Ct as BigPool,oe as BindGroup,lo as BindGroupSystem,wf as BitmapFont,Yr as BitmapFontManager,xn as BitmapText,ap as BitmapTextGraphics,Pa as BitmapTextPipe,ut as BlendModeFilter,oi as BlendModePipe,Jf as BlurFilter,rc as BlurFilterPass,_t as Bounds,Dm as BrowserAdapter,zt as Buffer,Hs as BufferImageSource,ms as BufferResource,ct as BufferUsage,ue as CLEAR,NE as COLLAPSIBLE_SPACES,HE as COLLAPSIBLE_SPACES_SET,at as Cache,hy as CanvasBatchAdaptor,wa as CanvasBitmapTextPipe,zo as CanvasColorMaskPipe,Zo as CanvasContextSystem,Un as CanvasFilterSystem,Vo as CanvasGraphicsAdaptor,Jy as CanvasGraphicsContextSystem,jo as CanvasGraphicsPipe,Qo as CanvasLimitsSystem,Ua as CanvasNineSliceSpritePipe,Ti as CanvasObserver,bc as CanvasParticleContainerAdaptor,Da as CanvasParticleContainerPipe,be as CanvasPool,nh as CanvasPoolClass,yl as CanvasRenderTargetAdaptor,Jo as CanvasRenderTargetSystem,mf as CanvasRenderer,Ca as CanvasRendererTextSystem,ne as CanvasSource,Ko as CanvasStencilMaskPipe,Je as CanvasTextGenerator,At as CanvasTextMetrics,Ea as CanvasTextPipe,Aa as CanvasTextSystem,ta as CanvasTextureSystem,ya as CanvasTilingSpritePipe,hu as Circle,X as Color,gh as ColorBlend,xh as ColorBurnBlend,_h as ColorDodgeBlend,Dn as ColorMask,so as ColorMaskPipe,Bv as ColorMatrixFilter,Gr as CompressedSource,lt as Container,u1 as CubeTexture,Ma as CubeTextureSource,nv as Culler,Lf as CullerPlugin,ei as CustomRenderPipe,K2 as D3D10_RESOURCE_DIMENSION,qe as D3DFMT,L3 as DATA_URI,it as DDS,Up as DEG_TO_RAD,hp as DEPRECATED_SCALE_MODES,cp as DEPRECATED_WRAP_MODES,N as DOMAdapter,Cm as DOMContainer,Pn as DOMPipe,PM as DRAW_MODES,q2 as DXGI_FORMAT,ze as DXGI_TO_TEXTURE_FORMAT,bh as DarkenBlend,eo as DefaultBatcher,to as DefaultShader,yh as DifferenceBlend,Dv as DisplacementFilter,vh as DivideBlend,Cf as DynamicBitmapFont,du as Ellipse,eu as EventBoundary,St as EventEmitter,ru as EventSystem,ur as EventsTicker,Th as ExclusionBlend,m as ExtensionType,h1 as ExternalSource,c_ as ExtractSystem,kf as FOURCC_TO_TEXTURE_FORMAT,Rm as FederatedContainer,ns as FederatedEvent,Or as FederatedMouseEvent,Ee as FederatedPointerEvent,yr as FederatedWheelEvent,Nt as FillGradient,hr as FillPattern,ae as Filter,Ur as FilterEffect,In as FilterPipe,Ln as FilterSystem,up as FontStylePromiseCache,ec as GAUSSIAN_VALUES,vt as GCManagedHash,__ as GCSystem,tl as GL_FORMATS,lC as GL_INTERNAL_FORMAT,Ro as GL_TARGETS,bt as GL_TYPES,KS as GL_WRAP_MODES,Eo as GPUTextureGpuData,no as GenerateTextureSystem,Ne as Geometry,Mb as GlBackBufferSystem,wo as GlBatchAdaptor,Ju as GlBuffer,Bo as GlBufferSystem,Do as GlColorMaskSystem,Cb as GlContextSystem,Fo as GlEncoderSystem,Gd as GlGeometryGpuData,Mo as GlGeometrySystem,Co as GlGraphicsAdaptor,Go as GlLimitsSystem,Ao as GlMeshAdaptor,Tc as GlParticleContainerAdaptor,Fa as GlParticleContainerPipe,Rt as GlProgram,il as GlProgramData,rl as GlRenderTarget,sl as GlRenderTargetAdaptor,ko as GlRenderTargetSystem,Oo as GlShaderSystem,b0 as GlStateSystem,Uo as GlStencilSystem,Zi as GlTexture,jd as GlTextureSystem,Io as GlUboSystem,Lo as GlUniformGroupSystem,rr as GlobalResourceRegistry,oo as GlobalUniformSystem,zn as GpuBatchAdaptor,Be as GpuBlendModesToPixi,yd as GpuBufferData,co as GpuBufferSystem,ho as GpuColorMaskSystem,qi as GpuDeviceSystem,fo as GpuEncoderSystem,Wn as GpuGraphicsAdaptor,sf as GpuGraphicsContext,po as GpuLimitsSystem,Vn as GpuMeshAdapter,Qu as GpuMipmapGenerator,Sc as GpuParticleContainerAdaptor,Ga as GpuParticleContainerPipe,Mt as GpuProgram,qu as GpuRenderTarget,Ku as GpuRenderTargetAdaptor,vo as GpuRenderTargetSystem,To as GpuShaderSystem,So as GpuStateSystem,Dr as GpuStencilModesToPixi,mo as GpuStencilSystem,Md as GpuTextureSystem,_o as GpuUboSystem,bo as GpuUniformBatchPipe,xs as Graphics,Kt as GraphicsContext,nf as GraphicsContextRenderData,rn as GraphicsContextSystem,pf as GraphicsGpuData,He as GraphicsPath,qo as GraphicsPipe,pc as HTMLText,Ba as HTMLTextPipe,_n as HTMLTextRenderData,hc as HTMLTextStyle,Ra as HTMLTextSystem,Sh as HardLightBlend,Eh as HardMixBlend,$i as HelloSystem,jb as IGLUniformData,ke as ImageSource,ss as InstructionSet,$t as KTX,Ch as LightenBlend,Ah as LinearBurnBlend,wh as LinearDodgeBlend,Ph as LinearLightBlend,k2 as Loader,Lt as LoaderParserPriority,Bh as LuminosityBlend,$a as MaskEffectManager,Rc as MaskEffectManagerClass,Ou as MaskFilter,F as Matrix,or as Mesh,Xe as MeshGeometry,sc as MeshGpuData,ba as MeshPipe,b1 as MeshPlane,JM as MeshRope,v1 as MeshSimple,IE as NEWLINES,kE as NEWLINES_SET,x2 as NEWLINE_MATCH_REGEX,g2 as NEWLINE_SPLIT_REGEX,Ic as NOOP,Rh as NegationBlend,Jr as NineSliceGeometry,w1 as NineSlicePlane,qA as NineSliceSprite,xp as NineSliceSpriteGpuData,Ia as NineSliceSpritePipe,_M as NoiseFilter,Et as ObservablePoint,Mh as OverlayBlend,Fp as PI_2,rD as Particle,yc as ParticleBuffer,iD as ParticleContainer,Qr as ParticleContainerPipe,vc as ParticleShader,yu as PassthroughFilter,QM as PerspectiveMesh,_c as PerspectivePlaneGeometry,Dh as PinLightBlend,yo as PipelineSystem,yn as PlaneGeometry,nt as Point,wi as Polygon,Va as Pool,Pc as PoolGroupClass,Gv as PrepareBase,lc as PrepareQueue,lp as PrepareSystem,mc as PrepareUpload,ac as QuadGeometry,Gp as RAD_TO_DEG,J as Rectangle,f1 as RenderContainer,Ws as RenderGroup,ri as RenderGroupPipe,jn as RenderGroupSystem,$M as RenderLayer,uo as RenderTarget,gs as RenderTargetSystem,Nu as RenderTexture,A_ as RenderableGCSystem,Kn as RendererInitHook,Tt as RendererType,ea as ResizePlugin,Ae as Resolver,y1 as RopeGeometry,fu as RoundedRectangle,RM as SCALE_MODES,Dt as STENCIL_MODES,gc as SVGDefsCollector,zy as SVGParser,Fh as SaturationBlend,ao as SchedulerSystem,o1 as ScissorMask,cc as SdfShader,Vt as Shader,as as ShaderStage,_l as ShapePath,Wu as SharedRenderPipes,ji as SharedSystems,Gh as SoftLightBlend,nD as SplitBitmapText,lD as SplitText,we as Sprite,si as SpritePipe,Zc as Spritesheet,Ut as State,Fn as StencilMask,io as StencilMaskPipe,Uh as SubtractBlend,Gi as SystemRunner,Z2 as TEXTURE_FORMAT_BLOCK_SIZE,Zr as Text,Ot as TextStyle,D as Texture,B_ as TextureGCSystem,bi as TextureMatrix,yt as TexturePool,Lc as TexturePoolClass,st as TextureSource,Qt as TextureStyle,d1 as TextureUvs,Gt as Ticker,vi as TickerListener,ra as TickerPlugin,Wv as TilingSprite,np as TilingSpriteGpuData,va as TilingSpritePipe,oc as TilingSpriteShader,nc as Transform,Qm as Triangle,h0 as UNIFORM_TO_ARRAY_SETTERS,c0 as UNIFORM_TO_SINGLE_SETTERS,Pg as UNIFORM_TYPES_MAP,fh as UNIFORM_TYPES_VALUES,Ka as UPDATE_BLEND,An as UPDATE_COLOR,Se as UPDATE_PRIORITY,Rw as UPDATE_TRANSFORM,yi as UPDATE_VISIBLE,$u as UboBatch,Ki as UboSystem,dt as UniformGroup,Vi as VERSION,qs as VideoSource,Jt as ViewContainer,D_ as ViewSystem,Rr as ViewableBuffer,Ih as VividLightBlend,go as WGSL_ALIGN_SIZE_DATA,Ud as WGSL_TO_STD40_SIZE,BM as WRAP_MODES,qd as WebGLRenderer,Fd as WebGPURenderer,pM as WebWorkerAdapter,Bf as WorkerManager,Tm as accessibilityTarget,Yh as addBits,Si as addMaskBounds,Ei as addMaskLocalBounds,og as addProgramDefines,Tv as alphaFrag,Qf as alphaWgsl,df as appendSVGPath,Nv as applyMatrix,x1 as applyProjectiveTransformationToPlane,Yd as applyStyleParams,Cn as assignWithIgnore,a3 as autoDetectEnvironment,d2 as autoDetectRenderer,jw as autoDetectSource,Il as basisTranscoderUrls,Te as bgr2rgb,P2 as bitmapFontCachePlugin,vl as bitmapFontTextParser,gf as bitmapFontXMLParser,xf as bitmapFontXMLStringParser,P1 as bitmapTextSplit,Kg as blendTemplateFrag,Zg as blendTemplateVert,Qg as blendTemplateWgsl,Bd as blockDataMap,Av as blurTemplateWgsl,$e as boundsPool,iS as browserExt,ml as buildAdaptiveBezier,Ty as buildAdaptiveQuadratic,gl as buildArc,Ey as buildArcTo,Py as buildArcToSvg,tn as buildCircle,ay as buildContextBatches,K0 as buildEllipse,XM as buildGeometryFromPath,Ji as buildLine,J0 as buildPixelLine,ey as buildPolygon,sy as buildRectangle,Z0 as buildRoundedRectangle,m1 as buildSVGFillAttributes,Ds as buildSVGPath,g1 as buildSVGStrokeAttributes,hl as buildSimpleUvs,ny as buildTriangle,cl as buildUvs,Np as cacheAsTextureMixin,R2 as cacheTextureArray,Wy as calculatePathArea,Z_ as calculateProjection,cu as canUseNewCanvasBlendModes,R1 as canvasTextSplit,Z as canvasUtils,Fc as checkChildrenDidChange,nr as checkDataUrl,Xt as checkExtension,Ly as checkForNestedPattern,Mu as checkMaxIfStatementsInShader,Wp as childrenHelperMixin,m_ as cleanArray,p_ as cleanHash,Yn as clearList,z0 as closePointEps,ln as collapseNewlines,un as collapseSpaces,UM as collectAllRenderables,zp as collectRenderablesMixin,Mr as color32BitToUniform,ki as colorBit,Oi as colorBitGl,Pv as colorMatrixFilterFrag,tp as colorMatrixFilterWgsl,j3 as colorToUniform,R0 as compareModeToGlCompare,xx as compileHighShader,_x as compileHighShaderGl,Ar as compileHighShaderGlProgram,Cr as compileHighShaderGpuProgram,jh as compileHooks,qh as compileInputs,fx as compileOutputs,kd as compileShader,_1 as compute2DProjection,wR as convertFormatIfRequired,Ce as convertToList,Rn as copySearchParams,C0 as createGlUploadCubeTextureResource,hb as createGpuUploadCubeTextureResource,Nr as createIdFromString,fp as createIndicesForQuads,JB as createLevelBuffers,PR as createLevelBuffersFromKTX,Gm as createStringVariations,Ve as createTexture,kb as createUboElementsSTD40,H_ as createUboElementsWGSL,zu as createUboSyncFunction,Nb as createUboSyncFunctionSTD40,X_ as createUboSyncFunctionWGSL,sC as crossOrigin,Mp as cullingMixin,X0 as curveEps,ls as defaultFilterVert,nl as defaultValue,xe as definedProps,I as deprecation,M2 as detectAvif,jB as detectBasis,UR as detectCompressed,D2 as detectDefaults,F2 as detectMp4,G2 as detectOgv,lu as detectVideoAlphaMode,U2 as detectWebm,I2 as detectWebp,nC as determineCrossOrigin,Rv as displacementFrag,Mv as displacementVert,ep as displacementWgsl,ux as earcut,Yp as effectsMixin,Yu as ensureAttributes,mh as ensureIsBuffer,ug as ensurePrecision,fn as ensureTextOptions,$n as executeInstructions,O as extensions,Jb as extractAttributesFromGlProgram,_g as extractAttributesFromGpuProgram,Jv as extractFontFamilies,_u as extractStructAndGroups,Hy as extractSubpaths,cf as extractSvgUrlId,Zn as fastCopy,qp as findMixin,ys as fontStringFromTextStyle,EM as formatShader,vx as fragmentGPUTemplate,Sx as fragmentGlTemplate,Ob as generateArraySyncSTD40,V_ as generateArraySyncWGSL,Sv as generateBlurFragSource,Cv as generateBlurGlProgram,wv as generateBlurProgram,Ev as generateBlurVertSource,TM as generateGPULayout,Tg as generateGpuLayoutGroups,SM as generateLayout,Eg as generateLayoutHash,T1 as generateParticleUpdateFunction,a0 as generateProgram,$b as generateShaderSyncCode,cD as generateTextStyleKey,Li as generateTextureBatchBit,Ni as generateTextureBatchBitGl,fl as generateTextureMatrix,f0 as generateUniformsSync,Wr as getAdjustedBlendModeBlend,Le as getAttributeInfoFromFormat,zi as getBatchSamplersUniformGroup,hn as getBitmapTextLayout,Vv as getCanvasBoundingBox,vs as getCanvasFillStyle,Hu as getCanvasTexture,Cl as getCharacterGroups,Rg as getDefaultUniformValue,GM as getFastGlobalBounds,Zp as getFastGlobalBoundsMixin,sB as getFillInstructionData,r1 as getFontCss,tC as getFontFamilyName,Xg as getGeometryBounds,wb as getGlTypeFromFormat,rs as getGlobalBounds,Jp as getGlobalMixin,pu as getGlobalRenderableBounds,pi as getLocalBounds,ig as getMaxFragmentPrecision,$y as getMaxMiterRatio,Wx as getMaxTexturesPerBatch,$0 as getOrientationOfPoints,_B as getPlainText,Pi as getPo2TextureFromSource,We as getResolutionOfUrl,s1 as getSVGUrl,Gl as getSupportedCompressedTextureFormats,Gf as getSupportedGPUCompressedTextureFormats,Df as getSupportedGlCompressedTextureFormats,Ss as getSupportedTextureFormats,i1 as getTemporaryCanvasFromImage,gu as getTestContext,Ii as getTextureBatchBindGroup,tD as getTextureDefaultMatrix,MR as getTextureFormatFromKTXTexture,e0 as getUboData,s0 as getUniformData,OT as getUrlExtension,rv as glFormatToGPUFormat,v0 as glUploadBufferImageResource,S0 as glUploadCompressedTextureResource,ol as glUploadImageResource,w0 as glUploadVideoResource,Cx as globalUniformsBit,Ax as globalUniformsBitGl,F3 as globalUniformsUBOBitGl,eR as gpuFormatToBasisTranscoderFormat,FR as gpuFormatToKTXBasisTranscoderFormat,ab as gpuUploadBufferImageResource,lb as gpuUploadCompressedTextureResource,Zu as gpuUploadImageResource,fb as gpuUploadVideoResource,zM as graphicsContextToSvg,q as groupD8,K3 as hasCachedCanvasTexture,Sl as hasTagMarkup,Tl as hasTagStyles,bM as hslWgsl,Bi as hslgl,Ri as hslgpu,Kh as injectBits,cg as insertVersion,Sf as isBreakAfterChar,de as isBreakingSpace,Jm as isCanvasFilterCapable,Tf as isCollapsibleSpace,xm as isMobile,an as isNewline,Gc as isPow2,J_ as isRenderingToScreen,al as isSafari,Xs as isSingleItem,hs as isWebGLSupported,ds as isWebGPUSupported,Ll as ktxTranscoderUrls,QB as loadBasis,j2 as loadBasisOnWorker,B2 as loadBitmapFont,uR as loadDDS,kh as loadEnvironmentExtensions,t1 as loadFontAsBase64,e1 as loadFontCSS,rC as loadImageBitmap,O2 as loadJson,TR as loadKTX,AR as loadKTX2,tv as loadKTX2onWorker,n1 as loadSVGImage,H2 as loadSvg,Ml as loadTextures,L2 as loadTxt,$2 as loadVideoTextures,N2 as loadWebFont,ti as localUniformBit,Hi as localUniformBitGl,Rx as localUniformBitGroup2,Xv as localUniformMSDFBit,$v as localUniformMSDFBitGl,Aw as log2,pD as logDebugTexture,n0 as logProgramError,rw as logRenderGroupScene,ew as logScene,Yv as mSDFBit,jv as mSDFBitGl,i2 as mapCanvasBlendModesToPixi,F0 as mapFormatToGlFormat,U0 as mapFormatToGlInternalFormat,k0 as mapFormatToGlType,Qb as mapGlToVertexFormat,wM as mapSize,Nd as mapType,L0 as mapViewDimensionToGlTarget,g0 as mapWebGLBlendModesToPixi,Kx as maskFrag,Qx as maskVert,pd as maskWgsl,Zt as matrixPool,dc as measureHtmlText,em as measureMixin,_2 as measureTaggedText,CM as migrateFragmentFromV7toV8,B0 as mipmapScaleModeToGlFilter,fi as multiplyColors,Ie as multiplyHexColors,Ir as nextPow2,Fv as noiseFrag,rp as noiseWgsl,aC as nonCompressedFormats,Oa as normalizeExtensionPriority,sm as onRenderMixin,Q2 as parseDDS,FM as parseFunctionBody,J2 as parseKTX,Gy as parseSVGDefinitions,kt as parseSVGFloatAttribute,my as parseSVGPath,hf as parseSVGStyle,yf as parseTaggedText,mp as particleData,S1 as particlesFrag,E1 as particlesVert,pp as particlesWgsl,Ng as passthroughFrag,ph as passthroughWgsl,ee as path,ah as pointInTriangle,iC as preloadVideo,za as removeItems,Ag as removeStructAndGroupDuplicates,Tw as resetUids,E2 as resolveCharacters,GR as resolveCompressedTextureUrl,Y2 as resolveJsonUrl,Dl as resolveTextureUrl,VT as resourceToTexture,wr as roundPixelsBit,Pr as roundPixelsBitGl,Ry as roundedShapeArc,My as roundedShapeQuadraticCurve,T_ as sayHello,$d as scaleModeToGlFilter,KB as setBasisTranscoderPath,ER as setKTXTranscoderPath,Lv as setPositions,dg as setProgramName,Hv as setUvs,Fr as shapeBuilders,nm as sortMixin,km as spritesheetAsset,Ai as squaredDistanceToLineSegment,pg as stripVersion,ky as styleAttributes,Bl as testImageFormat,Ts as testVideoFormat,Qv as textStyleToCSS,Dx as textureBit,Fx as textureBitGl,zT as textureFrom,Uv as tilingBit,Iv as tilingBitGl,Xr as toFillStyle,am as toLocalGlobalMixin,nn as toStrokeStyle,El as tokenize,XE as tokenizeTaggedRuns,Ho as transformVertices,dl as triangulateWithHoles,dr as trimRight,Cd as uboSyncFunctionsSTD40,W_ as uboSyncFunctionsWGSL,et as uid,Vr as uniformParsers,_P as unpremultiplyAlpha,Tu as unsafeEvalSupported,IM as updateLocalTransform,ou as updateQuadBounds,AS as updateRenderGroupTransform,sd as updateRenderGroupTransforms,Sa as updateTextBounds,Ix as updateTransformAndChildren,Ya as updateTransformBackwards,kM as updateWorldTransform,V as v8_0_0,kp as v8_3_4,Hl as validFormats,Ox as validateRenderables,yx as vertexGPUTemplate,Tx as vertexGlTemplate,sv as vkFormatToGPUFormat,k as warn,oS as webworkerExt,y2 as wordWrap,zE as wordWrapTaggedLines,ul as wrapModeToGlAddress};
|
|
3397
|
+
`}var uD=/^\s*$/;function lD(r,t){let e=[],s=t.lines[0],i="",n=[],o=0;return r.forEach(a=>{let u=uD.test(a),l=M1(a),c=i.length===0&&u;u&&!l&&c&&(!s||!s.startsWith(a))||(l||(i+=a),n.push(a),i.length>=s.length&&(e.push({line:i,chars:n}),n=[],i="",o++,s=t.lines[o]))}),e}function D1(r){let{text:t,style:e,chars:s}=r,i=e,n=At.measureText(t,i);if(n.runsByLine&&n.runsByLine.length>0)return cD(n,i,s,t);let o=At.graphemeSegmenter(t),a=lD(o,n),u=i.align,l=n.lineWidths.reduce((A,G)=>Math.max(A,G),0),c=i._fill?.fill,h=i._stroke?.fill,d=c instanceof Nt,f=h instanceof Nt,p=d||f,g=d&&c.textureSpace==="local"||f&&h.textureSpace==="local",_=n.width,b=n.height,y=i.clone();y.align="left";let v=0,T=0;if(y.trim){let{frame:A,canvasAndContext:G}=Je.getCanvasAndContext({text:t,style:i,resolution:1});Je.returnCanvasAndContext(G),v=-A.x,T=-A.y,y.trim=!1}let S=[],E=[],w=[],M=0,P=0,R=g?{width:_,height:b}:null;return a.forEach((A,G)=>{let H=new lt({label:`line-${G}`});H.y=M+T,E.push(H);let W=n.lineWidths[G],$=QA(u,W,l),B=new lt({label:"word"});B.x=$+v;let U=At._context;U.font=y._fontString,At.experimentalLetterSpacingSupported&&(U.letterSpacing="0px",U.textLetterSpacing="0px");let z=A.line,L=U.measureText(z).width;if(A.chars.forEach(K=>{if(M1(K))return;z=z.slice(K.length);let gt=z.length>0?U.measureText(z).width:0,ft=L-gt;if(L=gt,ft!==0)if(K===" ")B.children.length>0&&(w.push(B),H.addChild(B)),$+=ft+i.letterSpacing,B=new lt({label:"word"}),B.x=$+v;else{let Y=y;p&&(Y=y.clone(),Y._gradientOffset={x:-$,y:-M},R&&(Y._gradientBounds=R));let Q;P<s.length?(Q=s[P++],Q.text=K,Q.style=Y,Q.setFromMatrix(F.IDENTITY),Q.x=$-B.x+v):Q=new Zr({text:K,style:Y,x:$-B.x+v}),S.push(Q),B.addChild(Q),$+=ft+i.letterSpacing}}),B.children.length>0&&(w.push(B),H.addChild(B)),u==="justify"&&i.wordWrap&&G<a.length-1){let K=H.children,gt=K.length-1;if(gt>0){let ft=(l-W)/gt;for(let Y=1;Y<K.length;Y++)K[Y].x+=Y*ft}}M+=n.lineHeight}),{chars:S,lines:E,words:w}}function cD(r,t,e,s){let{runsByLine:i}=r,n=t.align,o=r.lineWidths.reduce((p,g)=>Math.max(p,g),0),a=0,u=0;if(t.trim){let{frame:p,canvasAndContext:g}=Je.getCanvasAndContext({text:s,style:t,resolution:1});Je.returnCanvasAndContext(g),a=-p.x,u=-p.y}let l=[],c=[],h=[],d=0,f=0;return i.forEach((p,g)=>{let _=new lt({label:`line-${g}`});_.y=d+u,c.push(_);let b=r.lineWidths[g],y=QA(n,b,o),v=new lt({label:"word"});v.x=y+a;for(let S of p){let E=S.style,w=E._fill?.fill,M=E._stroke?.fill,P=w instanceof Nt,R=M instanceof Nt,A=P||R,G=P&&w.textureSpace==="local"||R&&M.textureSpace==="local",H=At.graphemeSegmenter(S.text),W=E.clone();W.align="left",W.wordWrap=!1,W.trim&&(W.trim=!1),W.tagStyles=void 0,W._lineHeight=0;let $=At._context;$.font=W._fontString,At.experimentalLetterSpacingSupported&&($.letterSpacing="0px",$.textLetterSpacing="0px");let B=S.text,U=$.measureText(B).width,z=y,L=U,K=At.measureFont(W._fontString),gt=E.lineHeight||K.fontSize,ft=G?{width:L,height:gt}:null;for(let Y of H){B=B.slice(Y.length);let Q=B.length>0?$.measureText(B).width:0,j=U-Q;if(U=Q,!M1(Y)&&j!==0)if(Y===" ")v.children.length>0&&(h.push(v),_.addChild(v)),y+=j+E.letterSpacing,v=new lt({label:"word"}),v.x=y+a;else{let Bt=W;A&&(Bt=W.clone(),G?(Bt._gradientOffset={x:-(y-z),y:0},Bt._gradientBounds=ft):Bt._gradientOffset={x:-(y-z),y:0});let Ht;f<e.length?(Ht=e[f++],Ht.text=Y,Ht.style=Bt,Ht.setFromMatrix(F.IDENTITY),Ht.x=y-v.x+a):Ht=new Zr({text:Y,style:Bt,x:y-v.x+a}),l.push(Ht),v.addChild(Ht),y+=j+E.letterSpacing}}}if(v.children.length>0&&(h.push(v),_.addChild(v)),n==="justify"&&t.wordWrap&&g<i.length-1){let S=_.children,E=S.length-1;if(E>0){let w=(o-b)/E;for(let M=1;M<S.length;M++)S[M].x+=M*w}}let T=r.lineHeights?.[g]??r.lineHeight;d+=T}),{chars:l,lines:c,words:h}}var JA=class yp extends Sn{constructor(t){let e={...yp.defaultOptions,...t};super(e)}static from(t,e){let s={...yp.defaultOptions,...e,text:t.text,style:new Ot(t.style)},i=new yp({...s}),n=t.anchor;return(n.x!==0||n.y!==0)&&i.pivot.set(i.width*n.x,i.height*n.y),i}splitFn(){return D1({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};JA.defaultOptions={autoSplit:!0,lineAnchor:0,wordAnchor:0,charAnchor:0};var hD=JA;It();var tw=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function dD(r){let t=[],e=0;for(let s=0;s<tw.length;s++){let i=`_${tw[s]}`;t[e++]=r[i]}return e=ew(r._fill,t,e),e=pD(r._stroke,t,e),e=mD(r.dropShadow,t,e),e=fD(r.filters,t,e),t.join("-")}function fD(r,t,e){if(!r)return e;for(let s of r)t[e++]=s.uid;return e}function ew(r,t,e){return r&&(t[e++]=r.color,t[e++]=r.alpha,t[e++]=r.fill?.styleKey),e}function pD(r,t,e){return r&&(e=ew(r,t,e),t[e++]=r.width,t[e++]=r.alignment,t[e++]=r.cap,t[e++]=r.join,t[e++]=r.miterLimit),e}function mD(r,t,e){return r&&(t[e++]=r.alpha,t[e++]=r.angle,t[e++]=r.blur,t[e++]=r.distance,t[e++]=X.shared.setValue(r.color).toNumber()),e}Pe();async function gD(r,t,e=200){let s=await t.extract.base64(r);t.type!==Tt.CANVAS&&await t.encoder.commandFinished;let i=e;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}js();var xD=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],_D=0;function rw(r,t=0,e={color:"#000000"}){r.renderGroup&&(e.color=xD[_D++]);let s="";for(let o=0;o<t;o++)s+=" ";let i=r.label;!i&&r instanceof we&&(i=`sprite:${r.texture.label}`);let n=`%c ${s}|- ${i} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${e.color}; font-weight:bold;`),t++;for(let o=0;o<r.children.length;o++){let a=r.children[o];rw(a,t,{...e})}}function sw(r,t=0,e={index:0,color:"#000000"}){let s="";for(let n=0;n<t;n++)s+=" ";let i=`%c ${s}- ${e.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(i,`color:${e.color}; font-weight:bold;`),t++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];sw(o,t,{...e,index:n})}}Tm();Em();Tr();ir();Ys();Mn();Kc();Im();nu();It();Fp();zc();UT();Cm();mt();ex();Gm();Pm();qc();$c();Qa();Dm();tu();Yc();jc();Nn();Wg();Vg();Qx();t_();e_();rg();zg();Sr();$a();sg();qg();r_();Hs();ot();wc();An();oh();Us();Ue();jm();qm();Km();Zm();jt();Qm();jT();fy();vb();ld();zx();Mu();Ix();Yx();fd();jx();Xx();dd();qx();fs();yx();hx();dx();fx();mx();gx();Cx();Wn();Vn();Px();zi();ps();Zh();Nm();md();py();Hm();i_();Yp();i2();Wm();n_();uu();lu();a2();u2();d2();l2();c2();h2();ih();Lr();o2();Tb();Sb();Eb();Ui();wb();Rb();Bb();Fb();Gb();Ub();Ib();zb();kb();Vb();Xb();$b();jb();ku();Oe();Kb();c0();g0();Zb();Od();wd();e0();l0();og();hh();s0();n0();a0();Hd();ug();cg();dg();pg();gg();Id();Wb();Nb();m0();f0();v0();_0();rl();Vd();V0();S0();C0();w0();zd();B0();F0();U0();k0();L0();H0();D0();nE();z0();U_();I_();q_();k_();O_();L_();N_();H_();j_();K_();Z_();J_();rb();sb();ib();us();Ye();nb();Td();Y_();yg();vg();X_();Eg();Ag();Pg();ob();ab();Pd();Dd();lb();hb();fb();Rd();mb();gb();_b();u_();gd();cs();$u();Hr();ud();d_();p_();y_();Js();Kd();Xg();Qs();Yg();Zd();Ka();v_();eb();_d();qu();T_();Tg();lr();Rg();vd();te();Ed();Dg();Ad();Sd();C_();ni();to();je();ki();zu();zh();Zs();P_();f_();kc();qs();wi();Wt();rh();ht();M_();Oc();_r();kr();bd();Ym();Ln();G_();Pe();he();pi();qa();lh();ks();Wp();zp();$p();qp();Zp();Jp();Ls();sm();nm();am();lm();_e();Jh();Nc();ed();Hx();Hc();em();rd();Ns();td();Dc();Os();Ox();Nx();cy();e2();r2();bb();Yi();Dx();Qd();af();Ey();uf();Ay();Ry();J0();cl();ey();sy();ny();ay();hE();zr();Wo();yl();ci();ml();s2();qo();Fy();Gy();Iy();lf();xy();Ly();$y();ky();Hy();zy();zo();ff();tf();jy();j0();Jd();yb();Ux();Yn();js();id();_f();P2();oa();E2();Pl();A2();bs();wl();Ef();y2();vf();na();T2();fr();gu();br();km();Lm();zs();is();pm();th();bm();Xd();Oh();nd();le();x_();ye();Bc();Yt();Jc();ad();od();xt();pt();hm();Xs();Is();Np();xr();E_();cx();O.add(oS,uS);export{un as AbstractBitmapFont,_n as AbstractBitmapTextPipe,Er as AbstractRenderer,Sn as AbstractSplitText,Ms as AbstractText,xn as AbstractTextSystem,vm as AccessibilitySystem,xM as AlphaFilter,Fn as AlphaMask,oi as AlphaMaskPipe,ic as AnimatedSprite,kE as Application,Zn as ApplicationInitHook,Gl as Assets,Rf as AssetsClass,Wx as BLEND_TO_NPM,NE as BREAKING_SPACES,HE as BREAKING_SPACES_SET,zE as BREAK_AFTER_CHARS,XE as BREAK_AFTER_CHARS_SET,Ro as BUFFER_TYPE,Bl as BackgroundLoader,a_ as BackgroundSystem,cd as Batch,Iu as BatchGeometry,Fu as BatchTextureArray,li as BatchableGraphics,fc as BatchableHTMLText,Bs as BatchableMesh,Br as BatchableSprite,uc as BatchableText,$x as Batcher,io as BatcherPipe,Ct as BigPool,oe as BindGroup,ho as BindGroupSystem,wf as BitmapFont,Yr as BitmapFontManager,bn as BitmapText,up as BitmapTextGraphics,Ba as BitmapTextPipe,ut as BlendModeFilter,ai as BlendModePipe,tp as BlurFilter,rc as BlurFilterPass,_t as Bounds,Fm as BrowserAdapter,zt as Buffer,Ws as BufferImageSource,ms as BufferResource,ct as BufferUsage,ue as CLEAR,WE as COLLAPSIBLE_SPACES,VE as COLLAPSIBLE_SPACES_SET,at as Cache,dy as CanvasBatchAdaptor,Pa as CanvasBitmapTextPipe,$o as CanvasColorMaskPipe,Jo as CanvasContextSystem,kn as CanvasFilterSystem,Xo as CanvasGraphicsAdaptor,t2 as CanvasGraphicsContextSystem,Ko as CanvasGraphicsPipe,ta as CanvasLimitsSystem,Ia as CanvasNineSliceSpritePipe,Ei as CanvasObserver,bc as CanvasParticleContainerAdaptor,Fa as CanvasParticleContainerPipe,be as CanvasPool,nh as CanvasPoolClass,vl as CanvasRenderTargetAdaptor,ea as CanvasRenderTargetSystem,mf as CanvasRenderer,Aa as CanvasRendererTextSystem,ne as CanvasSource,Qo as CanvasStencilMaskPipe,Je as CanvasTextGenerator,At as CanvasTextMetrics,Ca as CanvasTextPipe,wa as CanvasTextSystem,ra as CanvasTextureSystem,va as CanvasTilingSpritePipe,du as Circle,X as Color,gh as ColorBlend,xh as ColorBurnBlend,_h as ColorDodgeBlend,Gn as ColorMask,no as ColorMaskPipe,Mv as ColorMatrixFilter,Gr as CompressedSource,lt as Container,c1 as CubeTexture,Da as CubeTextureSource,ov as Culler,Lf as CullerPlugin,ri as CustomRenderPipe,Z2 as D3D10_RESOURCE_DIMENSION,qe as D3DFMT,N3 as DATA_URI,it as DDS,Ip as DEG_TO_RAD,dp as DEPRECATED_SCALE_MODES,hp as DEPRECATED_WRAP_MODES,N as DOMAdapter,Am as DOMContainer,Rn as DOMPipe,RM as DRAW_MODES,K2 as DXGI_FORMAT,ze as DXGI_TO_TEXTURE_FORMAT,bh as DarkenBlend,so as DefaultBatcher,ro as DefaultShader,yh as DifferenceBlend,Gv as DisplacementFilter,vh as DivideBlend,Cf as DynamicBitmapFont,fu as Ellipse,ru as EventBoundary,St as EventEmitter,su as EventSystem,ur as EventsTicker,Th as ExclusionBlend,m as ExtensionType,f1 as ExternalSource,h_ as ExtractSystem,kf as FOURCC_TO_TEXTURE_FORMAT,Mm as FederatedContainer,ns as FederatedEvent,Or as FederatedMouseEvent,Ee as FederatedPointerEvent,yr as FederatedWheelEvent,Nt as FillGradient,hr as FillPattern,ae as Filter,Ur as FilterEffect,On as FilterPipe,Hn as FilterSystem,lp as FontStylePromiseCache,ec as GAUSSIAN_VALUES,vt as GCManagedHash,b_ as GCSystem,el as GL_FORMATS,hC as GL_INTERNAL_FORMAT,Do as GL_TARGETS,bt as GL_TYPES,QS as GL_WRAP_MODES,Ao as GPUTextureGpuData,ao as GenerateTextureSystem,Ne as Geometry,Db as GlBackBufferSystem,Bo as GlBatchAdaptor,tl as GlBuffer,Mo as GlBufferSystem,Go as GlColorMaskSystem,Ab as GlContextSystem,Uo as GlEncoderSystem,Gd as GlGeometryGpuData,Fo as GlGeometrySystem,wo as GlGraphicsAdaptor,Io as GlLimitsSystem,Po as GlMeshAdaptor,Tc as GlParticleContainerAdaptor,Ga as GlParticleContainerPipe,Rt as GlProgram,nl as GlProgramData,sl as GlRenderTarget,il as GlRenderTargetAdaptor,Lo as GlRenderTargetSystem,No as GlShaderSystem,y0 as GlStateSystem,ko as GlStencilSystem,Ji as GlTexture,jd as GlTextureSystem,Oo as GlUboSystem,Ho as GlUniformGroupSystem,rr as GlobalResourceRegistry,uo as GlobalUniformSystem,$n as GpuBatchAdaptor,Be as GpuBlendModesToPixi,yd as GpuBufferData,fo as GpuBufferSystem,po as GpuColorMaskSystem,Zi as GpuDeviceSystem,mo as GpuEncoderSystem,zn as GpuGraphicsAdaptor,sf as GpuGraphicsContext,go as GpuLimitsSystem,Xn as GpuMeshAdapter,Ju as GpuMipmapGenerator,Sc as GpuParticleContainerAdaptor,Ua as GpuParticleContainerPipe,Mt as GpuProgram,Ku as GpuRenderTarget,Zu as GpuRenderTargetAdaptor,So as GpuRenderTargetSystem,Eo as GpuShaderSystem,Co as GpuStateSystem,Dr as GpuStencilModesToPixi,xo as GpuStencilSystem,Md as GpuTextureSystem,yo as GpuUboSystem,vo as GpuUniformBatchPipe,xs as Graphics,Kt as GraphicsContext,nf as GraphicsContextRenderData,nn as GraphicsContextSystem,pf as GraphicsGpuData,He as GraphicsPath,Zo as GraphicsPipe,pc as HTMLText,Ra as HTMLTextPipe,yn as HTMLTextRenderData,hc as HTMLTextStyle,Ma as HTMLTextSystem,Sh as HardLightBlend,Eh as HardMixBlend,ji as HelloSystem,qb as IGLUniformData,ke as ImageSource,ss as InstructionSet,$t as KTX,Ch as LightenBlend,Ah as LinearBurnBlend,wh as LinearDodgeBlend,Ph as LinearLightBlend,O2 as Loader,Lt as LoaderParserPriority,Bh as LuminosityBlend,Ya as MaskEffectManager,Rc as MaskEffectManagerClass,Lu as MaskFilter,F as Matrix,or as Mesh,Xe as MeshGeometry,sc as MeshGpuData,ya as MeshPipe,v1 as MeshPlane,eD as MeshRope,S1 as MeshSimple,OE as NEWLINES,LE as NEWLINES_SET,_2 as NEWLINE_MATCH_REGEX,x2 as NEWLINE_SPLIT_REGEX,Ic as NOOP,Rh as NegationBlend,Jr as NineSliceGeometry,B1 as NineSlicePlane,KA as NineSliceSprite,_p as NineSliceSpriteGpuData,ka as NineSliceSpritePipe,yM as NoiseFilter,Et as ObservablePoint,Mh as OverlayBlend,Gp as PI_2,iD as Particle,yc as ParticleBuffer,oD as ParticleContainer,Qr as ParticleContainerPipe,vc as ParticleShader,vu as PassthroughFilter,tD as PerspectiveMesh,_c as PerspectivePlaneGeometry,Dh as PinLightBlend,To as PipelineSystem,Tn as PlaneGeometry,nt as Point,Bi as Polygon,za as Pool,Pc as PoolGroupClass,Iv as PrepareBase,lc as PrepareQueue,cp as PrepareSystem,mc as PrepareUpload,ac as QuadGeometry,Up as RAD_TO_DEG,J as Rectangle,m1 as RenderContainer,Vs as RenderGroup,si as RenderGroupPipe,Kn as RenderGroupSystem,jM as RenderLayer,co as RenderTarget,gs as RenderTargetSystem,Hu as RenderTexture,w_ as RenderableGCSystem,Qn as RendererInitHook,Tt as RendererType,sa as ResizePlugin,Ae as Resolver,T1 as RopeGeometry,pu as RoundedRectangle,DM as SCALE_MODES,Dt as STENCIL_MODES,gc as SVGDefsCollector,Xy as SVGParser,Fh as SaturationBlend,lo as SchedulerSystem,u1 as ScissorMask,cc as SdfShader,Vt as Shader,as as ShaderStage,bl as ShapePath,Vu as SharedRenderPipes,Ki as SharedSystems,Gh as SoftLightBlend,aD as SplitBitmapText,hD as SplitText,we as Sprite,ii as SpritePipe,Zc as Spritesheet,Ut as State,Un as StencilMask,oo as StencilMaskPipe,Uh as SubtractBlend,Ii as SystemRunner,Q2 as TEXTURE_FORMAT_BLOCK_SIZE,Zr as Text,Ot as TextStyle,D as Texture,R_ as TextureGCSystem,vi as TextureMatrix,yt as TexturePool,Lc as TexturePoolClass,st as TextureSource,Qt as TextureStyle,p1 as TextureUvs,Gt as Ticker,Si as TickerListener,ia as TickerPlugin,zv as TilingSprite,op as TilingSpriteGpuData,Ta as TilingSpritePipe,oc as TilingSpriteShader,nc as Transform,Jm as Triangle,d0 as UNIFORM_TO_ARRAY_SETTERS,h0 as UNIFORM_TO_SINGLE_SETTERS,Bg as UNIFORM_TYPES_MAP,fh as UNIFORM_TYPES_VALUES,Za as UPDATE_BLEND,Pn as UPDATE_COLOR,Se as UPDATE_PRIORITY,Mw as UPDATE_TRANSFORM,Ti as UPDATE_VISIBLE,Yu as UboBatch,Qi as UboSystem,dt as UniformGroup,Xi as VERSION,Ks as VideoSource,Jt as ViewContainer,F_ as ViewSystem,Rr as ViewableBuffer,Ih as VividLightBlend,_o as WGSL_ALIGN_SIZE_DATA,Ud as WGSL_TO_STD40_SIZE,MM as WRAP_MODES,qd as WebGLRenderer,Fd as WebGPURenderer,gM as WebWorkerAdapter,Bf as WorkerManager,Sm as accessibilityTarget,Yh as addBits,Ci as addMaskBounds,Ai as addMaskLocalBounds,ag as addProgramDefines,Ev as alphaFrag,Jf as alphaWgsl,df as appendSVGPath,Wv as applyMatrix,b1 as applyProjectiveTransformationToPlane,Yd as applyStyleParams,wn as assignWithIgnore,u3 as autoDetectEnvironment,f2 as autoDetectRenderer,qw as autoDetectSource,kl as basisTranscoderUrls,Te as bgr2rgb,B2 as bitmapFontCachePlugin,Tl as bitmapFontTextParser,gf as bitmapFontXMLParser,xf as bitmapFontXMLStringParser,R1 as bitmapTextSplit,Zg as blendTemplateFrag,Qg as blendTemplateVert,Jg as blendTemplateWgsl,Bd as blockDataMap,Pv as blurTemplateWgsl,$e as boundsPool,oS as browserExt,gl as buildAdaptiveBezier,Sy as buildAdaptiveQuadratic,xl as buildArc,Cy as buildArcTo,By as buildArcToSvg,rn as buildCircle,uy as buildContextBatches,Z0 as buildEllipse,YM as buildGeometryFromPath,en as buildLine,ty as buildPixelLine,ry as buildPolygon,iy as buildRectangle,Q0 as buildRoundedRectangle,x1 as buildSVGFillAttributes,Fs as buildSVGPath,_1 as buildSVGStrokeAttributes,dl as buildSimpleUvs,oy as buildTriangle,hl as buildUvs,Hp as cacheAsTextureMixin,M2 as cacheTextureArray,Vy as calculatePathArea,Q_ as calculateProjection,hu as canUseNewCanvasBlendModes,D1 as canvasTextSplit,Z as canvasUtils,Fc as checkChildrenDidChange,nr as checkDataUrl,Xt as checkExtension,Ny as checkForNestedPattern,Du as checkMaxIfStatementsInShader,Vp as childrenHelperMixin,g_ as cleanArray,m_ as cleanHash,qn as clearList,X0 as closePointEps,hn as collapseNewlines,cn as collapseSpaces,kM as collectAllRenderables,Xp as collectRenderablesMixin,Mr as color32BitToUniform,Li as colorBit,Ni as colorBitGl,Rv as colorMatrixFilterFrag,ep as colorMatrixFilterWgsl,q3 as colorToUniform,M0 as compareModeToGlCompare,_x as compileHighShader,bx as compileHighShaderGl,Ar as compileHighShaderGlProgram,Cr as compileHighShaderGpuProgram,jh as compileHooks,qh as compileInputs,px as compileOutputs,kd as compileShader,y1 as compute2DProjection,PR as convertFormatIfRequired,Ce as convertToList,Dn as copySearchParams,A0 as createGlUploadCubeTextureResource,db as createGpuUploadCubeTextureResource,Nr as createIdFromString,pp as createIndicesForQuads,tR as createLevelBuffers,BR as createLevelBuffersFromKTX,Um as createStringVariations,Ve as createTexture,Ob as createUboElementsSTD40,W_ as createUboElementsWGSL,Xu as createUboSyncFunction,Hb as createUboSyncFunctionSTD40,$_ as createUboSyncFunctionWGSL,nC as crossOrigin,Dp as cullingMixin,$0 as curveEps,ls as defaultFilterVert,ol as defaultValue,xe as definedProps,I as deprecation,D2 as detectAvif,qB as detectBasis,IR as detectCompressed,F2 as detectDefaults,G2 as detectMp4,U2 as detectOgv,cu as detectVideoAlphaMode,I2 as detectWebm,k2 as detectWebp,aC as determineCrossOrigin,Dv as displacementFrag,Fv as displacementVert,rp as displacementWgsl,lx as earcut,jp as effectsMixin,ju as ensureAttributes,mh as ensureIsBuffer,lg as ensurePrecision,mn as ensureTextOptions,jn as executeInstructions,O as extensions,t0 as extractAttributesFromGlProgram,bg as extractAttributesFromGpuProgram,e1 as extractFontFamilies,bu as extractStructAndGroups,Wy as extractSubpaths,cf as extractSvgUrlId,Jn as fastCopy,Kp as findMixin,ys as fontStringFromTextStyle,AM as formatShader,Tx as fragmentGPUTemplate,Ex as fragmentGlTemplate,Lb as generateArraySyncSTD40,z_ as generateArraySyncWGSL,Cv as generateBlurFragSource,wv as generateBlurGlProgram,Bv as generateBlurProgram,Av as generateBlurVertSource,EM as generateGPULayout,Sg as generateGpuLayoutGroups,CM as generateLayout,Cg as generateLayoutHash,E1 as generateParticleUpdateFunction,u0 as generateProgram,Yb as generateShaderSyncCode,dD as generateTextStyleKey,Hi as generateTextureBatchBit,Wi as generateTextureBatchBitGl,pl as generateTextureMatrix,p0 as generateUniformsSync,Wr as getAdjustedBlendModeBlend,Le as getAttributeInfoFromFormat,$i as getBatchSamplersUniformGroup,fn as getBitmapTextLayout,Xv as getCanvasBoundingBox,vs as getCanvasFillStyle,Wu as getCanvasTexture,Al as getCharacterGroups,Mg as getDefaultUniformValue,IM as getFastGlobalBounds,Qp as getFastGlobalBoundsMixin,iB as getFillInstructionData,i1 as getFontCss,rC as getFontFamilyName,$g as getGeometryBounds,Pb as getGlTypeFromFormat,rs as getGlobalBounds,tm as getGlobalMixin,mu as getGlobalRenderableBounds,gi as getLocalBounds,ng as getMaxFragmentPrecision,Yy as getMaxMiterRatio,Vx as getMaxTexturesPerBatch,Y0 as getOrientationOfPoints,bB as getPlainText,Ri as getPo2TextureFromSource,We as getResolutionOfUrl,n1 as getSVGUrl,Ul as getSupportedCompressedTextureFormats,Gf as getSupportedGPUCompressedTextureFormats,Df as getSupportedGlCompressedTextureFormats,Ss as getSupportedTextureFormats,o1 as getTemporaryCanvasFromImage,xu as getTestContext,Oi as getTextureBatchBindGroup,rD as getTextureDefaultMatrix,DR as getTextureFormatFromKTXTexture,r0 as getUboData,i0 as getUniformData,NT as getUrlExtension,sv as glFormatToGPUFormat,T0 as glUploadBufferImageResource,E0 as glUploadCompressedTextureResource,al as glUploadImageResource,P0 as glUploadVideoResource,Ax as globalUniformsBit,wx as globalUniformsBitGl,G3 as globalUniformsUBOBitGl,rR as gpuFormatToBasisTranscoderFormat,GR as gpuFormatToKTXBasisTranscoderFormat,ub as gpuUploadBufferImageResource,cb as gpuUploadCompressedTextureResource,Qu as gpuUploadImageResource,pb as gpuUploadVideoResource,$M as graphicsContextToSvg,q as groupD8,Z3 as hasCachedCanvasTexture,El as hasTagMarkup,Sl as hasTagStyles,vM as hslWgsl,Mi as hslgl,Di as hslgpu,Kh as injectBits,hg as insertVersion,Sf as isBreakAfterChar,de as isBreakingSpace,tg as isCanvasFilterCapable,Tf as isCollapsibleSpace,_m as isMobile,ln as isNewline,Gc as isPow2,tb as isRenderingToScreen,ul as isSafari,$s as isSingleItem,hs as isWebGLSupported,ds as isWebGPUSupported,Nl as ktxTranscoderUrls,JB as loadBasis,q2 as loadBasisOnWorker,R2 as loadBitmapFont,lR as loadDDS,kh as loadEnvironmentExtensions,r1 as loadFontAsBase64,s1 as loadFontCSS,iC as loadImageBitmap,L2 as loadJson,SR as loadKTX,wR as loadKTX2,ev as loadKTX2onWorker,a1 as loadSVGImage,W2 as loadSvg,Dl as loadTextures,N2 as loadTxt,Y2 as loadVideoTextures,H2 as loadWebFont,ei as localUniformBit,Vi as localUniformBitGl,Mx as localUniformBitGroup2,Yv as localUniformMSDFBit,jv as localUniformMSDFBitGl,ww as log2,gD as logDebugTexture,o0 as logProgramError,sw as logRenderGroupScene,rw as logScene,qv as mSDFBit,Kv as mSDFBitGl,n2 as mapCanvasBlendModesToPixi,G0 as mapFormatToGlFormat,I0 as mapFormatToGlInternalFormat,O0 as mapFormatToGlType,Jb as mapGlToVertexFormat,BM as mapSize,Nd as mapType,N0 as mapViewDimensionToGlTarget,x0 as mapWebGLBlendModesToPixi,Zx as maskFrag,Jx as maskVert,pd as maskWgsl,Zt as matrixPool,dc as measureHtmlText,rm as measureMixin,b2 as measureTaggedText,wM as migrateFragmentFromV7toV8,R0 as mipmapScaleModeToGlFilter,mi as multiplyColors,Ie as multiplyHexColors,Ir as nextPow2,Uv as noiseFrag,sp as noiseWgsl,lC as nonCompressedFormats,La as normalizeExtensionPriority,im as onRenderMixin,J2 as parseDDS,UM as parseFunctionBody,tv as parseKTX,Uy as parseSVGDefinitions,kt as parseSVGFloatAttribute,gy as parseSVGPath,hf as parseSVGStyle,yf as parseTaggedText,gp as particleData,C1 as particlesFrag,A1 as particlesVert,mp as particlesWgsl,Hg as passthroughFrag,ph as passthroughWgsl,ee as path,ah as pointInTriangle,oC as preloadVideo,Xa as removeItems,wg as removeStructAndGroupDuplicates,Sw as resetUids,C2 as resolveCharacters,UR as resolveCompressedTextureUrl,j2 as resolveJsonUrl,Fl as resolveTextureUrl,XT as resourceToTexture,wr as roundPixelsBit,Pr as roundPixelsBitGl,My as roundedShapeArc,Dy as roundedShapeQuadraticCurve,S_ as sayHello,$d as scaleModeToGlFilter,ZB as setBasisTranscoderPath,CR as setKTXTranscoderPath,Hv as setPositions,fg as setProgramName,Vv as setUvs,Fr as shapeBuilders,om as sortMixin,Om as spritesheetAsset,Pi as squaredDistanceToLineSegment,mg as stripVersion,Oy as styleAttributes,Rl as testImageFormat,Ts as testVideoFormat,t1 as textStyleToCSS,Fx as textureBit,Gx as textureBitGl,$T as textureFrom,kv as tilingBit,Ov as tilingBitGl,Xr as toFillStyle,um as toLocalGlobalMixin,an as toStrokeStyle,Cl as tokenize,YE as tokenizeTaggedRuns,Vo as transformVertices,fl as triangulateWithHoles,dr as trimRight,Cd as uboSyncFunctionsSTD40,V_ as uboSyncFunctionsWGSL,et as uid,Vr as uniformParsers,bP as unpremultiplyAlpha,Su as unsafeEvalSupported,OM as updateLocalTransform,au as updateQuadBounds,PS as updateRenderGroupTransform,sd as updateRenderGroupTransforms,Ea as updateTextBounds,kx as updateTransformAndChildren,ja as updateTransformBackwards,LM as updateWorldTransform,V as v8_0_0,Op as v8_3_4,Wl as validFormats,Lx as validateRenderables,vx as vertexGPUTemplate,Sx as vertexGlTemplate,iv as vkFormatToGPUFormat,k as warn,uS as webworkerExt,v2 as wordWrap,$E as wordWrapTaggedLines,ll as wrapModeToGlAddress};
|
|
3398
3398
|
/*! Bundled license information:
|
|
3399
3399
|
|
|
3400
3400
|
tiny-lru/dist/tiny-lru.js:
|